From 7ef047bfd208323e95deda47bed2cfbd03ddd7ae Mon Sep 17 00:00:00 2001 From: brandon Date: Mon, 5 Apr 2021 21:59:39 -0400 Subject: [PATCH] update nginx --- helm-guestbook/templates/ingress.yaml | 10 ++--- helm-guestbook/templates/rollout.yaml | 17 ++++---- helm-guestbook/values.yaml | 63 ++++++++++++++------------- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/helm-guestbook/templates/ingress.yaml b/helm-guestbook/templates/ingress.yaml index 1bdd9dc..14345ca 100644 --- a/helm-guestbook/templates/ingress.yaml +++ b/helm-guestbook/templates/ingress.yaml @@ -9,14 +9,12 @@ metadata: {{- end }} spec: rules: + - host: argo.cirruslabs.io - http: paths: - path: /* backend: - # serviceName must match either: canary.trafficRouting.alb.rootService (if specified), - # or canary.stableService (if rootService is omitted) - serviceName: root-service - # servicePort must be the value: use-annotation - # This instructs AWS Load Balancer Controller to look to annotations on how to direct traffic - servicePort: use-annotation + # serviceName must match canary.stableService + serviceName: {{ template "helm-guestbook.fullname" . }} + servicePort: {{ .Values.service.port }} {{- end }} \ No newline at end of file diff --git a/helm-guestbook/templates/rollout.yaml b/helm-guestbook/templates/rollout.yaml index 57081ea..e94a6be 100644 --- a/helm-guestbook/templates/rollout.yaml +++ b/helm-guestbook/templates/rollout.yaml @@ -67,13 +67,12 @@ spec: canaryService: guestbook-canary-service stableService: {{ template "helm-guestbook.fullname" . }} trafficRouting: - alb: + nginx: # The referenced ingress will be injected with a custom action annotation, directing - # the AWS Load Balancer Controller to split traffic between the canary and stable - # Service, according to the desired traffic weight (required). - ingress: {{ template "helm-guestbook.fullname" . }} - # Reference to a Service that the Ingress must target in one of the rules (optional). - # If omitted, uses canary.stableService. - rootService: guestbook-root-service - # Service port is the port which the Service listens on (required). - servicePort: {{ .Values.service.port }} + # the Nginx to split traffic between the canary and stable Service using headers + stableIngress: {{ template "helm-guestbook.fullname" . }} + annotationPrefix: nginx.ingress.kubernetes.io # optional + additionalIngressAnnotations: # optional + canary: true + canary-by-header: Region + canary-by-header-value: aspc|eu diff --git a/helm-guestbook/values.yaml b/helm-guestbook/values.yaml index 1bca953..f762dc2 100644 --- a/helm-guestbook/values.yaml +++ b/helm-guestbook/values.yaml @@ -16,36 +16,39 @@ service: ingress: enabled: true annotations: - kubernetes.io/ingress.class: alb - alb.ingress.kubernetes.io/actions.root-service: | - { - "Type":"forward", - "ForwardConfig":{ - "TargetGroups":[ - { - "Weight":20, - "ServiceName":"canary-service", - "ServicePort":"{{ .Values.service.port }}" - }, - { - "Weight":40, - "ServiceName":"canary-service", - "ServicePort":"{{ .Values.service.port }}" - }, - { - "Weight":60, - "ServiceName":"canary-service", - "ServicePort":"{{ .Values.service.port }}" - }, - { - "Weight":80, - "ServiceName":"stable-service", - "ServicePort":"{{ .Values.service.port }}" - } - ] - } - } - # kubernetes.io/ingress.class: nginx + # kubernetes.io/ingress.class: alb + # alb.ingress.kubernetes.io/actions.root-service: | + # { + # "Type":"forward", + # "ForwardConfig":{ + # "TargetGroups":[ + # { + # "Weight":20, + # "ServiceName":"canary-service", + # "ServicePort":"{{ .Values.service.port }}" + # }, + # { + # "Weight":40, + # "ServiceName":"canary-service", + # "ServicePort":"{{ .Values.service.port }}" + # }, + # { + # "Weight":60, + # "ServiceName":"canary-service", + # "ServicePort":"{{ .Values.service.port }}" + # }, + # { + # "Weight":80, + # "ServiceName":"stable-service", + # "ServicePort":"{{ .Values.service.port }}" + # } + # ] + # } + # } + # nginx.ingress.kubernetes.io/canary: "true" + kubernetes.io/ingress.class: nginx + # nginx.ingress.kubernetes.io/canary-by-header: "Region" + # nginx.ingress.kubernetes.io/canary-by-header-pattern: "aspc|eu" # kubernetes.io/tls-acme: "true" path: / hosts: