apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: disallow-nodeport-services annotations: policies.kyverno.io/title: Disallow NodePort Services policies.kyverno.io/category: Zero Trust policies.kyverno.io/severity: medium spec: validationFailureAction: Enforce background: true rules: - name: disallow-nodeport match: any: - resources: kinds: - Service exclude: any: - resources: namespaces: - kube-system - istio-system validate: message: "NodePort services are not allowed. Use ClusterIP or LoadBalancer." pattern: spec: type: "!NodePort"