PersistentVolumeClaims (PVCs) and StatefulSets may optionally define a StorageClass to dynamically provision storage. In a multi-tenancy environment where StorageClasses are far more common, it is often better to require storage only be provisioned from these StorageClasses. This policy requires that PVCs and StatefulSets containing volumeClaimTemplates define the storageClassName field with some value.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: require-storageclassannotations:policies.kyverno.io/title: Require StorageClasspolicies.kyverno.io/category: Other, Multi-Tenancypolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: PersistentVolumeClaim, StatefulSetpolicies.kyverno.io/description: PersistentVolumeClaims (PVCs) and StatefulSets may optionally define a StorageClass to dynamically provision storage. In a multi-tenancy environment where StorageClasses are far more common, it is often better to require storage only be provisioned from these StorageClasses. This policy requires that PVCs and StatefulSets containing volumeClaimTemplates define the storageClassName field with some value.spec:validationFailureAction: Auditbackground: truerules:- name: pvc-storageclassmatch:any:- resources:kinds:- PersistentVolumeClaimvalidate:message: PersistentVolumeClaims must define a storageClassName.pattern:spec:storageClassName: "?*"- name: ss-storageclassmatch:any:- resources:kinds:- StatefulSetvalidate:message: StatefulSets must define a storageClassName.pattern:spec:"=(volumeClaimTemplates)":- spec:storageClassName: "?*"
This policy prevents the use of the default project in an Application.
Services of type LoadBalancer when deployed inside AWS have support for transport encryption if it is enabled via an annotation. This policy requires that Services of type LoadBalancer contain the annotation service.beta.kubernetes.io/aws-load-balancer-ssl-cert with some value.
This policy prevents updates to the project field after an Application is created.