ExternalDNS, part of Kubernetes SIGs, triggers the creation of external DNS records in supported providers when the annotation`external-dns.alpha.kubernetes.io/hostname` is present. Like with internal DNS, duplicates must be avoided. This policy requires every such Service have a cluster-unique hostname present in the value of the annotation.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: unique-external-dnsannotations:policies.kyverno.io/title: Require Unique External DNS Servicespolicies.kyverno.io/category: Otherpolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Servicekyverno.io/kyverno-version: 1.5.1kyverno.io/kubernetes-version: "1.21"policies.kyverno.io/minversion: 1.6.0policies.kyverno.io/description: ExternalDNS, part of Kubernetes SIGs, triggers the creation of external DNS records in supported providers when the annotation`external-dns.alpha.kubernetes.io/hostname` is present. Like with internal DNS, duplicates must be avoided. This policy requires every such Service have a cluster-unique hostname present in the value of the annotation.spec:validationFailureAction: Auditbackground: falserules:- name: ensure-valid-externaldns-annotationmatch:any:- resources:kinds:- Serviceannotations:external-dns.alpha.kubernetes.io/hostname: "*"context:- name: alldnsapiCall:urlPath: /api/v1/servicesjmesPath: items[?[metadata.namespace, metadata.name] != ['{{request.object.metadata.namespace}}', '{{request.object.metadata.name}}']].metadata.annotations."external-dns.alpha.kubernetes.io/hostname"preconditions:all:- key: "{{ request.operation || 'BACKGROUND' }}"operator: AnyInvalue:- CREATE- UPDATEvalidate:message: External DNS entry "{{request.object.metadata.annotations."external-dns.alpha.kubernetes.io/hostname"}}" is already taken by another service in the cluster.deny:conditions:all:- key: "{{request.object.metadata.annotations.\"external-dns.alpha.kubernetes.io/hostname\"}}"operator: AnyInvalue: "{{alldns}}"
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.