2020-01-06 09:18:25 +00:00
|
|
|
---
|
2019-03-07 17:02:43 +00:00
|
|
|
apiVersion: batch/v1
|
|
|
|
kind: Job
|
|
|
|
metadata:
|
|
|
|
name: kube-bench
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: kube-bench
|
|
|
|
spec:
|
|
|
|
hostPID: true
|
|
|
|
containers:
|
2020-01-06 09:18:25 +00:00
|
|
|
- name: kube-bench
|
|
|
|
image: aquasec/kube-bench:latest
|
|
|
|
command: ["kube-bench"]
|
|
|
|
volumeMounts:
|
|
|
|
- name: var-lib-etcd
|
|
|
|
mountPath: /var/lib/etcd
|
2020-01-28 15:45:31 +00:00
|
|
|
readOnly: true
|
2020-01-06 09:18:25 +00:00
|
|
|
- name: var-lib-kubelet
|
|
|
|
mountPath: /var/lib/kubelet
|
2020-01-28 15:45:31 +00:00
|
|
|
readOnly: true
|
2020-01-06 09:18:25 +00:00
|
|
|
- name: etc-systemd
|
|
|
|
mountPath: /etc/systemd
|
2020-01-28 15:45:31 +00:00
|
|
|
readOnly: true
|
2020-01-06 09:18:25 +00:00
|
|
|
- name: etc-kubernetes
|
|
|
|
mountPath: /etc/kubernetes
|
2020-01-28 15:45:31 +00:00
|
|
|
readOnly: true
|
2020-02-12 17:18:44 +00:00
|
|
|
# /usr/local/mount-from-host/bin is mounted to access kubectl / kubelet, for auto-detecting the Kubernetes version.
|
2020-01-06 09:18:25 +00:00
|
|
|
# You can omit this mount if you specify --version as part of the command.
|
|
|
|
- name: usr-bin
|
2020-02-12 17:18:44 +00:00
|
|
|
mountPath: /usr/local/mount-from-host/bin
|
2020-01-28 15:45:31 +00:00
|
|
|
readOnly: true
|
2020-01-06 09:18:25 +00:00
|
|
|
restartPolicy: Never
|
|
|
|
volumes:
|
2019-03-07 17:02:43 +00:00
|
|
|
- name: var-lib-etcd
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/var/lib/etcd"
|
2019-03-07 17:02:43 +00:00
|
|
|
- name: var-lib-kubelet
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/var/lib/kubelet"
|
2019-03-07 17:02:43 +00:00
|
|
|
- name: etc-systemd
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/etc/systemd"
|
2019-03-07 17:02:43 +00:00
|
|
|
- name: etc-kubernetes
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/etc/kubernetes"
|
2019-03-07 17:02:43 +00:00
|
|
|
- name: usr-bin
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/usr/bin"
|