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

Disable psp switch #155

Merged
merged 3 commits into from
Oct 3, 2023
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
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
Loading