Skip to content

Commit

Permalink
Add PSP toggle for k8s 1.25 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubasobon authored Nov 9, 2023
1 parent 3e1a2d1 commit 2cda75e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Add a switch for PSP CR installation.

## [3.2.1] - 2023-10-04

## [3.2.0] - 2023-02-28
Expand Down
26 changes: 26 additions & 0 deletions helm/docs-indexer-app/templates/psp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if not .Values.podSecurityStandards.enforced }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ .Values.name }}
spec:
allowPrivilegeEscalation: false
runAsUser:
rule: MustRunAsNonRoot
seLinux:
rule: RunAsAny
supplementalGroups:
rule: MustRunAs
ranges:
- max: 65535
min: 1
fsGroup:
rule: MustRunAs
ranges:
- max: 65535
min: 1
volumes:
- secret
- configMap
- emptyDir
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ .Values.name }}
spec:
allowPrivilegeEscalation: false
runAsUser:
rule: MustRunAsNonRoot
seLinux:
rule: RunAsAny
supplementalGroups:
rule: MustRunAs
ranges:
- max: 65535
min: 1
fsGroup:
rule: MustRunAs
ranges:
- max: 65535
min: 1
volumes:
- secret
- configMap
- emptyDir
---
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -36,6 +10,7 @@ metadata:
name: {{ .Values.name }}
namespace: {{ .Release.Namespace }}
rules:
{{- if not .Values.podSecurityStandards.enforced }}
- apiGroups:
- extensions
resourceNames:
Expand All @@ -44,6 +19,7 @@ rules:
- podsecuritypolicies
verbs:
- use
{{- end }}
- apiGroups:
- ""
resources:
Expand All @@ -66,3 +42,4 @@ subjects:
- kind: ServiceAccount
name: {{ .Values.name }}
namespace: {{ .Release.Namespace }}

3 changes: 3 additions & 0 deletions helm/docs-indexer-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ image:
tag: "[[.Version]]"
sha: "[[.SHA]]"
elasticsearchEndpoint: "http://sitesearch-app:9200/"

podSecurityStandards:
enforced: false

0 comments on commit 2cda75e

Please sign in to comment.