Skip to content

Commit

Permalink
Force-disable PSP-related resources when `global.podSecurityStandards… (
Browse files Browse the repository at this point in the history
#1033)

* Force-disable PSP-related resources when `global.podSecurityStandards.enforced` value is true.

* Force-disable PSP-related resources when `global.podSecurityStandards.enforced` value is true.
  • Loading branch information
whites11 committed Oct 19, 2023
1 parent eac68a8 commit d54e004
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,10 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s

## [Unreleased]

### Changed

- Force-disable PSP-related resources when `global.podSecurityStandards.enforced` value is true.

## [3.0.0] - 2023-10-04

### Removed
Expand Down
2 changes: 1 addition & 1 deletion helm/chart-operator/templates/psp.yaml
@@ -1,4 +1,4 @@
{{- if le (int .Capabilities.KubeVersion.Minor) 24 }}
{{- if not .Values.global.podSecurityStandards.enforced }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
Expand Down
2 changes: 2 additions & 0 deletions helm/chart-operator/templates/rbac.yaml
Expand Up @@ -12,6 +12,7 @@ roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
{{- if not .Values.global.podSecurityStandards.enforced }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down Expand Up @@ -43,3 +44,4 @@ roleRef:
kind: ClusterRole
name: {{ tpl .Values.resource.psp.name . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
13 changes: 13 additions & 0 deletions helm/chart-operator/values.schema.json
Expand Up @@ -86,6 +86,19 @@
"externalDNSIP": {
"type": "string"
},
"global": {
"type": "object",
"properties": {
"podSecurityStandards": {
"type": "object",
"properties": {
"enforced": {
"type": "boolean"
}
}
}
}
},
"helm": {
"type": "object",
"properties": {
Expand Down
4 changes: 4 additions & 0 deletions helm/chart-operator/values.yaml
Expand Up @@ -123,3 +123,7 @@ securityContext:
kyvernoPolicyExceptions:
enabled: true
namespace: giantswarm

global:
podSecurityStandards:
enforced: false

0 comments on commit d54e004

Please sign in to comment.