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 Replicaspolicies.kyverno.io/category: Samplepolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Deploymentpolicies.kyverno.io/minversion: 1.6.0policies.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:- Deploymentvalidate:message: Deployments should have more than one replica to ensure availability.pattern:spec:replicas: ">1"
This policy performs some best practices validation on Application fields. Path or chart must be specified but never both. And destination.name or destination.server must be specified but never both.
This policy prevents the use of the default project in an Application.
This policy prevents updates to the project field after an Application is created.