Skip to content

Commit dafaff5

Browse files
Merge pull request #1624 from jenkins-x/securityContext
feat: adding support for securityContext in helm chart
2 parents 194c834 + c4d8702 commit dafaff5

8 files changed

+110
-39
lines changed

charts/lighthouse/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OS := $(shell uname)
66

77
HELMDOCS := $(GOPATH)/bin/helm-docs
88
$(HELMDOCS):
9-
pushd /tmp; $(GO_MOD) get -u github.com/norwoodj/helm-docs/cmd/[email protected]; popd
9+
pushd /tmp; $(GO_MOD) install github.com/norwoodj/helm-docs/cmd/[email protected]; popd
1010

1111
build: clean $(HELMDOCS)
1212
rm -rf requirements.lock

charts/lighthouse/README.md

+35-21
Large diffs are not rendered by default.

charts/lighthouse/templates/foghorn-deployment.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ spec:
7878
value: {{ quote $pval }}
7979
{{- end }}
8080
{{- end }}
81+
securityContext:
82+
{{ toYaml .Values.foghorn.containerSecurityContext | indent 12 }}
8183
resources:
8284
{{ toYaml .Values.foghorn.resources | indent 12 }}
8385
volumeMounts:
@@ -123,3 +125,7 @@ spec:
123125
tolerations:
124126
{{ toYaml . | indent 8 }}
125127
{{- end }}
128+
{{- with .Values.foghorn.securityContext }}
129+
securityContext:
130+
{{ toYaml . | indent 8 }}
131+
{{- end }}

charts/lighthouse/templates/jenkins-controller-deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ spec:
4646
- name: {{ $pkey }}
4747
value: {{ quote $pval }}
4848
{{- end }}
49+
securityContext:
50+
{{- toYaml .Values.jenkinscontroller.containerSecurityContext | nindent 12 }}
4951
resources:
5052
{{- toYaml .Values.jenkinscontroller.resources | nindent 12 }}
5153
volumeMounts:
@@ -63,4 +65,6 @@ spec:
6365
{{- toYaml .Values.jenkinscontroller.affinity | nindent 8 }}
6466
tolerations:
6567
{{- toYaml .Values.jenkinscontroller.tolerations | nindent 8 }}
68+
securityContext:
69+
{{- toYaml .Values.jenkinscontroller.securityContext | nindent 8 }}
6670
{{- end }}

charts/lighthouse/templates/keeper-deployment.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ spec:
102102
- secretRef:
103103
name: jx-boot-job-env-vars
104104
optional: true
105+
securityContext:
106+
{{ toYaml .Values.keeper.containerSecurityContext | indent 10 }}
105107
resources:
106108
{{ toYaml .Values.keeper.resources | indent 10 }}
107109
volumeMounts:
@@ -136,3 +138,7 @@ spec:
136138
tolerations:
137139
{{ toYaml . | indent 8 }}
138140
{{- end }}
141+
{{- with .Values.keeper.securityContext }}
142+
securityContext:
143+
{{ toYaml . | indent 8 }}
144+
{{- end }}

charts/lighthouse/templates/tekton-controller-deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ spec:
5050
- secretRef:
5151
name: jx-boot-job-env-vars
5252
optional: true
53+
securityContext:
54+
{{- toYaml .Values.tektoncontroller.containerSecurityContext | nindent 12 }}
5355
resources:
5456
{{- toYaml .Values.tektoncontroller.resources | nindent 12 }}
5557
terminationGracePeriodSeconds: {{ .Values.tektoncontroller.terminationGracePeriodSeconds }}
@@ -59,4 +61,6 @@ spec:
5961
{{- toYaml .Values.tektoncontroller.affinity | nindent 8 }}
6062
tolerations:
6163
{{- toYaml .Values.tektoncontroller.tolerations | nindent 8 }}
64+
securityContext:
65+
{{- toYaml .Values.tektoncontroller.securityContext | nindent 8 }}
6266
{{- end }}

