mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
cleanup example folder
This commit is contained in:
parent
c1916a8bfc
commit
3a639fd6fd
24 changed files with 37 additions and 82 deletions
|
@ -1,25 +0,0 @@
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: nginx-deployment
|
|
||||||
creationTimestamp:
|
|
||||||
labels:
|
|
||||||
app: nginx
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: nginx
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
creationTimestamp:
|
|
||||||
labels:
|
|
||||||
app: nginx
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: nginx
|
|
||||||
image: nginx:latest
|
|
||||||
ports:
|
|
||||||
- containerPort: 80
|
|
||||||
- name: ghost
|
|
||||||
image: ghost:latest
|
|
|
@ -1,20 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1alpha1
|
|
||||||
kind: Policy
|
|
||||||
metadata:
|
|
||||||
name: set-image-pull-policy
|
|
||||||
spec:
|
|
||||||
rules:
|
|
||||||
- name: set-image-pull-policy
|
|
||||||
match:
|
|
||||||
resources:
|
|
||||||
kinds:
|
|
||||||
- Deployment
|
|
||||||
mutate:
|
|
||||||
overlay:
|
|
||||||
spec:
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
# if the image tag is latest, set the imagePullPolicy to Always
|
|
||||||
- (image): "*:latest"
|
|
||||||
imagePullPolicy: "IfNotPresent"
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: kyverno.io/v1alpha1
|
apiVersion: kyverno.io/v1alpha1
|
||||||
kind: Policy
|
kind: Policy
|
||||||
metadata:
|
metadata:
|
||||||
name: "default"
|
name: "deny-ingress-traffic"
|
||||||
spec:
|
spec:
|
||||||
rules:
|
rules:
|
||||||
- name: "deny-ingress-traffic"
|
- name: "deny-ingress-traffic"
|
||||||
|
@ -15,13 +15,14 @@ spec:
|
||||||
name: deny-ingress-traffic
|
name: deny-ingress-traffic
|
||||||
data:
|
data:
|
||||||
spec:
|
spec:
|
||||||
|
podSelector: {}
|
||||||
policyTypes:
|
policyTypes:
|
||||||
- Ingress
|
- Ingress
|
||||||
|
ingress:
|
||||||
|
- from:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels:
|
||||||
|
role: frontend
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
policyname: "default"
|
policyname: "default"
|
||||||
# kind: ConfigMap
|
|
||||||
# name: default-config
|
|
||||||
# clone:
|
|
||||||
# namespace: default
|
|
||||||
# name: config-template
|
|
|
@ -17,12 +17,6 @@ spec :
|
||||||
- path : "/subsets/0/ports/0/port"
|
- path : "/subsets/0/ports/0/port"
|
||||||
op : replace
|
op : replace
|
||||||
value: 9663
|
value: 9663
|
||||||
- path : "/subsets/0"
|
- path : "/metadata/labels/isMutated"
|
||||||
op: add
|
op: add
|
||||||
value:
|
value: "true"
|
||||||
addresses:
|
|
||||||
- ip: "192.168.10.172"
|
|
||||||
ports:
|
|
||||||
- name: load-balancer-connection
|
|
||||||
port: 80
|
|
||||||
protocol: UDP
|
|
|
@ -9,13 +9,9 @@ spec:
|
||||||
resources:
|
resources:
|
||||||
kinds:
|
kinds:
|
||||||
- Deployment
|
- Deployment
|
||||||
exclude:
|
selector:
|
||||||
resources:
|
matchLabels:
|
||||||
name: nginx-deployment1
|
app : nginxlatest
|
||||||
selector :
|
|
||||||
matchLabels:
|
|
||||||
app: nginx1
|
|
||||||
namespace: "default"
|
|
||||||
mutate:
|
mutate:
|
||||||
overlay:
|
overlay:
|
||||||
spec:
|
spec:
|
|
@ -10,6 +10,9 @@ spec:
|
||||||
resources:
|
resources:
|
||||||
kinds:
|
kinds:
|
||||||
- Deployment
|
- Deployment
|
||||||
|
selector :
|
||||||
|
matchLabels:
|
||||||
|
test: qos
|
||||||
mutate:
|
mutate:
|
||||||
overlay:
|
overlay:
|
||||||
spec:
|
spec:
|
||||||
|
@ -28,6 +31,9 @@ spec:
|
||||||
resources:
|
resources:
|
||||||
kinds:
|
kinds:
|
||||||
- Deployment
|
- Deployment
|
||||||
|
selector :
|
||||||
|
matchLabels:
|
||||||
|
test: qos
|
||||||
validate:
|
validate:
|
||||||
message: "Resource limits are required for CPU and memory"
|
message: "Resource limits are required for CPU and memory"
|
||||||
pattern:
|
pattern:
|
2
examples/demo/7_container_security_context/policy.yaml → examples/policy_validate_containerSecurityContext.yaml
Executable file → Normal file
2
examples/demo/7_container_security_context/policy.yaml → examples/policy_validate_containerSecurityContext.yaml
Executable file → Normal file
|
@ -24,4 +24,4 @@ spec:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
# fields can be customized
|
# fields can be customized
|
||||||
# privileged: false
|
# privileged: false
|
||||||
# readOnlyRootFilesystem: true
|
# readOnlyRootFilesystem: true
|
|
@ -10,7 +10,9 @@ spec:
|
||||||
kinds:
|
kinds:
|
||||||
- Deployment
|
- Deployment
|
||||||
- StatefulSet
|
- StatefulSet
|
||||||
namespace: default
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nirmata-nginx
|
||||||
validate:
|
validate:
|
||||||
message: "Registry is not allowed"
|
message: "Registry is not allowed"
|
||||||
pattern:
|
pattern:
|
|
@ -11,7 +11,7 @@ spec:
|
||||||
- Deployment
|
- Deployment
|
||||||
selector :
|
selector :
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.type: prod
|
test: psp
|
||||||
validate:
|
validate:
|
||||||
message: "security context 'runAsNonRoot' shoud be set to true"
|
message: "security context 'runAsNonRoot' shoud be set to true"
|
||||||
pattern:
|
pattern:
|
|
@ -3,17 +3,16 @@ kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx-deployment
|
name: nginx-deployment
|
||||||
labels:
|
labels:
|
||||||
app: nginx
|
app: nginxlatest
|
||||||
cli: test
|
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: nginx
|
app: nginxlatest
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: nginx
|
app: nginxlatest
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx
|
- name: nginx
|
|
@ -2,6 +2,8 @@ apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: qos-demo
|
name: qos-demo
|
||||||
|
labels:
|
||||||
|
test: qos
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
4
examples/demo/7_container_security_context/nginx.yaml → examples/resource_validate_containerSecurityContext.yaml
Executable file → Normal file
4
examples/demo/7_container_security_context/nginx.yaml → examples/resource_validate_containerSecurityContext.yaml
Executable file → Normal file
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: psp-demo-unprivileged
|
name: csc-demo-unprivileged
|
||||||
labels:
|
labels:
|
||||||
app.type: prod
|
app.type: prod
|
||||||
spec:
|
spec:
|
||||||
|
@ -19,4 +19,4 @@ spec:
|
||||||
image: nginxinc/nginx-unprivileged
|
image: nginxinc/nginx-unprivileged
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
allowPrivilegeEscalation: true
|
allowPrivilegeEscalation: false
|
|
@ -1,9 +1,9 @@
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx-deployment
|
name: nirmata-nginx
|
||||||
labels:
|
labels:
|
||||||
app: nginx
|
app: nirmata-nginx
|
||||||
cli: test
|
cli: test
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
@ -16,6 +16,6 @@ spec:
|
||||||
app: nginx
|
app: nginx
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx
|
- name: nirmata-nginx
|
||||||
# image: nginx
|
# image: nginx
|
||||||
image: nirmata/nginx
|
image: nirmata/nginx
|
|
@ -3,16 +3,16 @@ kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: psp-demo-unprivileged
|
name: psp-demo-unprivileged
|
||||||
labels:
|
labels:
|
||||||
app.type: prod
|
test: psp
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: psp
|
test: psp
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: psp
|
test: psp
|
||||||
spec:
|
spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
Loading…
Add table
Reference in a new issue