Skip to content

Commit c568e23

Browse files
Mike LudwigMike Ludwig
authored andcommitted
support limited capabilities for controller, invoker, and apigw pods
1 parent e1ffcb0 commit c568e23

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

helm/openwhisk/templates/apigateway-pod.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,9 @@ spec:
7575
configMapKeyRef:
7676
name: {{ .Release.Name }}-whisk.config
7777
key: whisk_api_host_url
78+
{{- if .Values.apigw.secure }}
79+
securityContext:
80+
capabilities:
81+
drop:
82+
- all
83+
{{- end }}

helm/openwhisk/templates/controller-pod.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ spec:
7979
{{- if .Values.controller.lean }}
8080
securityContext:
8181
privileged: true
82+
{{- else if .Values.controller.secure }}
83+
securityContext:
84+
capabilities:
85+
drop:
86+
- all
8287
{{- end }}
8388
command: ["/bin/bash", "-c", "/init.sh `hostname | awk -F '-' '{print $NF}'`"]
8489
ports:

helm/openwhisk/templates/invoker-pod.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,5 +238,13 @@ spec:
238238
ports:
239239
- name: invoker
240240
containerPort: {{ .Values.invoker.port }}
241+
{{- if .Values.invoker.secure }}
242+
securityContext:
243+
capabilities:
244+
drop:
245+
- all
246+
add:
247+
- SYS_ADMIN
248+
{{- end }}
241249
{{ include "openwhisk.invoker.volume_mounts" . }}
242250
{{- end }}

helm/openwhisk/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ controller:
263263
jvmOptions: ""
264264
loglevel: "INFO"
265265
resources: ~
266+
secure: false
266267

267268
# Invoker configurations
268269
invoker:
@@ -294,6 +295,7 @@ invoker:
294295
isolateUserActions: true
295296
replicaCount: 1
296297
resources: ~
298+
secure: false
297299

298300
# API Gateway configurations
299301
apigw:
@@ -306,6 +308,7 @@ apigw:
306308
apiPort: 9000
307309
mgmtPort: 8080
308310
resources: ~
311+
secure: false
309312

310313
# Redis (used by apigateway)
311314
redis:

0 commit comments

Comments
 (0)