Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/spinnaker] Add psp option #22743

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/spinnaker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: Open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.
name: spinnaker
version: 2.0.0-rc5
version: 2.0.0-rc6
appVersion: 1.16.2
home: http://spinnaker.io/
sources:
Expand Down
8 changes: 8 additions & 0 deletions stable/spinnaker/templates/hooks/install-using-hal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ spec:
labels:
{{ include "spinnaker.standard-labels" . | indent 8 }}
spec:
{{- if .Values.serviceAccount.halyardName }}
serviceAccountName: {{ .Values.serviceAccount.halyardName }}
{{- else }}
serviceAccountName: {{ template "spinnaker.fullname" . }}-halyard
{{- end }}
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
fsGroup: {{ .Values.securityContext.fsGroup }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
Expand Down
14 changes: 14 additions & 0 deletions stable/spinnaker/templates/rbac/psp-halyard-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.rbac.pspEnabled }}
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "spinnaker.fullname" . }}-halyard-psp
labels:
{{ include "spinnaker.standard-labels" . | indent 4 }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "spinnaker.fullname" . }}-halyard
{{- end }}
20 changes: 20 additions & 0 deletions stable/spinnaker/templates/rbac/psp-halyard-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.rbac.pspEnabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "spinnaker.fullname" . }}-halyard-psp
labels:
{{ include "spinnaker.standard-labels" . | indent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "spinnaker.fullname" . }}-halyard-psp
subjects:
- kind: ServiceAccount
{{- if .Values.serviceAccount.halyardName }}
name: {{ .Values.serviceAccount.halyardName }}
{{- else }}
name: {{ template "spinnaker.fullname" . }}-halyard
{{- end }}
namespace: {{ .Release.Namespace }}
{{- end }}
27 changes: 27 additions & 0 deletions stable/spinnaker/templates/rbac/psp-halyard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.rbac.pspEnabled }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "spinnaker.fullname" . }}-halyard
labels:
{{ include "spinnaker.standard-labels" . | indent 4 }}
spec:
privileged: false
allowPrivilegeEscalation: false
volumes:
- 'configMap'
- 'emptyDir'
- 'persistentVolumeClaim'
- 'secret'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'MustRunAsNonRoot'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
{{- end }}
2 changes: 2 additions & 0 deletions stable/spinnaker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ azs:
rbac:
# Specifies whether RBAC resources should be created
create: true
# Specifies whether PSP resources should be created
pspEnabled: false

serviceAccount:
# Specifies whether a ServiceAccount should be created
Expand Down