From f693a54029e7f62262d12685d9e736a826e7cd67 Mon Sep 17 00:00:00 2001 From: brandon Date: Tue, 23 Mar 2021 10:43:51 -0400 Subject: [PATCH] canary update --- Jenkinsfile | 2 +- helm-guestbook/templates/canary_service.yaml | 20 ++++++++++++++++++++ helm-guestbook/templates/rollout.yaml | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 helm-guestbook/templates/canary_service.yaml diff --git a/Jenkinsfile b/Jenkinsfile index 033d2fb..0c5da3a 100644 --- a/Jenkinsfile +++ b/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'" } } diff --git a/helm-guestbook/templates/canary_service.yaml b/helm-guestbook/templates/canary_service.yaml new file mode 100644 index 0000000..5cc9cbc --- /dev/null +++ b/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 }} diff --git a/helm-guestbook/templates/rollout.yaml b/helm-guestbook/templates/rollout.yaml index 07d3714..999ab39 100644 --- a/helm-guestbook/templates/rollout.yaml +++ b/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: