Especially in cloud provider environments, a Service having type LoadBalancer will cause the provider to respond by creating a load balancer somewhere in the customer account. This adds cost and complexity to a deployment. Without restricting this ability, users may easily overrun established budgets and security practices set by the organization. This policy restricts use of the Service type LoadBalancer.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: no-loadbalancer-serviceannotations:policies.kyverno.io/title: Disallow Service Type LoadBalancerpolicies.kyverno.io/category: Samplepolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Servicepolicies.kyverno.io/minversion: 1.6.0policies.kyverno.io/description: Especially in cloud provider environments, a Service having type LoadBalancer will cause the provider to respond by creating a load balancer somewhere in the customer account. This adds cost and complexity to a deployment. Without restricting this ability, users may easily overrun established budgets and security practices set by the organization. This policy restricts use of the Service type LoadBalancer.spec:validationFailureAction: Auditbackground: truerules:- name: no-LoadBalancermatch:any:- resources:kinds:- Servicevalidate:message: Service of type LoadBalancer is not allowed.pattern:spec:type: "!LoadBalancer"
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.
This policy ensures that the name of the ApplicationSet is the same value provided in the project.