2020-06-05 13:42:53 -07:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: kyverno
|
2021-06-01 21:58:37 -07:00
|
|
|
# do not remove
|
|
|
|
app.kubernetes.io/name: kyverno
|
2021-06-01 20:54:33 +02:00
|
|
|
name: kyverno
|
2020-06-05 13:42:53 -07:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: kyverno
|
2021-06-01 21:58:37 -07:00
|
|
|
# do not remove
|
|
|
|
app.kubernetes.io/name: kyverno
|
2020-06-05 13:42:53 -07:00
|
|
|
replicas: 1
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: kyverno
|
2021-06-01 21:58:37 -07:00
|
|
|
# do not remove
|
|
|
|
app.kubernetes.io/name: kyverno
|
2020-06-05 13:42:53 -07:00
|
|
|
spec:
|
2021-09-20 15:52:46 +05:30
|
|
|
affinity:
|
|
|
|
podAntiAffinity:
|
2021-09-29 02:30:49 +05:30
|
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
|
|
- weight: 1
|
|
|
|
podAffinityTerm:
|
|
|
|
labelSelector:
|
|
|
|
matchExpressions:
|
|
|
|
- key: app.kubernetes.io/name
|
|
|
|
operator: In
|
|
|
|
values:
|
|
|
|
- kyverno
|
|
|
|
topologyKey: "kubernetes.io/hostname"
|
2020-06-05 13:42:53 -07:00
|
|
|
serviceAccountName: kyverno-service-account
|
2020-10-22 11:26:22 -07:00
|
|
|
securityContext:
|
|
|
|
runAsNonRoot: true
|
2020-06-05 13:42:53 -07:00
|
|
|
initContainers:
|
|
|
|
- name: kyverno-pre
|
2020-11-24 11:49:08 -08:00
|
|
|
image: ghcr.io/kyverno/kyvernopre:latest
|
2021-02-08 18:15:28 -08:00
|
|
|
imagePullPolicy: IfNotPresent
|
2021-05-07 18:53:00 +02:00
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: 100m
|
|
|
|
memory: 256Mi
|
|
|
|
requests:
|
|
|
|
cpu: 10m
|
|
|
|
memory: 64Mi
|
2020-10-22 11:26:22 -07:00
|
|
|
securityContext:
|
|
|
|
runAsNonRoot: true
|
|
|
|
privileged: false
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
capabilities:
|
|
|
|
drop:
|
|
|
|
- all
|
2021-09-11 03:09:12 +05:30
|
|
|
env:
|
|
|
|
- name: METRICS_CONFIG
|
|
|
|
value: kyverno-metrics
|
2021-10-07 13:50:30 -07:00
|
|
|
- name: KYVERNO_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
2020-06-05 13:42:53 -07:00
|
|
|
containers:
|
|
|
|
- name: kyverno
|
2020-11-24 11:49:08 -08:00
|
|
|
image: ghcr.io/kyverno/kyverno:latest
|
2021-02-08 18:15:28 -08:00
|
|
|
imagePullPolicy: IfNotPresent
|
2020-06-05 13:42:53 -07:00
|
|
|
args:
|
2021-01-07 11:27:50 -08:00
|
|
|
- "--filterK8sResources=[Event,*,*][*,kube-system,*][*,kube-public,*][*,kube-node-lease,*][Node,*,*][APIService,*,*][TokenReview,*,*][SubjectAccessReview,*,*][*,kyverno,*][Binding,*,*][ReplicaSet,*,*][ReportChangeRequest,*,*][ClusterReportChangeRequest,*,*][PolicyReport,*,*][ClusterPolicyReport,*,*]"
|
2020-08-07 17:09:24 -07:00
|
|
|
# customize webhook timeout
|
2021-10-06 23:02:48 +05:30
|
|
|
#- "--webhookTimeout=4"
|
2020-08-07 17:09:24 -07:00
|
|
|
# enable profiling
|
|
|
|
# - "--profile"
|
2021-03-22 19:19:12 -07:00
|
|
|
# configure the workers for generate controller
|
2021-10-06 23:02:48 +05:30
|
|
|
# - --genWorkers=20
|
2020-08-07 17:09:24 -07:00
|
|
|
- "-v=2"
|
2020-06-05 13:42:53 -07:00
|
|
|
ports:
|
2020-10-22 11:26:22 -07:00
|
|
|
- containerPort: 9443
|
|
|
|
name: https
|
|
|
|
protocol: TCP
|
2021-05-16 13:22:21 +05:30
|
|
|
- containerPort: 8000
|
|
|
|
name: metrics-port
|
|
|
|
protocol: TCP
|
2020-06-05 13:42:53 -07:00
|
|
|
env:
|
2020-08-05 23:26:31 -07:00
|
|
|
- name: INIT_CONFIG
|
2022-01-07 16:22:34 +05:30
|
|
|
value: kyverno
|
2021-09-11 03:09:12 +05:30
|
|
|
- name: METRICS_CONFIG
|
|
|
|
value: kyverno-metrics
|
2020-08-05 23:26:31 -07:00
|
|
|
- name: KYVERNO_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
|
|
|
- name: KYVERNO_SVC
|
|
|
|
value: kyverno-svc
|
2020-10-22 11:26:22 -07:00
|
|
|
securityContext:
|
|
|
|
runAsNonRoot: true
|
|
|
|
privileged: false
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
capabilities:
|
|
|
|
drop:
|
|
|
|
- all
|
2020-06-05 13:42:53 -07:00
|
|
|
resources:
|
|
|
|
requests:
|
2021-12-21 15:11:28 +08:00
|
|
|
memory: 128Mi
|
|
|
|
cpu: 100m
|
2020-06-05 13:42:53 -07:00
|
|
|
limits:
|
2021-12-21 15:11:28 +08:00
|
|
|
memory: 384Mi
|
2020-06-05 13:42:53 -07:00
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /health/liveness
|
2020-10-22 12:48:04 -07:00
|
|
|
port: 9443
|
2020-06-05 13:42:53 -07:00
|
|
|
scheme: HTTPS
|
2021-09-11 03:09:12 +05:30
|
|
|
initialDelaySeconds: 15
|
2021-03-31 15:44:56 -04:00
|
|
|
periodSeconds: 30
|
2020-06-05 13:42:53 -07:00
|
|
|
timeoutSeconds: 5
|
2021-03-31 15:44:56 -04:00
|
|
|
failureThreshold: 2
|
2020-06-05 13:42:53 -07:00
|
|
|
successThreshold: 1
|
|
|
|
readinessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /health/readiness
|
2020-10-22 12:48:04 -07:00
|
|
|
port: 9443
|
2020-06-05 13:42:53 -07:00
|
|
|
scheme: HTTPS
|
|
|
|
initialDelaySeconds: 5
|
|
|
|
periodSeconds: 10
|
|
|
|
timeoutSeconds: 5
|
|
|
|
failureThreshold: 4
|
2020-08-07 17:09:24 -07:00
|
|
|
successThreshold: 1
|
2021-08-18 15:49:35 +05:30
|
|
|
strategy:
|
|
|
|
type: RollingUpdate
|
|
|
|
rollingUpdate:
|
|
|
|
maxUnavailable: 40%
|
|
|
|
maxSurge: 1
|