Browse Source

canary update

pull/82/head
brandon 4 years ago
parent
commit
f693a54029
  1. 2
      Jenkinsfile
  2. 20
      helm-guestbook/templates/canary_service.yaml
  3. 2
      helm-guestbook/templates/rollout.yaml

2
Jenkinsfile

@ -14,7 +14,7 @@ pipeline {
sh "git config --system user.email 'b.yang@ext.tricentis.com'"
sh "git config --system user.name 'brandon'"
dir("argocd-example-apps") {
sh "cd helm-guestbook && sed -i 's+0.1+0.2+g' values.yaml"
sh "cd helm-guestbook && sed -i 's+0.2+0.1+g' values.yaml"
sh "git commit -am 'Publish new version' && git push || echo 'update version'"
}
}

20
helm-guestbook/templates/canary_service.yaml

@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: guestbook-canary-service
namespace: {{ template "helm-guestbook.fullname" . }}
labels:
app: {{ template "helm-guestbook.name" . }}
chart: {{ template "helm-guestbook.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "helm-guestbook.name" . }}
release: {{ .Release.Name }}

2
helm-guestbook/templates/rollout.yaml

@ -56,6 +56,8 @@ spec:
canary: #Indicates that the rollout should use the Canary strategy
maxSurge: "25%"
maxUnavailable: 0
canaryService: guestbook-canary-service
stableService: {{ template "helm-guestbook.fullname" . }}
steps:
- setWeight: 10
- pause:

Loading…
Cancel
Save