Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6679 add globalConfigurationCustomName parameter #6680

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
812e7ef
Helm: add globalConfigurationCustomName parameter
frantsao Oct 17, 2024
24720e9
Merge branch 'main' into issue-6679
frantsao Oct 17, 2024
1db8f4a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 17, 2024
548ac11
Remove unneeded comment in values.yaml
frantsao Oct 17, 2024
db5c8f4
Merge branch 'main' into issue-6679
frantsao Oct 18, 2024
e09ada1
Merge branch 'main' into issue-6679
frantsao Oct 22, 2024
8d64188
Merge branch 'main' into issue-6679
frantsao Oct 24, 2024
4f4b1db
Merge branch 'main' into issue-6679
frantsao Oct 28, 2024
5a57015
Merge branch 'main' into issue-6679
frantsao Nov 12, 2024
ee5c86b
Merge branch 'main' into issue-6679
frantsao Nov 19, 2024
610f49e
moved globalConfigurationCustomName parameter to globalConfiguration.…
frantsao Nov 19, 2024
0823d8d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 19, 2024
3969d8b
Fix values.schema.json format
frantsao Nov 19, 2024
151ef1b
Merge remote-tracking branch 'refs/remotes/origin/issue-6679' into is…
frantsao Nov 19, 2024
d7d59aa
Merge branch 'main' into issue-6679
frantsao Dec 11, 2024
ae76aea
Merge branch 'main' into issue-6679
frantsao Dec 12, 2024
8490da9
Helm: add globalConfigurationCustomName parameter
frantsao Dec 12, 2024
f8681b7
Helm: add globalConfigurationCustomName parameter
frantsao Dec 12, 2024
40f944b
Merge branch 'main' into issue-6679
frantsao Dec 16, 2024
b952899
Merge branch 'main' into issue-6679
frantsao Dec 24, 2024
d28a769
Merge branch 'main' into issue-6679
frantsao Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion charts/nginx-ingress/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,20 @@ false
{{- end -}}
{{- end -}}

{{/*
Create the global configuration custom name from the globalConfiguration.customName value.
*/}}
{{- define "nginx-ingress.globalConfiguration.customName" -}}
{{ splitList "/" .Values.controller.globalConfiguration.customName | last }}
{{- end -}}

{{/*
Create the global configuration custom namespace from the globalConfiguration.customName value.
*/}}
{{- define "nginx-ingress.globalConfiguration.customNamespace" -}}
{{ splitList "/" .Values.controller.globalConfiguration.customName | first }}
{{- end -}}

{{/*
Build the args for the service binary.
*/}}
Expand Down Expand Up @@ -314,8 +328,12 @@ Build the args for the service binary.
- -enable-external-dns={{ .Values.controller.enableExternalDNS }}
- -default-http-listener-port={{ .Values.controller.defaultHTTPListenerPort}}
- -default-https-listener-port={{ .Values.controller.defaultHTTPSListenerPort}}
{{- if .Values.controller.globalConfiguration.create }}
{{- if and .Values.controller.globalConfiguration.create (not .Values.controller.globalConfiguration.customName) }}
- -global-configuration=$(POD_NAMESPACE)/{{ include "nginx-ingress.controller.fullname" . }}
{{- else }}
{{- if .Values.controller.globalConfiguration.customName }}
- -global-configuration={{ .Values.controller.globalConfiguration.customName }}
{{- end }}
{{- end }}
{{- end }}
- -ready-status={{ .Values.controller.readyStatus.enable }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
apiVersion: k8s.nginx.org/v1
kind: GlobalConfiguration
metadata:
{{- if not .Values.controller.globalConfiguration.customName }}
name: {{ include "nginx-ingress.controller.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- else }}
name: {{ include "nginx-ingress.globalConfiguration.customName" . }}
namespace: {{ include "nginx-ingress.globalConfiguration.customNamespace" . }}
{{- end }}
labels:
{{- include "nginx-ingress.labels" . | nindent 4 }}
spec:
Expand Down
8 changes: 8 additions & 0 deletions charts/nginx-ingress/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,14 @@
false
]
},
"customName": {
"type": "string",
"default": "",
"title": "The customName Schema",
"examples": [
"the-namespace/the-name-of-the-global-configuration-custom-resource"
]
},
"spec": {
"type": "object",
"default": {},
Expand Down
3 changes: 3 additions & 0 deletions charts/nginx-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ controller:
## Creates the GlobalConfiguration custom resource. Requires controller.enableCustomResources.
create: false

## customName: "the-namespace/the-name-of-the-global-configuration-custom-resource"
## The name of the GlobalConfiguration custom resource to use instead of the one provided by default.

## The spec of the GlobalConfiguration for defining the global configuration parameters of the Ingress Controller.
spec: {} ## Ensure both curly brackets are removed when adding listeners in YAML format.
# listeners:
Expand Down