{{- if .Values.ingress.enabled -}} apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: {{ template "helm-guestbook.fullname" . }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: rules: # host rule to only reach the desired pods (aka canary/preview) - host: guestbook-desired.argoproj.io http: paths: - backend: serviceName: guestbook-canary-service servicePort: {{ .Values.service.port }} path: /* # host rule to only reach the stable pods - host: guestbook-stable.argoproj.io http: paths: - backend: serviceName: {{ template "helm-guestbook.fullname" . }} servicePort: {{ .Values.service.port }} path: /* # default rule which omits host, and will split traffic between desired vs. stable - 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 {{- end }}