Ingress classes should only be allowed which match up to deployed Ingress controllers in the cluster. Allowing users to define classes which cannot be satisfied by a deployed Ingress controller can result in either no or undesired functionality. This policy checks Ingress resources and only allows those which define `HAProxy` or `nginx` in the respective annotation. This annotation has largely been replaced as of Kubernetes 1.18 with the IngressClass resource.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: restrict-ingress-classesannotations:policies.kyverno.io/title: Restrict Ingress Classespolicies.kyverno.io/category: Samplepolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Ingresspolicies.kyverno.io/minversion: 1.6.0policies.kyverno.io/description: Ingress classes should only be allowed which match up to deployed Ingress controllers in the cluster. Allowing users to define classes which cannot be satisfied by a deployed Ingress controller can result in either no or undesired functionality. This policy checks Ingress resources and only allows those which define `HAProxy` or `nginx` in the respective annotation. This annotation has largely been replaced as of Kubernetes 1.18 with the IngressClass resource.spec:validationFailureAction: Auditbackground: truerules:- name: validate-ingressmatch:any:- resources:kinds:- Ingressvalidate:message: Unknown ingress class.pattern:metadata:annotations:kubernetes.io/ingress.class: HAProxy | nginx
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.