Skip to content

Commit

Permalink
add toggle value for PSS migration (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berk Dehrioglu authored Oct 30, 2023
1 parent e08db50 commit 5dfd728
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 2 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]

### Added

- Add `global.podSecurityStandards.enforced` value for PSS migration.

## [2.5.0] - 2023-10-09

### Changed
Expand Down
3 changes: 2 additions & 1 deletion helm/cluster-api-provider-aws/files/copy/psp.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.global.podSecurityStandards.enforced }}
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
Expand Down Expand Up @@ -66,4 +67,4 @@ roleRef:
name: {{ include "resource.psp.name" . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.global.podSecurityStandards.enforced }}
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
Expand Down Expand Up @@ -37,3 +38,4 @@ spec:
max: 65535
readOnlyRootFilesystem: false
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ rules:
- delete
- get
- patch
{{- if not .Values.global.podSecurityStandards.enforced }}
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
- apiGroups:
- policy
Expand All @@ -38,6 +39,7 @@ rules:
verbs:
- use
{{- end }}
{{- end }}
- apiGroups:
- apps
- extensions
Expand Down
3 changes: 2 additions & 1 deletion helm/cluster-api-provider-aws/templates/psp.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.global.podSecurityStandards.enforced }}
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
Expand Down Expand Up @@ -66,4 +67,4 @@ roleRef:
name: {{ include "resource.psp.name" . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}

{{- end }}
13 changes: 13 additions & 0 deletions helm/cluster-api-provider-aws/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,19 @@
"type": "boolean"
}
}
},
"global": {
"type": "object",
"properties": {
"podSecurityStandards": {
"type": "object",
"properties": {
"enforced": {
"type": "boolean"
}
}
}
}
}
}
}
4 changes: 4 additions & 0 deletions helm/cluster-api-provider-aws/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ registry:

verticalPodAutoscaler:
enabled: true

global:
podSecurityStandards:
enforced: false

0 comments on commit 5dfd728

Please sign in to comment.