Created
July 9, 2021 11:42
-
-
Save allwin-gists/98e2ae164a33b74a829c7920fe4339aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{- if .Values.ingress.enabled -}} | |
| {{- $servicePort := .Values.service.port -}} | |
| {{- $serviceName := required "Name of service is required" .Values.service.name -}} | |
| {{- $ingressPath := .Values.ingress.path -}} | |
| apiVersion: networking.k8s.io/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: {{ required "Name of ingress is required" .Values.ingress.name }}-canary | |
| namespace: {{ .Values.namespace }} | |
| {{- with .Values.ingress.annotations }} | |
| annotations: | |
| {{ toYaml . | indent 4 }} | |
| {{- end }} | |
| {{- with .Values.ingress.modsecuritySnippet }} | |
| nginx.ingress.kubernetes.io/modsecurity-snippet: {{ toYaml . | indent 7 | trim }} | |
| {{- end }} | |
| {{- with .Values.ingress.canaryAnnotations }} | |
| {{ toYaml . | indent 4 }} | |
| {{- end }} | |
| spec: | |
| {{- if .Values.ingress.tls }} | |
| tls: | |
| {{ toYaml .Values.ingress.tls | indent 4 }} | |
| {{- end }} | |
| rules: | |
| {{- range .Values.ingress.hosts }} | |
| - host: {{ . }} | |
| http: | |
| paths: | |
| - backend: | |
| serviceName: {{ $serviceName }}-canary | |
| servicePort: http | |
| path: {{ $ingressPath }} | |
| {{- end }} | |
| {{- end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment