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 }}
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 }}

17
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

63
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:

Loading…
Cancel
Save