Browse Source

update nginx

pull/82/head
brandon 4 years ago
parent
commit
7ef047bfd2
  1. 10
      helm-guestbook/templates/ingress.yaml
  2. 17
      helm-guestbook/templates/rollout.yaml
  3. 63
      helm-guestbook/values.yaml

10
helm-guestbook/templates/ingress.yaml

@ -9,14 +9,12 @@ metadata:
{{- end }} {{- end }}
spec: spec:
rules: rules:
- host: argo.cirruslabs.io
- http: - http:
paths: paths:
- path: /* - path: /*
backend: backend:
# serviceName must match either: canary.trafficRouting.alb.rootService (if specified), # serviceName must match canary.stableService
# or canary.stableService (if rootService is omitted) serviceName: {{ template "helm-guestbook.fullname" . }}
serviceName: root-service servicePort: {{ .Values.service.port }}
# 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
{{- end }} {{- end }}

17
helm-guestbook/templates/rollout.yaml

@ -67,13 +67,12 @@ spec:
canaryService: guestbook-canary-service canaryService: guestbook-canary-service
stableService: {{ template "helm-guestbook.fullname" . }} stableService: {{ template "helm-guestbook.fullname" . }}
trafficRouting: trafficRouting:
alb: nginx:
# The referenced ingress will be injected with a custom action annotation, directing # 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 # the Nginx to split traffic between the canary and stable Service using headers
# Service, according to the desired traffic weight (required). stableIngress: {{ template "helm-guestbook.fullname" . }}
ingress: {{ template "helm-guestbook.fullname" . }} annotationPrefix: nginx.ingress.kubernetes.io # optional
# Reference to a Service that the Ingress must target in one of the rules (optional). additionalIngressAnnotations: # optional
# If omitted, uses canary.stableService. canary: true
rootService: guestbook-root-service canary-by-header: Region
# Service port is the port which the Service listens on (required). canary-by-header-value: aspc|eu
servicePort: {{ .Values.service.port }}

63
helm-guestbook/values.yaml

@ -16,36 +16,39 @@ service:
ingress: ingress:
enabled: true enabled: true
annotations: annotations:
kubernetes.io/ingress.class: alb # kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/actions.root-service: | # alb.ingress.kubernetes.io/actions.root-service: |
{ # {
"Type":"forward", # "Type":"forward",
"ForwardConfig":{ # "ForwardConfig":{
"TargetGroups":[ # "TargetGroups":[
{ # {
"Weight":20, # "Weight":20,
"ServiceName":"canary-service", # "ServiceName":"canary-service",
"ServicePort":"{{ .Values.service.port }}" # "ServicePort":"{{ .Values.service.port }}"
}, # },
{ # {
"Weight":40, # "Weight":40,
"ServiceName":"canary-service", # "ServiceName":"canary-service",
"ServicePort":"{{ .Values.service.port }}" # "ServicePort":"{{ .Values.service.port }}"
}, # },
{ # {
"Weight":60, # "Weight":60,
"ServiceName":"canary-service", # "ServiceName":"canary-service",
"ServicePort":"{{ .Values.service.port }}" # "ServicePort":"{{ .Values.service.port }}"
}, # },
{ # {
"Weight":80, # "Weight":80,
"ServiceName":"stable-service", # "ServiceName":"stable-service",
"ServicePort":"{{ .Values.service.port }}" # "ServicePort":"{{ .Values.service.port }}"
} # }
] # ]
} # }
} # }
# kubernetes.io/ingress.class: nginx # 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" # kubernetes.io/tls-acme: "true"
path: / path: /
hosts: hosts:

Loading…
Cancel
Save