Skip to content

Commit

Permalink
Possible to disable service links
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesbusy committed Sep 10, 2024
1 parent 676475d commit 3616a4d
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 275 deletions.
4 changes: 4 additions & 0 deletions charts/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
The changelog until v1.5.7 was auto-generated based on git commits.
Those entries include a reference to the git commit to be able to get more details.

## 5.5.15

Add support for `controller.enableServiceLinks` to disable service links in the controller pod.

## 5.5.14

Update `jenkins/jenkins` to version `2.462.2-jdk17`
Expand Down
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: jenkins
type: application
home: https://www.jenkins.io/
version: 5.5.14
version: 5.5.15
appVersion: 2.462.2
description: >
Jenkins - Build great things at any scale! As the leading open source automation server, Jenkins provides over 1800 plugins to support building, deploying and automating any project.
Expand Down
549 changes: 275 additions & 274 deletions charts/jenkins/VALUES.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions charts/jenkins/templates/jenkins-controller-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ spec:
{{- if .Values.controller.shareProcessNamespace }}
shareProcessNamespace: true
{{- end }}
{{- if not .Values.controller.enableServiceLinks }}
enableServiceLinks: false
{{- end }}
{{- if .Values.controller.usePodSecurityContext }}
securityContext:
{{- if kindIs "map" .Values.controller.podSecurityContextOverride }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ default values:
name: sc-config-volume
- mountPath: /var/jenkins_home
name: jenkins-home
enableServiceLinks: false
initContainers:
- env:
- name: POD_NAME
Expand Down Expand Up @@ -350,6 +351,7 @@ test scheme for config-reload:
name: sc-config-volume
- mountPath: /var/jenkins_home
name: jenkins-home
enableServiceLinks: false
initContainers:
- env:
- name: POD_NAME
Expand Down
17 changes: 17 additions & 0 deletions charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,23 @@ tests:
asserts:
- isNull:
path: spec.template.spec.shareProcessNamespace
- it: test false enableServiceLinks
template: jenkins-controller-statefulset.yaml
set:
controller:
enableServiceLinks: false
asserts:
- equal:
path: spec.template.spec.enableServiceLinks
value: false
- it: test true enableServiceLinks
template: jenkins-controller-statefulset.yaml
set:
controller:
enableServiceLinks: true
asserts:
- isNull:
path: spec.template.spec.enableServiceLinks
- it: test disableSecretMount
template: jenkins-controller-statefulset.yaml
set:
Expand Down
6 changes: 6 additions & 0 deletions charts/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ controller:
# Share process namespace to allow sidecar containers to interact with processes in other containers in the same pod
shareProcessNamespace: false

# Service links might cause issue if running in a namespace with a large amount of services
# that might cause a slow startup when plugins are copied from ref to volume
# Set to true to keep previous behavior
# See https://github.com/kubernetes/kubernetes/issues/121787
enableServiceLinks: false

# Overrides the init container default values
# -- Resources allocation (Requests and Limits) for Init Container
initContainerResources: {}
Expand Down

0 comments on commit 3616a4d

Please sign in to comment.