1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/definitions/manifest/deployment.yaml
Arsh Sharma 42d4948537
adding pod anti-affinity to Kyverno (#1985)
* added for deployment.yaml

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>

* added for helm

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>

* to be tested

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>

* removed not needed ends

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>

* made changes to pass the test

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>

* removed hard from values.yaml

Signed-off-by: RinkiyaKeDad <arshsharma461@gmail.com>

* added condition to disable pod-affinity

Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>

* changed with to if condition

Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>

* small fix for trailing spaces

Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>

* small fix

Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>

Co-authored-by: NoSkillGirl <singhpooja240393@gmail.com>
2021-09-20 15:52:46 +05:30

128 lines
3.7 KiB
YAML
Executable file

---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: kyverno
# do not remove
app.kubernetes.io/name: kyverno
name: kyverno
spec:
selector:
matchLabels:
app: kyverno
# do not remove
app.kubernetes.io/name: kyverno
replicas: 1
template:
metadata:
labels:
app: kyverno
# do not remove
app.kubernetes.io/name: kyverno
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- kyverno
topologyKey: "kubernetes.io/hostname"
serviceAccountName: kyverno-service-account
securityContext:
runAsNonRoot: true
initContainers:
- name: kyverno-pre
image: ghcr.io/kyverno/kyvernopre:latest
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: 100m
memory: 256Mi
requests:
cpu: 10m
memory: 64Mi
securityContext:
runAsNonRoot: true
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- all
env:
- name: METRICS_CONFIG
value: kyverno-metrics
containers:
- name: kyverno
image: ghcr.io/kyverno/kyverno:latest
imagePullPolicy: IfNotPresent
args:
- "--filterK8sResources=[Event,*,*][*,kube-system,*][*,kube-public,*][*,kube-node-lease,*][Node,*,*][APIService,*,*][TokenReview,*,*][SubjectAccessReview,*,*][*,kyverno,*][Binding,*,*][ReplicaSet,*,*][ReportChangeRequest,*,*][ClusterReportChangeRequest,*,*][PolicyReport,*,*][ClusterPolicyReport,*,*]"
# customize webhook timeout
#- "--webhooktimeout=4"
# enable profiling
# - "--profile"
# configure the workers for generate controller
# - --gen-workers=20
- "-v=2"
ports:
- containerPort: 9443
name: https
protocol: TCP
- containerPort: 8000
name: metrics-port
protocol: TCP
env:
- name: INIT_CONFIG
value: init-config
- name: METRICS_CONFIG
value: kyverno-metrics
- name: KYVERNO_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: KYVERNO_SVC
value: kyverno-svc
securityContext:
runAsNonRoot: true
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- all
resources:
requests:
memory: "50Mi"
cpu: "100m"
limits:
memory: "256Mi"
livenessProbe:
httpGet:
path: /health/liveness
port: 9443
scheme: HTTPS
initialDelaySeconds: 15
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 2
successThreshold: 1
readinessProbe:
httpGet:
path: /health/readiness
port: 9443
scheme: HTTPS
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 4
successThreshold: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 40%
maxSurge: 1