1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

add number to each example

This commit is contained in:
Shuting Zhao 2019-07-18 00:43:56 -07:00
parent 6b45bdc585
commit 933ed19b7a
14 changed files with 36 additions and 25 deletions

View file

@ -8,6 +8,12 @@ spec:
resource:
kinds:
- Deployment
# - StatefulSet
# name: "my-deployment"
# selector :
# matchLabels:
# app.type: prod
# namespace: "my-namespace"
mutate:
overlay:
spec:

View file

@ -9,6 +9,7 @@ spec:
kinds:
- Deployment
- StatefulSet
namespace: default
validate:
message: "Registry is not allowed"
pattern:
@ -18,5 +19,4 @@ spec:
containers:
- name: "*"
# Check allowed registries
image: "*nirmata*"
# image: "*nirmata* | https://private.registry.io/*"
image: "*nirmata* | https://private.registry.io/*"

View file

@ -8,7 +8,7 @@ spec:
resource:
kinds:
- Namespace
name: "*"
name: "devtest"
generate:
kind: NetworkPolicy
name: deny-ingress-traffic
@ -22,4 +22,9 @@ spec:
metadata:
annotations: {}
labels:
policyname: "default"
policyname: "default"
# kind: ConfigMap
# name: default-config
# clone:
# namespace: default
# name: config-template

View file

@ -13,7 +13,7 @@ spec:
- -c
- touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600
readinessProbe:
periodSeconds: 5
# successThreshold: 3
exec:
command:
- cat

View file

@ -9,19 +9,19 @@ spec:
kinds :
- Pod
validate:
message: "a readinessProbe is required"
message: "readinessProbe is required"
pattern:
spec:
containers:
- (name): "readiness"
readinessProbe:
periodSeconds: ">0"
successThreshold: ">1"
- name: check-livenessProbe-exists
resource:
kinds :
- Pod
validate:
message: "a livenessProbe is required"
message: "livenessProbe is required"
pattern:
spec:
containers:

View file

@ -4,22 +4,6 @@ metadata:
name: policy-qos
spec:
rules:
- name: add-memory-limit
resource:
kinds:
- Deployment
mutate:
overlay:
spec:
template:
spec:
containers:
# the wildcard * will match all containers in the list
- (name): "*"
resources:
limits:
# add memory limit if it is not exist
"+(memory)": "300Mi"
- name: check-cpu-memory-limits
resource:
kinds:
@ -37,4 +21,20 @@ spec:
limits:
# cpu and memory are required
memory: "?*"
cpu: "?*"
cpu: "?*"
- name: add-memory-limit
resource:
kinds:
- Deployment
mutate:
overlay:
spec:
template:
spec:
containers:
# the wildcard * will match all containers in the list
- (name): "*"
resources:
limits:
# add memory limit if it is not exist
"+(memory)": "300Mi"