Merge pull request #2294 from doflamingo721/v2monitoring-crd-psp-compatibility

[dev-v2.7 rancher-monitoring-crd] Add condition to check PSP compatibility
pull/2295/head
Geet Samra 2022-12-23 09:35:08 -08:00 committed by GitHub
commit 015dae14d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 2 deletions

View File

@ -10,11 +10,13 @@ rules:
resources:
- customresourcedefinitions
verbs: ['create', 'get', 'patch', 'delete']
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ .Chart.Name }}-manager
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
@ -39,6 +41,7 @@ metadata:
labels:
app: {{ .Chart.Name }}-manager
---
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
@ -70,3 +73,4 @@ spec:
volumes:
- 'configMap'
- 'secret'
{{- end }}

View File

@ -10187,9 +10187,9 @@ entries:
catalog.cattle.io/namespace: cattle-monitoring-system
catalog.cattle.io/release-name: rancher-monitoring-crd
apiVersion: v1
created: "2022-11-03T10:52:49.315493-07:00"
created: "2022-12-23T15:39:05.789849211+05:30"
description: Installs the CRDs for rancher-monitoring.
digest: 16a8bb06859537d2be1e43438d61f39a5935083210f443dedc2227a7fc88fc55
digest: dc5ce05f1dde5a948a8cf0001b42197c7523ad3c13fbdc006bf375dc50b9bae1
name: rancher-monitoring-crd
type: application
urls:

View File

@ -10,11 +10,13 @@ rules:
resources:
- customresourcedefinitions
verbs: ['create', 'get', 'patch', 'delete']
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ .Chart.Name }}-manager
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
@ -39,6 +41,7 @@ metadata:
labels:
app: {{ .Chart.Name }}-manager
---
{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
@ -70,3 +73,4 @@ spec:
volumes:
- 'configMap'
- 'secret'
{{- end }}