* Helpers: Align `ingress-nginx.namespace` to `ingress-nginx.name`. * Templates: Remove quotes. In alignment to others. Also does not make sense as `namespace` must conform to DNS. * Admission Webhooks/Validating Webhook: Make use of `ingress-nginx.namespace`. * KEDA: Remove comment. * Templates: Add forgotten namespace definitions.
This commit is contained in:
parent
e805d4955d
commit
9cb3919e84
10 changed files with 16 additions and 20 deletions
|
@ -31,16 +31,12 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
|
Expand the namespace of the release.
|
||||||
|
Allows overriding it for multi-namespace deployments in combined charts.
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "ingress-nginx.namespace" -}}
|
{{- define "ingress-nginx.namespace" -}}
|
||||||
{{- if .Values.namespaceOverride -}}
|
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
{{- .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- else -}}
|
|
||||||
{{- .Release.Namespace -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Container SecurityContext.
|
Container SecurityContext.
|
||||||
|
@ -113,7 +109,6 @@ By convention this will simply use the <namespace>/<controller-name> to match th
|
||||||
service generated.
|
service generated.
|
||||||
|
|
||||||
Users can provide an override for an explicit service they want bound via `.Values.controller.publishService.pathOverride`
|
Users can provide an override for an explicit service they want bound via `.Values.controller.publishService.pathOverride`
|
||||||
|
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "ingress-nginx.controller.publishServicePath" -}}
|
{{- define "ingress-nginx.controller.publishServicePath" -}}
|
||||||
{{- $defServiceName := printf "%s/%s" "$(POD_NAMESPACE)" (include "ingress-nginx.controller.fullname" .) -}}
|
{{- $defServiceName := printf "%s/%s" "$(POD_NAMESPACE)" (include "ingress-nginx.controller.fullname" .) -}}
|
||||||
|
|
|
@ -19,5 +19,5 @@ roleRef:
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "ingress-nginx.admissionWebhooks.fullname" . }}
|
name: {{ include "ingress-nginx.admissionWebhooks.fullname" . }}
|
||||||
namespace: {{ (include "ingress-nginx.namespace" .) | quote }}
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -20,5 +20,5 @@ roleRef:
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "ingress-nginx.admissionWebhooks.fullname" . }}
|
name: {{ include "ingress-nginx.admissionWebhooks.fullname" . }}
|
||||||
namespace: {{ (include "ingress-nginx.namespace" .) | quote }}
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -6,8 +6,8 @@ kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
{{- if .Values.controller.admissionWebhooks.certManager.enabled }}
|
{{- if .Values.controller.admissionWebhooks.certManager.enabled }}
|
||||||
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s" .Release.Namespace (include "ingress-nginx.admissionWebhooks.fullname" .) | quote }}
|
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s" (include "ingress-nginx.namespace" .) (include "ingress-nginx.admissionWebhooks.fullname" .) | quote }}
|
||||||
cert-manager.io/inject-ca-from: {{ printf "%s/%s" .Release.Namespace (include "ingress-nginx.admissionWebhooks.fullname" .) | quote }}
|
cert-manager.io/inject-ca-from: {{ printf "%s/%s" (include "ingress-nginx.namespace" .) (include "ingress-nginx.admissionWebhooks.fullname" .) | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.controller.admissionWebhooks.annotations }}
|
{{- if .Values.controller.admissionWebhooks.annotations }}
|
||||||
{{- toYaml .Values.controller.admissionWebhooks.annotations | nindent 4 }}
|
{{- toYaml .Values.controller.admissionWebhooks.annotations | nindent 4 }}
|
||||||
|
@ -38,8 +38,8 @@ webhooks:
|
||||||
- v1
|
- v1
|
||||||
clientConfig:
|
clientConfig:
|
||||||
service:
|
service:
|
||||||
namespace: {{ (include "ingress-nginx.namespace" .) | quote }}
|
|
||||||
name: {{ include "ingress-nginx.controller.fullname" . }}-admission
|
name: {{ include "ingress-nginx.controller.fullname" . }}-admission
|
||||||
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
path: /networking/v1/ingresses
|
path: /networking/v1/ingresses
|
||||||
{{- if .Values.controller.admissionWebhooks.timeoutSeconds }}
|
{{- if .Values.controller.admissionWebhooks.timeoutSeconds }}
|
||||||
timeoutSeconds: {{ .Values.controller.admissionWebhooks.timeoutSeconds }}
|
timeoutSeconds: {{ .Values.controller.admissionWebhooks.timeoutSeconds }}
|
||||||
|
|
|
@ -15,5 +15,5 @@ roleRef:
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ template "ingress-nginx.serviceAccountName" . }}
|
name: {{ template "ingress-nginx.serviceAccountName" . }}
|
||||||
namespace: {{ (include "ingress-nginx.namespace" .) | quote }}
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
{{- if and .Values.controller.keda.enabled (eq .Values.controller.kind "Deployment") -}}
|
{{- if and .Values.controller.keda.enabled (eq .Values.controller.kind "Deployment") -}}
|
||||||
# https://keda.sh/docs/
|
|
||||||
|
|
||||||
apiVersion: {{ .Values.controller.keda.apiVersion }}
|
apiVersion: {{ .Values.controller.keda.apiVersion }}
|
||||||
kind: ScaledObject
|
kind: ScaledObject
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -11,6 +9,7 @@ metadata:
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
name: {{ include "ingress-nginx.controller.fullname" . }}
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
||||||
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- if .Values.controller.keda.scaledObject.annotations }}
|
{{- if .Values.controller.keda.scaledObject.annotations }}
|
||||||
annotations: {{ toYaml .Values.controller.keda.scaledObject.annotations | nindent 4 }}
|
annotations: {{ toYaml .Values.controller.keda.scaledObject.annotations | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -4,7 +4,9 @@ kind: PrometheusRule
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "ingress-nginx.controller.fullname" . }}
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
||||||
{{- if .Values.controller.metrics.prometheusRule.namespace }}
|
{{- if .Values.controller.metrics.prometheusRule.namespace }}
|
||||||
namespace: {{ .Values.controller.metrics.prometheusRule.namespace | quote }}
|
namespace: {{ .Values.controller.metrics.prometheusRule.namespace }}
|
||||||
|
{{- else }}
|
||||||
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
||||||
|
|
|
@ -17,5 +17,5 @@ roleRef:
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ template "ingress-nginx.serviceAccountName" . }}
|
name: {{ template "ingress-nginx.serviceAccountName" . }}
|
||||||
namespace: {{ (include "ingress-nginx.namespace" .) | quote }}
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -4,7 +4,7 @@ kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "ingress-nginx.controller.fullname" . }}
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.namespace }}
|
{{- if .Values.controller.metrics.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.controller.metrics.serviceMonitor.namespace | quote }}
|
namespace: {{ .Values.controller.metrics.serviceMonitor.namespace }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
namespace: {{ include "ingress-nginx.namespace" . }}
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -17,5 +17,5 @@ roleRef:
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ template "ingress-nginx.defaultBackend.serviceAccountName" . }}
|
name: {{ template "ingress-nginx.defaultBackend.serviceAccountName" . }}
|
||||||
namespace: {{ (include "ingress-nginx.namespace" .) | quote }}
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue