-
Notifications
You must be signed in to change notification settings - Fork 43
/
kube-bench-plugin.yaml
86 lines (86 loc) · 2.34 KB
/
kube-bench-plugin.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
podSpec:
containers: []
dnsPolicy: ClusterFirstWithHostNet
hostIPC: true
hostNetwork: true
hostPID: true
serviceAccountName: sonobuoy-serviceaccount
tolerations:
- operator: Exists
volumes:
- name: var-lib-etcd
hostPath:
path: "/var/lib/etcd"
- name: var-lib-kubelet
hostPath:
path: "/var/lib/kubelet"
- name: lib-systemd
hostPath:
path: "/lib/systemd"
- name: etc-systemd
hostPath:
path: "/etc/systemd"
- name: etc-kubernetes
hostPath:
path: "/etc/kubernetes"
# Uncomment this volume definition if you wish to use Kubernetes version auto-detection in kube-bench.
# - name: usr-bin
# hostPath:
# path: "/usr/bin"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: DoesNotExist
sonobuoy-config:
driver: DaemonSet
plugin-name: kube-bench-node
result-format: junit
spec:
command:
- /bin/sh
args:
- -c
- /run-kube-bench.sh; while true; do echo "Sleeping for 1h to avoid daemonset restart"; /bin/sleep 3600; done
env:
- name: KUBERNETES_VERSION
value: "1.19"
- name: TARGET_MASTER
value: "false"
- name: TARGET_NODE
value: "true"
- name: TARGET_CONTROLPLANE
value: "false"
- name: TARGET_ETCD
value: "false"
- name: TARGET_POLICIES
value: "false"
image: sonobuoy/kube-bench:v0.8.0
name: plugin
resources: {}
volumeMounts:
- mountPath: /tmp/sonobuoy/results
name: results
- name: var-lib-etcd
mountPath: /var/lib/etcd
readOnly: true
- name: var-lib-kubelet
mountPath: /var/lib/kubelet
readOnly: true
- name: lib-systemd
mountPath: /lib/systemd
readOnly: true
- name: etc-systemd
mountPath: /etc/systemd
readOnly: true
- name: etc-kubernetes
mountPath: /etc/kubernetes
readOnly: true
# /usr/bin is mounted to access kubectl / kubelet, used by kube-bench for auto-detecting the Kubernetes version.
# It is mounted at the path /usr/local/mount-from-host/bin to avoid overwriting /usr/bin within the container.
# You can omit this mount if you provide the version using the KUBERNETES_VERSION environment variable.
# - name: usr-bin
# mountPath: /usr/local/mount-from-host/bin
# readOnly: true