Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Disable psp switch (#155)
Browse files Browse the repository at this point in the history
* Disable psp switch

Signed-off-by: QuentinBisson <[email protected]>

* Update CHANGELOG.md

---------

Signed-off-by: QuentinBisson <[email protected]>
  • Loading branch information
QuentinBisson authored Oct 3, 2023
1 parent 2c52125 commit 0f85e02
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Add condition for PSP installation in helm chart.

## [1.21.0] - 2023-09-27

### Added
Expand Down
4 changes: 4 additions & 0 deletions helm/promxy-app/templates/psp.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if not .Values.global.podSecurityStandards.enforced }}
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
Expand Down Expand Up @@ -31,3 +33,5 @@ spec:
hostNetwork: false
hostIPC: false
hostPID: false
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions helm/promxy-app/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ roleRef:
name: {{ include "resource.default.name" . }}
apiGroup: rbac.authorization.k8s.io
---
{{- if not .Values.global.podSecurityStandards.enforced }}
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -61,3 +63,5 @@ roleRef:
kind: ClusterRole
name: {{ include "resource.psp.name" . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions helm/promxy-app/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"global": {
"type": "object",
"properties": {
"podSecurityStandards": {
"type": "object",
"properties": {
"enforced": {
"type": "boolean"
}
}
}
}
},
"ingress": {
"type": "object",
"properties": {
Expand Down
4 changes: 4 additions & 0 deletions helm/promxy-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kyvernoPolicyExceptions:
enabled: true
namespace: giantswarm

global:
podSecurityStandards:
enforced: false

monitoring:
prometheus:
host: ""
Expand Down

0 comments on commit 0f85e02

Please sign in to comment.