added repo
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: protect-critical-namespaces
|
||||
spec:
|
||||
validationFailureAction: Enforce
|
||||
background: false
|
||||
rules:
|
||||
- name: deny-deletion-of-critical-namespaces
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Namespace
|
||||
names:
|
||||
- keda-demand-prd
|
||||
- contour-internal-0-demand-prd
|
||||
- contour-internal-0-demand-prd-intra
|
||||
- contour-external-demand-prd
|
||||
- external-secrets-demand-prd
|
||||
- flagger-demand-prd
|
||||
- victoriametrics
|
||||
- kube-system
|
||||
- monitoring
|
||||
- telegraf-operator
|
||||
- loadtester
|
||||
- opentelemetry
|
||||
- fluentd
|
||||
- kube-events
|
||||
- observability
|
||||
- contour-cert-checker-ns
|
||||
- aurva-dataplane
|
||||
validate:
|
||||
message: "Deletion of critical namespaces is not allowed."
|
||||
deny:
|
||||
conditions:
|
||||
any:
|
||||
- key: "{{request.operation}}"
|
||||
operator: Equals
|
||||
value: DELETE
|
||||
@@ -0,0 +1,29 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: restrict-minimum-replicas-selected-ns
|
||||
spec:
|
||||
validationFailureAction: Enforce
|
||||
background: false
|
||||
rules:
|
||||
- name: min-replicas-deployments-statefulsets
|
||||
match:
|
||||
resources:
|
||||
kinds:
|
||||
- Deployment
|
||||
- StatefulSet
|
||||
- Deployment/scale
|
||||
- StatefulSet/scale
|
||||
names:
|
||||
- coredns
|
||||
namespaces:
|
||||
- kube-system
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
validate:
|
||||
message: "Deployments and StatefulSets must have at least 5 replicas in this namespace."
|
||||
anyPattern:
|
||||
# Case 1: replicas explicitly set and >= 5
|
||||
- spec:
|
||||
replicas: ">=5"
|
||||
Reference in New Issue
Block a user