From 603e2c5ee8bea264e43e373636f33d2298bc3626 Mon Sep 17 00:00:00 2001 From: Andrew Konrath Date: Thu, 12 Nov 2020 13:17:51 -0600 Subject: [PATCH] Allow custom service names for controller and backend (#6457) --- charts/ingress-nginx/CHANGELOG.md | 4 ++++ charts/ingress-nginx/Chart.yaml | 2 +- charts/ingress-nginx/templates/_helpers.tpl | 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 3aa8e4a3d5..18c7aece72 100644 --- a/charts/ingress-nginx/CHANGELOG.md +++ b/charts/ingress-nginx/CHANGELOG.md @@ -4,6 +4,10 @@ This file documents all notable changes to [ingress-nginx](https://github.com/ku ### Unreleased +### 3.14.0 + +- [X] [#6469](https://github.com/kubernetes/ingress-nginx/pull/6469) Allow custom service names for controller and backend + ### 3.13.0 - [X] [#6544](https://github.com/kubernetes/ingress-nginx/pull/6544) Fix default backend HPA name variable diff --git a/charts/ingress-nginx/Chart.yaml b/charts/ingress-nginx/Chart.yaml index 2cc2ec2c83..2356abe2be 100644 --- a/charts/ingress-nginx/Chart.yaml +++ b/charts/ingress-nginx/Chart.yaml @@ -21,4 +21,4 @@ annotations: # List of changes for the release in artifacthub.io # https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx?modal=changelog artifacthub.io/changes: | - - Fix default backend HPA name variable + - Allow custom service names for controller and backend diff --git a/charts/ingress-nginx/templates/_helpers.tpl b/charts/ingress-nginx/templates/_helpers.tpl index d516a593cb..b48bf4a4a6 100644 --- a/charts/ingress-nginx/templates/_helpers.tpl +++ b/charts/ingress-nginx/templates/_helpers.tpl @@ -35,7 +35,7 @@ Create a default fully qualified controller name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "ingress-nginx.controller.fullname" -}} -{{- printf "%s-%s" (include "ingress-nginx.fullname" .) "controller" | trunc 63 | trimSuffix "-" -}} +{{- printf "%s-%s" (include "ingress-nginx.fullname" .) .Values.controller.name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -58,7 +58,7 @@ Create a default fully qualified default backend name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "ingress-nginx.defaultBackend.fullname" -}} -{{- printf "%s-%s" (include "ingress-nginx.fullname" .) "defaultbackend" | trunc 63 | trimSuffix "-" -}} +{{- printf "%s-%s" (include "ingress-nginx.fullname" .) .Values.defaultBackend.name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* diff --git a/charts/ingress-nginx/values.yaml b/charts/ingress-nginx/values.yaml index 7e2e54c723..f8f4c688b2 100644 --- a/charts/ingress-nginx/values.yaml +++ b/charts/ingress-nginx/values.yaml @@ -1,7 +1,14 @@ ## nginx configuration ## Ref: https://github.com/kubernetes/ingress-nginx/blob/master/controllers/nginx/configuration.md ## + +## Overrides for generated resource names +# See templates/_helpers.tpl +# nameOverride: +# fullnameOverride: + controller: + name: controller image: repository: k8s.gcr.io/ingress-nginx/controller tag: "v0.41.2" @@ -584,6 +591,7 @@ defaultBackend: ## enabled: false + name: defaultbackend image: repository: k8s.gcr.io/defaultbackend-amd64 tag: "1.5"