Skip to content

Commit

Permalink
Merge branch 'upgrade-ingress'
Browse files Browse the repository at this point in the history
This closes #65
  • Loading branch information
awlx committed Jan 24, 2022
2 parents cc272ab + 1026af7 commit a0eb46e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion deploy/helm/wg-access-server/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }}
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "wg-access-server.fullname" . -}}
{{- if semverCompare ">=1.19-0" $kubeTargetVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" $kubeTargetVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: {{ .Values.controller.ingress.apiVersion }}
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
Expand All @@ -11,6 +18,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.ingressClassName }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
Expand All @@ -28,7 +38,15 @@ spec:
paths:
- path: /
backend:
{{- if semverCompare ">=1.19-0" $kubeTargetVersion }}
service:
name: {{ $fullName }}-web
port:
number: 80
pathType: Prefix
{{- else -}}
serviceName: {{ $fullName }}-web
servicePort: 80
servicePort: http
{{- end }}
{{- end }}
{{- end }}

0 comments on commit a0eb46e

Please sign in to comment.