charts/lighthouse/templates/webhooks-deployment.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ spec:
120120
periodSeconds: {{ .Values.webhooks.readinessProbe.periodSeconds }}
121121
successThreshold: {{ .Values.webhooks.readinessProbe.successThreshold }}
122122
timeoutSeconds: {{ .Values.webhooks.readinessProbe.timeoutSeconds }}
123+
securityContext:
124+
{{ toYaml .Values.webhooks.containerSecurityContext | indent 12 }}
123125
resources:
124126
{{ toYaml .Values.webhooks.resources | indent 12 }}
125127
volumeMounts:
@@ -165,3 +167,8 @@ spec:
165167
tolerations:
166168
{{ toYaml . | indent 8 }}
167169
{{- end }}
170+
{{- with .Values.webhooks.securityContext }}
171+
securityContext:
172+
{{ toYaml . | indent 8 }}
173+
{{- end }}
174+

charts/lighthouse/values.yaml

+47-17
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ externalPlugins:
8888
name: lighthouse-webui-plugin
8989

9090
gcJobs:
91-
# logLevel -- The logging level: trace, debug, info, warn, error, fatal
91+
# gcJobs.logLevel -- The logging level: trace, debug, info, warn, error, panic, fatal
9292
logLevel: "info"
9393

9494
# gcJobs.maxAge -- Max age from which `LighthouseJob`s will be deleted
@@ -120,7 +120,7 @@ gcJobs:
120120
pullPolicy: "{{ .Values.image.pullPolicy }}"
121121

122122
webhooks:
123-
# logLevel -- The logging level: trace, debug, info, warn, error, fatal
123+
# webhooks.logLevel -- The logging level: trace, debug, info, warn, error, panic, fatal
124124
logLevel: "info"
125125

126126
# webhooks.replicaCount -- Number of replicas
@@ -197,6 +197,12 @@ webhooks:
197197
# webhooks.tolerations -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) applied to the webhooks pods
198198
tolerations: []
199199

200+
# webhooks.securityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the webhooks pods
201+
securityContext: {}
202+
203+
# webhooks.containerSecurityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the webhooks containers
204+
containerSecurityContext: {}
205+
200206
ingress:
201207
# webhooks.ingress.enabled -- Enable webhooks ingress
202208
enabled: false
@@ -222,7 +228,7 @@ webhooks:
222228
customDeploymentTriggerCommand: ""
223229

224230
foghorn:
225-
# logLevel -- The logging level: trace, debug, info, warn, error, fatal
231+
# foghorn.logLevel -- The logging level: trace, debug, info, warn, error, panic, fatal
226232
logLevel: "info"
227233

228234
# foghorn.replicaCount -- Number of replicas
@@ -261,9 +267,15 @@ foghorn:
261267
# foghorn.tolerations -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) applied to the foghorn pods
262268
tolerations: []
263269

270+
# foghorn.securityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the foghorn pods
271+
securityContext: {}
272+
273+
# foghorn.containerSecurityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the foghorn containers
274+
containerSecurityContext: {}
275+
264276

265277
tektoncontroller:
266-
# logLevel -- The logging level: trace, debug, info, warn, error, fatal
278+
# tektoncontroller.logLevel -- The logging level: trace, debug, info, warn, error, panic, fatal
267279
logLevel: "info"
268280

269281
# tektoncontroller.dashboardURL -- the dashboard URL (e.g. Tekton dashboard)
@@ -302,6 +314,12 @@ tektoncontroller:
302314
# tektoncontroller.tolerations -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) applied to the tekton controller pods
303315
tolerations: []
304316

317+
# tektoncontroller.securityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the tekton controller pods
318+
securityContext: {}
319+
320+
# tektoncontroller.containerSecurityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the tekton controller containers
321+
containerSecurityContext: {}
322+
305323
resources:
306324
# tektoncontroller.resources.limits -- Resource limits applied to the tekton controller pods
307325
limits:
@@ -318,7 +336,7 @@ tektoncontroller:
318336
annotations: {}
319337

320338
jenkinscontroller:
321-
# logLevel -- The logging level: trace, debug, info, warn, error, fatal
339+
# jenkinscontroller.logLevel -- The logging level: trace, debug, info, warn, error, panic, fatal
322340
logLevel: "info"
323341

