Skip to content

Commit

Permalink
Forgot tls disabling for a few other ingresses, also added rewrite he…
Browse files Browse the repository at this point in the history
…aders for kong ingress

Needed to backfill some of these configs to fully support load balancer tls disabling, and some people prefer kong for ingress control, so support it out of the box too.
  • Loading branch information
michaeljguarino committed Mar 25, 2024
1 parent f7bf610 commit c17dae4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
17 changes: 12 additions & 5 deletions charts/console/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ metadata:
labels:
{{ include "console.labels" . | indent 4 }}
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
{{- with .Values.ingress.rewrite.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down Expand Up @@ -83,16 +84,21 @@ metadata:
name: console-external
labels:
{{ include "console.labels" . | indent 4 }}
{{- with .Values.externalIngress.annotations }}
annotations:
{{- with .Values.externalIngress.rewrite.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.externalIngress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.externalIngress.ingressClass }}
{{ if .Values.externalIngress.tls.enabled }}
tls:
- hosts:
- {{ .Values.externalIngress.hostname | quote }}
secretName: console-external-tls
{{ end }}
rules:
- host: {{ .Values.externalIngress.hostname | quote }}
http:
Expand All @@ -112,8 +118,9 @@ metadata:
labels:
{{ include "console.labels" . | indent 4 }}
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
{{- with .Values.externalIngress.rewrite.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.externalIngress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
13 changes: 13 additions & 0 deletions charts/console/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ ingress:
tls:
enabled: true

rewrite:
annotations:
konghq.com/rewrite: /$2
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2

annotations:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: letsencrypt-prod
Expand All @@ -91,6 +97,13 @@ externalIngress:
tls:
enabled: true
ingressClass: nginx

rewrite:
annotations:
konghq.com/rewrite: /
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /

annotations:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: letsencrypt-prod
Expand Down
2 changes: 1 addition & 1 deletion plural/helm/kas/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: kas
description: k8s agent server
version: 0.0.5
version: 0.0.6
appVersion: "0.0.1"
dependencies:
- name: redis
Expand Down
4 changes: 3 additions & 1 deletion plural/helm/kas/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ spec:
name: {{ include "kas.serviceName" . }}
port:
number: {{ .Values.service.externalPort }}
{{ if .Values.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.ingress.kas_dns | quote }}
secretName: {{ .Values.ingress.tlsSecretName }}
secretName: {{ .Values.ingress.tlsSecretName }}
{{ end }}
4 changes: 4 additions & 0 deletions plural/helm/kas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ ingress:
ingressClass: nginx
kubernetesApiPath: /k8s-proxy
tlsSecretName: kas-tls

tls:
enabled: true

annotations:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: letsencrypt-prod
Expand Down

0 comments on commit c17dae4

Please sign in to comment.