Pods not created by workload controllers such as Deployments have no self-healing or scaling abilities and are unsuitable for production. This policy prevents such "bare" Pods from being created unless they originate from a higher-level workload controller of some sort.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: prevent-bare-podsannotations:policies.kyverno.io/title: Prevent Bare Podspod-policies.kyverno.io/autogen-controllers: nonepolicies.kyverno.io/category: Other, EKS Best Practicespolicies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.7.0policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.23"policies.kyverno.io/subject: Podpolicies.kyverno.io/description: Pods not created by workload controllers such as Deployments have no self-healing or scaling abilities and are unsuitable for production. This policy prevents such "bare" Pods from being created unless they originate from a higher-level workload controller of some sort.spec:validationFailureAction: Auditbackground: truerules:- name: bare-podsmatch:any:- resources:kinds:- Podpreconditions:all:- key: "{{request.operation || 'BACKGROUND'}}"operator: NotEqualsvalue: DELETEvalidate:message: Bare Pods are not allowed. They must be created by Pod controllers.deny:conditions:any:- key: ownerReferencesoperator: AnyNotInvalue: "{{request.object.metadata.keys(@)}}"
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.