324342
# jenkinscontroller.jenkinsURL -- The URL of the Jenkins instance
@@ -330,48 +348,54 @@ jenkinscontroller:
330348
# jenkinscontroller.jenkinsToken -- The token for authenticating the Jenkins user
331349
jenkinsToken:
332350

333-
# jenkinscontroller.terminationGracePeriodSeconds -- Termination grace period for tekton controller pods
351+
# jenkinscontroller.terminationGracePeriodSeconds -- Termination grace period for jenkins controller pods
334352
terminationGracePeriodSeconds: 180
335353

336354
image:
337355
# jenkinscontroller.image.repository -- Template for computing the Jenkins controller docker image repository
338356
repository: "{{ .Values.image.parentRepository }}/lighthouse-jenkins-controller"
339357

340-
# jenkinscontroller.image.tag -- Template for computing the tekton controller docker image tag
358+
# jenkinscontroller.image.tag -- Template for computing the jenkins controller docker image tag
341359
tag: "{{ .Values.image.tag }}"
342360

343-
# jenkinscontroller.image.pullPolicy -- Template for computing the tekton controller docker image pull policy
361+
# jenkinscontroller.image.pullPolicy -- Template for computing the jenkins controller docker image pull policy
344362
pullPolicy: "{{ .Values.image.pullPolicy }}"
345363

346-
# jenkinscontroller.podAnnotations -- Annotations applied to the tekton controller pods
364+
# jenkinscontroller.podAnnotations -- Annotations applied to the jenkins controller pods
347365
podAnnotations: {}
348366

349-
# jenkinscontroller.nodeSelector -- [Node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) applied to the tekton controller pods
367+
# jenkinscontroller.nodeSelector -- [Node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) applied to the jenkins controller pods
350368
nodeSelector: {}
351369

352-
# jenkinscontroller.affinity -- [Affinity rules](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) applied to the tekton controller pods
370+
# jenkinscontroller.affinity -- [Affinity rules](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) applied to the jenkins controller pods
353371
affinity: {}
354372

355-
# jenkinscontroller.tolerations -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) applied to the tekton controller pods
373+
# jenkinscontroller.tolerations -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) applied to the jenkins controller pods
356374
tolerations: []
357375

376+
# jenkinscontroller.securityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the jenkins controller pods
377+
securityContext: {}
378+
379+
# jenkinscontroller.containerSecurityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the jenkins controller containers
380+
containerSecurityContext: {}
381+
358382
resources:
359-
# jenkinscontroller.resources.limits -- Resource limits applied to the tekton controller pods
383+
# jenkinscontroller.resources.limits -- Resource limits applied to the jenkins controller pods
360384
limits:
361385
cpu: 100m
362386
memory: 256Mi
363387

364-
# jenkinscontroller.resources.requests -- Resource requests applied to the tekton controller pods
388+
# jenkinscontroller.resources.requests -- Resource requests applied to the jenkins controller pods
365389
requests:
366390
cpu: 80m
367391
memory: 128Mi
368392

369-
# jenkinscontroller.service -- Service settings for the tekton controller
393+
# jenkinscontroller.service -- Service settings for the jenkins controller
370394
service:
371395
annotations: {}
372396

373397
keeper:
374-
# logLevel -- The logging level: trace, debug, info, warn, error, fatal
398+
# keeper.logLevel -- The logging level: trace, debug, info, warn, error, panic, fatal
375399
logLevel: "info"
376400

377401
# keeper.statusContextLabel -- Label used to report status to git provider
@@ -446,8 +470,14 @@ keeper:
446470
# keeper.tolerations -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) applied to the keeper pods
447471
tolerations: []
448472

473+
# keeper.securityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the keeper pods
474+
securityContext: {}
475+
476+
# keeper.containerSecurityContext -- [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) applied to the keeper containers
477+
containerSecurityContext: {}
478+
449479
poller:
450-
# logLevel -- The logging level: trace, debug, info, warn, error, fatal
480+
# poller.logLevel -- The logging level: trace, debug, info, warn, error, panic, fatal
451481
logLevel: "info"
452482

453483
# poller.enabled -- Whether to enable or disable the poller component

0 commit comments

Comments
 (0)