Skip to content

Commit

Permalink
Don't generate ingresses if .Values.ingress.url isn't provided
Browse files Browse the repository at this point in the history
  • Loading branch information
rielas committed Apr 1, 2024
1 parent a0bc4a2 commit 76ca2ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/brokencrystals/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: |
Benchmark application that uses modern technologies and implements a set of
common security vulnerabilities
type: application
version: 0.0.66
version: 0.0.67
keywords:
- brokencrystals
- brkn
16 changes: 10 additions & 6 deletions charts/brokencrystals/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.ingress.url }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand All @@ -7,15 +8,15 @@ metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-ssl-protocols: "TLSv1.1 TLSv1.2"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
{{ if eq .Values.ingress.cert "" }}
{{- if eq .Values.ingress.cert "" }}
cert-manager.io/cluster-issuer: letsencrypt-cf-prod
{{ end }}
{{- end }}
spec:
ingressClassName: nginx
tls:
- hosts:
- {{ .Values.ingress.url }}
secretName: {{ if eq .Values.ingress.cert "" }}{{ include "brokencrystals.fullname" . }}-brokencrystals-secret{{ else }}{{ .Values.ingress.cert }}{{ end }}
secretName: {{- if eq .Values.ingress.cert "" }}{{ include "brokencrystals.fullname" . }}-brokencrystals-secret{{ else }}{{ .Values.ingress.cert }}{{- end }}
rules:
- host: {{ .Values.ingress.url }}
http:
Expand All @@ -27,7 +28,9 @@ spec:
name: {{ .Release.Name }}
port:
number: 80
{{- end }}

{{- if .Values.ingress.url }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand All @@ -37,15 +40,15 @@ metadata:
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-ssl-protocols: "TLSv1.1 TLSv1.2"
{{ if eq .Values.ingress.cert "" }}
{{- if eq .Values.ingress.cert "" }}
cert-manager.io/cluster-issuer: letsencrypt-cf-prod
{{ end }}
{{- end }}
spec:
ingressClassName: nginx
tls:
- hosts:
- auth{{ .Values.ingress.authlevel }}{{ .Values.ingress.url }}
secretName: {{ if eq .Values.ingress.cert "" }}{{ include "brokencrystals.fullname" . }}-brokencrystals-keycloak-secret{{ else }}{{ .Values.ingress.cert }}{{ end }}
secretName: {{- if eq .Values.ingress.cert "" }}{{ include "brokencrystals.fullname" . }}-brokencrystals-keycloak-secret{{ else }}{{ .Values.ingress.cert }}{{- end }}
rules:
- host: auth{{ .Values.ingress.authlevel }}{{ .Values.ingress.url }}
http:
Expand All @@ -57,3 +60,4 @@ spec:
name: {{ .Release.Name }}-keycloak
port:
number: 8080
{{- end }}
2 changes: 1 addition & 1 deletion charts/brokencrystals/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress:
url: k3s.brokencrystals.nexploit.app
url:
cert: ""
authlevel: "."
images:
Expand Down

0 comments on commit 76ca2ca

Please sign in to comment.