Remove kyverno patch for pvcs

This commit is contained in:
Nikolai Rodionov 2024-09-28 21:54:31 +02:00
parent fdc827ee69
commit 19241a77b2
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD

View File

@ -0,0 +1,40 @@
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: replace-storage-class-by-openebs
spec:
rules:
- name: replace-storage-class
match:
any:
- resources:
kinds:
- PersistentVolumeClaim
mutate:
patchStrategicMerge:
metadata:
annotations:
volume.beta.kubernetes.io/storage-class: openebs-hostpath
spec:
storageClassName: openebs-hostpath
accessModes:
- ReadWriteOnce
- name: remove-unwanted-annotations
match:
any:
- resources:
kinds:
- PersistentVolumeClaim
namespaces:
- games
mutate:
patchesJson6902: |-
- path: "/metadata/annotations/volume.beta.kubernetes.io~1storage-class"
op: replace
value: openebs-hostpath
- path: "/metadata/annotations/volume.beta.kubernetes.io~1storage-provisioner"
op: replace
value: openebs.io/local
- path: "/metadata/annotations/volume.kubernetes.io~1storage-provisioner"
op: replace
value: openebs.io/local