From 5a5bff1fb98c896192ca58ecf51fa5a8985d2282 Mon Sep 17 00:00:00 2001 From: Anton Holovin Date: Fri, 26 Nov 2021 12:36:52 +0200 Subject: [PATCH] Making Kube service appProtocol field optional (#7873) --- charts/ingress-nginx/CHANGELOG.md | 4 ++++ charts/ingress-nginx/Chart.yaml | 2 +- charts/ingress-nginx/templates/controller-service.yaml | 4 ++-- charts/ingress-nginx/values.yaml | 8 ++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/charts/ingress-nginx/CHANGELOG.md b/charts/ingress-nginx/CHANGELOG.md index 75635d303..e23a0dc27 100644 --- a/charts/ingress-nginx/CHANGELOG.md +++ b/charts/ingress-nginx/CHANGELOG.md @@ -2,6 +2,10 @@ This file documents all notable changes to [ingress-nginx](https://github.com/kubernetes/ingress-nginx) Helm Chart. The release numbering uses [semantic versioning](http://semver.org). +### 4.0.11 + +- [7873] https://github.com/kubernetes/ingress-nginx/pull/7873 Makes the [appProtocol](https://kubernetes.io/docs/concepts/services-networking/_print/#application-protocol) field optional. + ### 4.0.10 - [7964] https://github.com/kubernetes/ingress-nginx/pull/7964 Update controller version to v1.1.0 diff --git a/charts/ingress-nginx/Chart.yaml b/charts/ingress-nginx/Chart.yaml index 44a584611..cef3ec7da 100644 --- a/charts/ingress-nginx/Chart.yaml +++ b/charts/ingress-nginx/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: ingress-nginx # When the version is modified, make sure the artifacthub.io/changes list is updated # Also update CHANGELOG.md -version: 4.0.10 +version: 4.0.11 appVersion: 1.1.0 home: https://github.com/kubernetes/ingress-nginx description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer diff --git a/charts/ingress-nginx/templates/controller-service.yaml b/charts/ingress-nginx/templates/controller-service.yaml index 90a0eb994..05fb2041e 100644 --- a/charts/ingress-nginx/templates/controller-service.yaml +++ b/charts/ingress-nginx/templates/controller-service.yaml @@ -54,7 +54,7 @@ spec: port: {{ .Values.controller.service.ports.http }} protocol: TCP targetPort: {{ .Values.controller.service.targetPorts.http }} - {{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }} + {{- if and (semverCompare ">=1.20" .Capabilities.KubeVersion.Version) (.Values.controller.service.appProtocol) }} appProtocol: http {{- end }} {{- if (and $setNodePorts (not (empty .Values.controller.service.nodePorts.http))) }} @@ -66,7 +66,7 @@ spec: port: {{ .Values.controller.service.ports.https }} protocol: TCP targetPort: {{ .Values.controller.service.targetPorts.https }} - {{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }} + {{- if and (semverCompare ">=1.20" .Capabilities.KubeVersion.Version) (.Values.controller.service.appProtocol) }} appProtocol: https {{- end }} {{- if (and $setNodePorts (not (empty .Values.controller.service.nodePorts.https))) }} diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 3f7b3e0e8..01ab72dd3 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -432,6 +432,14 @@ controller: service: enabled: true + ## If enabled is adding an appProtocol option for Kubernetes service. An appProtocol field replacing annotations that were + ## using for setting a backend protocol. Here is an example for AWS: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http + ## It allows choosing the protocol for each backend specified in the Kubernetes service. + ## See the following GitHub issue for more details about the purpose: https://github.com/kubernetes/kubernetes/issues/40244 + ## Will be ignored for Kubernetes versions older than 1.20 + ## + appProtocol: true + annotations: {} labels: {} # clusterIP: ""