Skip to content

Commit

Permalink
Update ingress to allow dual deployment, as I am pretty sure we can n…
Browse files Browse the repository at this point in the history
…ot run it in the same namespace
  • Loading branch information
marchermans committed Dec 13, 2024
1 parent 6ffb71a commit b2d8608
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 60 deletions.
3 changes: 2 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit"
"ms-dotnettools.csdevkit",
"ms-kubernetes-tools.vscode-kubernetes-tools"
]
}
}
Expand Down
55 changes: 14 additions & 41 deletions Charts/ldtteam-authentication-server/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,34 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "ldtteam-authentication-server.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "ldtteam-authentication-server.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
cert-manager.io/cluster-issuer: letsencrypt-production
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: 30m
nginx.ingress.kubernetes.io/proxy-buffer-size: 256k
nginx.ingress.kubernetes.io/proxy-buffering: 'on'
nginx.ingress.kubernetes.io/proxy-buffers-number: '4'
nginx.ingress.kubernetes.io/proxy-max-temp-file-size: 1024m
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
ingressClassName: "nginx"
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
- {{ .Values.ingress.hostName }}
secretName: auth-minecolonies-tls
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
- host: {{ .Values.ingress.hostName | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
- path: /
pathType: ImplementationSpecifics
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
number: {{ .Values.service.port }}
{{- end }}
19 changes: 1 addition & 18 deletions Charts/ldtteam-authentication-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,7 @@ service:

ingress:
enabled: true
className: "nginx"
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: 30m
nginx.ingress.kubernetes.io/proxy-buffer-size: 256k
nginx.ingress.kubernetes.io/proxy-buffering: 'on'
nginx.ingress.kubernetes.io/proxy-buffers-number: '4'
nginx.ingress.kubernetes.io/proxy-max-temp-file-size: 1024m
hosts:
- host: auth.minecolonies.com
paths:
- path: /
pathType: ImplementationSpecific
tls:
- secretName: auth-minecolonies-tls
hosts:
- auth.minecolonies.com
hostname: auth.minecolonies.com

livenessProbe:
httpGet:
Expand Down

0 comments on commit b2d8608

Please sign in to comment.