Skip to content

Commit

Permalink
feat(base-cluster/nginx): add possibility to disable ingress (#489)
Browse files Browse the repository at this point in the history
Add ability to disable ingress.
  • Loading branch information
marvinWolff committed Oct 6, 2023
1 parent f94fc7a commit c5d822a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions charts/base-cluster/ci/disabled-ingress-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ingress:
enabled: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.certManager.email }}
{{- if and .Values.certManager.email .Values.ingress.enabled }}
{{- include "base-cluster.helm.resourceWithDependencies" (dict "name" "clusterissuer-letsencrypt-production" "resource" (include "base-cluster.cert-manager.clusterIssuer" (dict "name" "production" "url" "https://acme-v02.api.letsencrypt.org/directory" "context" $)) "dependencies" (dict "cert-manager" "cert-manager") "context" $ "additionalLabels" (dict "app.kubernetes.io/component" "cert-manager")) }}
---
{{- include "base-cluster.helm.resourceWithDependencies" (dict "name" "clusterissuer-letsencrypt-staging" "resource" (include "base-cluster.cert-manager.clusterIssuer" (dict "name" "staging" "url" "https://acme-staging-v02.api.letsencrypt.org/directory" "context" $)) "dependencies" (dict "cert-manager" "cert-manager") "context" $ "additionalLabels" (dict "app.kubernetes.io/component" "cert-manager")) }}
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/global/cluster-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.dns.provider .Values.global.baseDomain }}
{{- if and .Values.dns.provider .Values.global.baseDomain .Values.ingress.enabled }}
{{- if false }}
apiVersion: networking.k8s.io/v1
{{- else }}
Expand Down
2 changes: 2 additions & 0 deletions charts/base-cluster/templates/ingress/nginx.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.ingress.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
Expand Down Expand Up @@ -82,3 +83,4 @@ spec:
image:
registry: {{ .Values.global.imageRegistry }}
{{- end }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ dashboards:
metrics:
<<: *dashboard
gnetId: 8588
{{- if .Values.ingress.enabled}}
ingress-nginx:
<<: *dashboard
gnetId: 9614
Expand All @@ -101,6 +102,7 @@ dashboards:
<<: *dashboard
gnetId: 11001
revision: 1
{{- end}}
flux:
<<: *dashboard
gnetId: 16714
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- define "base-cluster.monitoring.ingress" -}}
{{- $ingress := dig .name "ingress" nil .context.Values.monitoring | required (printf "You need to set the `ingress` for %s" .name) -}}
{{- if and .context.Values.certManager.email $ingress.enabled (or .context.Values.global.baseDomain $ingress.customDomain) -}}
{{- if and .context.Values.certManager.email $ingress.enabled .context.Values.ingress.enabled (or .context.Values.global.baseDomain $ingress.customDomain) -}}
{{- $host := include (printf "base-cluster.%s.host" .name) .context -}}
ingress:
enabled: true
Expand Down
5 changes: 5 additions & 0 deletions charts/base-cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,11 @@
"resources": {
"$ref": "#/$defs/resourceRequirements"
},
"enabled": {
"type": [
"boolean"
]
},
"IP": {
"type": [
"string",
Expand Down
2 changes: 2 additions & 0 deletions charts/base-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ global:
additionalLabels:
app.kubernetes.io/component: cert-manager
ingress-nginx:
condition: "{{ .Values.ingress.enabled }}"
additionalLabels:
app.kubernetes.io/component: ingress
kyverno:
Expand Down Expand Up @@ -364,6 +365,7 @@ flux:
gitRepositories: {}

ingress:
enabled: true
replicas: 2
resources:
requests:
Expand Down

0 comments on commit c5d822a

Please sign in to comment.