Deployments with a single replica cannot be highly available and thus the application may suffer downtime if that one replica goes down. This policy validates that Deployments have more than one replica.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: deployment-has-multiple-replicasannotations:policies.kyverno.io/title: Require Multiple Replicas in CEL expressionspolicies.kyverno.io/category: Sample in CELpolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Deploymentpolicies.kyverno.io/minversion: 1.11.0kyverno.io/kubernetes-version: 1.26-1.27policies.kyverno.io/description: Deployments with a single replica cannot be highly available and thus the application may suffer downtime if that one replica goes down. This policy validates that Deployments have more than one replica.spec:validationFailureAction: Auditbackground: truerules:- name: deployment-has-multiple-replicasmatch:any:- resources:kinds:- Deploymentoperations:- CREATE- UPDATEvalidate:cel:expressions:- expression: object.spec.replicas > 1message: Deployments should have more than one replica to ensure availability.
This policy prevents the use of the default project in an Application.
This policy ensures that the name of the ApplicationSet is the same value provided in the project.
This policy ensures that the name of the ApplicationSet is the same value provided in the project.