forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stable/nginx-ingress] Support pod security policies on default backe…
…nd (helm#16856) * [stable/nginx-ingress] Support pod security policies on default backend Co-authored-by: Harsha Katepal <hkatepal@ford.com> Signed-off-by: Stu Charlton <scharlton@pivotal.io> Signed-off-by: Harsha Katepal <hkatepal@ford.com> * Bump chart major version Signed-off-by: Stu Charlton <scharlton@pivotal.io> * Don't rename the controller PSP, keep it as is. Signed-off-by: Stu Charlton <scharlton@pivotal.io>
- Loading branch information
1 parent
dc11bbd
commit d7306c2
Showing
13 changed files
with
103 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{- if and .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}} | ||
apiVersion: policy/v1beta1 | ||
kind: PodSecurityPolicy | ||
metadata: | ||
name: {{ template "nginx-ingress.fullname" . }}-backend | ||
labels: | ||
app: {{ template "nginx-ingress.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
allowPrivilegeEscalation: false | ||
fsGroup: | ||
ranges: | ||
- max: 65535 | ||
min: 1 | ||
rule: MustRunAs | ||
requiredDropCapabilities: | ||
- ALL | ||
runAsUser: | ||
rule: MustRunAsNonRoot | ||
seLinux: | ||
rule: RunAsAny | ||
supplementalGroups: | ||
ranges: | ||
- max: 65535 | ||
min: 1 | ||
rule: MustRunAs | ||
volumes: | ||
- configMap | ||
- emptyDir | ||
- projected | ||
- secret | ||
- downwardAPI | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: Role | ||
metadata: | ||
labels: | ||
app: {{ template "nginx-ingress.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "nginx-ingress.fullname" . }}-backend | ||
rules: | ||
- apiGroups: ['extensions'] | ||
resources: ['podsecuritypolicies'] | ||
verbs: ['use'] | ||
resourceNames: [{{ template "nginx-ingress.fullname" . }}-backend] | ||
{{- end -}} |
19 changes: 19 additions & 0 deletions
19
stable/nginx-ingress/templates/default-backend-rolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- if and .Values.rbac.create .Values.podSecurityPolicy.enabled .Values.defaultBackend.enabled -}} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: RoleBinding | ||
metadata: | ||
labels: | ||
app: {{ template "nginx-ingress.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "nginx-ingress.fullname" . }}-backend | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ template "nginx-ingress.fullname" . }}-backend | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "nginx-ingress.defaultBackend.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end -}} |
11 changes: 11 additions & 0 deletions
11
stable/nginx-ingress/templates/default-backend-serviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if and .Values.defaultBackend.enabled .Values.defaultBackend.serviceAccount.create }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: {{ template "nginx-ingress.name" . }} | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "nginx-ingress.defaultBackend.serviceAccountName" . }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters