A Kubernetes Service of type NodePort uses a host port to receive traffic from any source. A NetworkPolicy cannot be used to control traffic to host ports. Although NodePort Services can be useful, their use must be limited to Services with additional upstream security checks. This policy validates that any new Services do not use the `NodePort` type.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: restrict-nodeportannotations:policies.kyverno.io/title: Disallow NodePortpolicies.kyverno.io/category: Best Practicespolicies.kyverno.io/minversion: 1.6.0policies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Servicepolicies.kyverno.io/description: A Kubernetes Service of type NodePort uses a host port to receive traffic from any source. A NetworkPolicy cannot be used to control traffic to host ports. Although NodePort Services can be useful, their use must be limited to Services with additional upstream security checks. This policy validates that any new Services do not use the `NodePort` type.spec:validationFailureAction: Auditbackground: truerules:- name: validate-nodeportmatch:any:- resources:kinds:- Servicevalidate:message: Services of type NodePort are not allowed.pattern:spec:"=(type)": "!NodePort"
This policy prevents the use of the default project in an Application.
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.