From 06fcc6b380c5982269affbd4f0a16085690e4997 Mon Sep 17 00:00:00 2001 From: Alex Szakaly Date: Sun, 7 Dec 2025 22:38:28 +0100 Subject: [PATCH] feat: add enableServiceLinks support to Deployment Signed-off-by: Alex Szakaly --- README.md | 1 + application/templates/deployment.yaml | 1 + application/tests/deployment_test.yaml | 14 ++++++++++++++ application/values.yaml | 3 +++ 4 files changed, 19 insertions(+) diff --git a/README.md b/README.md index 290f09ac..06cbfa29 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ helm delete --namespace test my-application | deployment.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. | | deployment.dnsConfig | object | `nil` | DNS config for the pods. | | deployment.dnsPolicy | string | `""` | DNS Policy. | +| deployment.enableServiceLinks | bool | `true` | Enable Kubernetes service links. | | deployment.startupProbe | object | See below | Startup probe. Must specify either one of the following field when enabled: httpGet, exec, tcpSocket, grpc | | deployment.startupProbe.enabled | bool | `false` | Enable Startup probe. | | deployment.startupProbe.failureThreshold | int | `30` | Number of retries before marking the pod as failed. | diff --git a/application/templates/deployment.yaml b/application/templates/deployment.yaml index ea5b9012..221ee4d9 100644 --- a/application/templates/deployment.yaml +++ b/application/templates/deployment.yaml @@ -75,6 +75,7 @@ spec: ] {{- end }} spec: + enableServiceLinks: {{ .Values.deployment.enableServiceLinks }} {{- with .Values.deployment.hostAliases }} hostAliases: {{- toYaml . | nindent 6 }} {{- end }} diff --git a/application/tests/deployment_test.yaml b/application/tests/deployment_test.yaml index 08f8ee97..e6e4d4d3 100644 --- a/application/tests/deployment_test.yaml +++ b/application/tests/deployment_test.yaml @@ -134,6 +134,20 @@ tests: path: spec.template.spec.containers[0].livenessProbe.grpc.port value: 5000 + - it: configures enable service links by default + asserts: + - equal: + path: spec.template.spec.enableServiceLinks + value: true + + - it: disable enable service links when configured + set: + deployment.enableServiceLinks: false + asserts: + - equal: + path: spec.template.spec.enableServiceLinks + value: false + - it: configures envFrom as mandatory by default set: deployment.envFrom: diff --git a/application/values.yaml b/application/values.yaml index 661e2e04..937ba8ba 100644 --- a/application/values.yaml +++ b/application/values.yaml @@ -304,6 +304,9 @@ deployment: # -- (string) DNS Policy. # @section -- Deployment Parameters dnsPolicy: "" + # -- (bool) Enable Kubernetes service links. + # @section -- Deployment Parameters + enableServiceLinks: true # -- (object) Startup probe. # @default -- See below # Must specify either one of the following field when enabled: httpGet, exec, tcpSocket, grpc