|
@@ -6,6 +6,7 @@
|
|
{{- $uiSvcPort := .Values.service.uiPort -}}
|
|
{{- $uiSvcPort := .Values.service.uiPort -}}
|
|
{{- $restSvcPort := .Values.service.restPort -}}
|
|
{{- $restSvcPort := .Values.service.restPort -}}
|
|
{{- $grpcSvcPort := .Values.service.grpcPort -}}
|
|
{{- $grpcSvcPort := .Values.service.grpcPort -}}
|
|
|
|
+{{- $classname := required "A valid .Values.ingress.className entry required! Please set this to your ingress class (nginx, traefik)" .Values.ingress.className}}
|
|
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
|
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
|
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
|
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
|
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
|
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
|
@@ -23,18 +24,29 @@ metadata:
|
|
name: {{ $fullUIName }}
|
|
name: {{ $fullUIName }}
|
|
labels:
|
|
labels:
|
|
{{- include "netmaker.labels" . | nindent 4 }}
|
|
{{- include "netmaker.labels" . | nindent 4 }}
|
|
- {{- with .Values.ingress.annotations }}
|
|
|
|
|
|
+ {{- with .Values.ingress }}
|
|
annotations:
|
|
annotations:
|
|
- {{- toYaml . | nindent 4 }}
|
|
|
|
|
|
+ {{- toYaml .annotations.base | nindent 4 }}
|
|
|
|
+ {{- if eq .className "nginx" }}
|
|
|
|
+ {{- toYaml .annotations.nginx | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
|
|
+ {{- if eq .className "traefik" }}
|
|
|
|
+ {{- toYaml .annotations.traefik | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
|
|
+ {{- if .tls.enabled }}
|
|
|
|
+ {{- toYaml .annotations.tls | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
spec:
|
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
|
- ingressClassName: {{ .Values.ingress.className }}
|
|
|
|
|
|
+ ingressClassName: {{ required "A valid .Values.ingress.className entry required!" .Values.ingress.className}}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
+ {{- if .Values.ingress.tls.enabled }}
|
|
tls:
|
|
tls:
|
|
- hosts:
|
|
- hosts:
|
|
- {{ .Values.ingress.hostPrefix.ui }}{{ .Values.baseDomain }}
|
|
- {{ .Values.ingress.hostPrefix.ui }}{{ .Values.baseDomain }}
|
|
secretName: {{ $fullUIName }}-tls-secret
|
|
secretName: {{ $fullUIName }}-tls-secret
|
|
|
|
+ {{- end}}
|
|
rules:
|
|
rules:
|
|
- host: {{ .Values.ingress.hostPrefix.ui }}{{ .Values.baseDomain }}
|
|
- host: {{ .Values.ingress.hostPrefix.ui }}{{ .Values.baseDomain }}
|
|
http:
|
|
http:
|
|
@@ -66,18 +78,29 @@ metadata:
|
|
name: {{ $fullRESTName }}
|
|
name: {{ $fullRESTName }}
|
|
labels:
|
|
labels:
|
|
{{- include "netmaker.labels" . | nindent 4 }}
|
|
{{- include "netmaker.labels" . | nindent 4 }}
|
|
- {{- with .Values.ingress.annotations }}
|
|
|
|
|
|
+ {{- with .Values.ingress }}
|
|
annotations:
|
|
annotations:
|
|
- {{- toYaml . | nindent 4 }}
|
|
|
|
|
|
+ {{- toYaml .annotations.base | nindent 4 }}
|
|
|
|
+ {{- if eq .className "nginx" }}
|
|
|
|
+ {{- toYaml .annotations.nginx | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
|
|
+ {{- if eq .className "traefik" }}
|
|
|
|
+ {{- toYaml .annotations.traefik | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
|
|
+ {{- if .tls.enabled }}
|
|
|
|
+ {{- toYaml .annotations.tls | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
spec:
|
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
|
- ingressClassName: {{ .Values.ingress.className }}
|
|
|
|
|
|
+ ingressClassName: {{ required "A valid .Values.ingress.className entry required!" .Values.ingress.className}}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
+ {{- if .Values.ingress.tls.enabled }}
|
|
tls:
|
|
tls:
|
|
- hosts:
|
|
- hosts:
|
|
- {{ .Values.ingress.hostPrefix.rest }}{{ .Values.baseDomain }}
|
|
- {{ .Values.ingress.hostPrefix.rest }}{{ .Values.baseDomain }}
|
|
secretName: {{ $fullRESTName }}-tls-secret
|
|
secretName: {{ $fullRESTName }}-tls-secret
|
|
|
|
+ {{- end }}
|
|
rules:
|
|
rules:
|
|
- host: {{ .Values.ingress.hostPrefix.rest }}{{ .Values.baseDomain }}
|
|
- host: {{ .Values.ingress.hostPrefix.rest }}{{ .Values.baseDomain }}
|
|
http:
|
|
http:
|
|
@@ -109,18 +132,31 @@ metadata:
|
|
name: {{ $fullGRPCName }}
|
|
name: {{ $fullGRPCName }}
|
|
labels:
|
|
labels:
|
|
{{- include "netmaker.labels" . | nindent 4 }}
|
|
{{- include "netmaker.labels" . | nindent 4 }}
|
|
- {{- with .Values.ingress.grpcAnnotations }}
|
|
|
|
|
|
+ {{- with .Values.ingress }}
|
|
annotations:
|
|
annotations:
|
|
- {{- toYaml . | nindent 4 }}
|
|
|
|
|
|
+ {{- toYaml .annotations.base | nindent 4 }}
|
|
|
|
+ {{- if eq .className "nginx" }}
|
|
|
|
+ {{- toYaml .annotations.nginx | nindent 4 }}
|
|
|
|
+ {{- toYaml .annotations.grpc.nginx | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
|
|
+ {{- if eq .className "traefik" }}
|
|
|
|
+ {{- toYaml .annotations.traefik | nindent 4 }}
|
|
|
|
+ {{- toYaml .annotations.grpc.traefik | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
|
|
+ {{- if .tls.enabled }}
|
|
|
|
+ {{- toYaml .annotations.tls | nindent 4 }}
|
|
|
|
+ {{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
spec:
|
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
|
- ingressClassName: {{ .Values.ingress.className }}
|
|
|
|
|
|
+ ingressClassName: {{ required "A valid .Values.ingress.className entry required!" .Values.ingress.className}}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
+ {{- if .Values.ingress.tls.enabled }}
|
|
tls:
|
|
tls:
|
|
- hosts:
|
|
- hosts:
|
|
- {{ .Values.ingress.hostPrefix.grpc }}{{ .Values.baseDomain }}
|
|
- {{ .Values.ingress.hostPrefix.grpc }}{{ .Values.baseDomain }}
|
|
secretName: {{ $fullGRPCName }}-tls-secret
|
|
secretName: {{ $fullGRPCName }}-tls-secret
|
|
|
|
+ {{- end }}
|
|
rules:
|
|
rules:
|
|
- host: {{ .Values.ingress.hostPrefix.grpc }}{{ .Values.baseDomain }}
|
|
- host: {{ .Values.ingress.hostPrefix.grpc }}{{ .Values.baseDomain }}
|
|
http:
|
|
http:
|