Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save allwin-gists/98e2ae164a33b74a829c7920fe4339aa to your computer and use it in GitHub Desktop.

Select an option

Save allwin-gists/98e2ae164a33b74a829c7920fe4339aa to your computer and use it in GitHub Desktop.
{{- 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