From d6077ad8784348bc60a120fe053c037d19f88d68 Mon Sep 17 00:00:00 2001 From: Ruben Tsirunyan Date: Fri, 17 May 2024 09:44:48 +0400 Subject: [PATCH] Adding ingressClassName field in ingress --- templates/ingress.yaml | 5 +++-- values.md | 1 + values.schema.json | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/ingress.yaml b/templates/ingress.yaml index 9c498b6..2a33d7e 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -8,6 +8,9 @@ metadata: name: {{ include "common.fullname" ( dict "root" $ "service" $.Values.ingress "serviceName" $hostGroupName ) }} {{- include "common.metadata" ( dict "root" $ "service" $.Values.ingress "serviceName" $hostGroupName ) | nindent 2 }} spec: +{{- with $.Values.ingress.ingressClassName }} + ingressClassName: {{ . }} +{{- end }} # Add tls only if ingress.tls.enabled is set to true and the other fields are complete. {{- if and ( hasKey $hostGroupDefinition "tls" ) ( eq $hostGroupDefinition.tls.enabled true ) }} tls: @@ -17,8 +20,6 @@ spec: {{- end }} {{- if $hostGroupDefinition.tls.secretName }} secretName: {{ $hostGroupDefinition.tls.secretName }} - {{- else }} - secretName: {{ $fullName }}-{{ $hostGroupName }} {{- end }} {{- end }} rules: diff --git a/values.md b/values.md index 0e51004..b9ff208 100644 --- a/values.md +++ b/values.md @@ -25,6 +25,7 @@ - **`prefixTrunc`**: Refer to _[#/definitions/prefixTrunc](#definitions/prefixTrunc)_. - **`labels`**: Refer to _[#/definitions/labels](#definitions/labels)_. - **`annotations`**: Refer to _[#/definitions/annotations](#definitions/annotations)_. + - **`ingressClassName`** _(string)_: Ingress class name. Will be omitted if not specified. - **`hostGroups`** _(object)_: Can contain additional properties. - **Additional properties** _(object)_: Cannot contain additional properties. - **`hosts`** _(array)_ diff --git a/values.schema.json b/values.schema.json index 20533b9..f60d88a 100644 --- a/values.schema.json +++ b/values.schema.json @@ -339,6 +339,10 @@ "annotations": { "$ref": "#/definitions/annotations" }, + "ingressClassName": { + "type": "string", + "description": "Ingress class name. Will be omitted if not specified." + }, "hostGroups": { "type": "object", "additionalProperties": {