2020-01-06 09:18:25 +00:00
|
|
|
---
|
2019-01-11 18:44:13 +00:00
|
|
|
apiVersion: batch/v1
|
|
|
|
kind: Job
|
|
|
|
metadata:
|
|
|
|
name: kube-bench-node
|
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
|
|
|
hostPID: true
|
|
|
|
containers:
|
2020-01-06 09:18:25 +00:00
|
|
|
- name: kube-bench
|
2022-06-17 15:01:32 +00:00
|
|
|
image: docker.io/aquasec/kube-bench:latest
|
2021-07-07 15:21:30 +00:00
|
|
|
command: ["kube-bench", "run", "--targets", "node"]
|
2020-01-06 09:18:25 +00:00
|
|
|
volumeMounts:
|
2024-02-11 09:23:17 +00:00
|
|
|
- name: var-lib-cni
|
|
|
|
mountPath: /var/lib/cni
|
|
|
|
readOnly: true
|
2021-04-08 14:02:27 +00:00
|
|
|
- name: var-lib-etcd
|
|
|
|
mountPath: /var/lib/etcd
|
|
|
|
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
|
2021-04-08 14:02:27 +00:00
|
|
|
- name: var-lib-kube-scheduler
|
|
|
|
mountPath: /var/lib/kube-scheduler
|
|
|
|
readOnly: true
|
|
|
|
- name: var-lib-kube-controller-manager
|
|
|
|
mountPath: /var/lib/kube-controller-manager
|
|
|
|
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
|
2021-04-08 14:02:27 +00:00
|
|
|
- name: lib-systemd
|
|
|
|
mountPath: /lib/systemd/
|
|
|
|
readOnly: true
|
|
|
|
- name: srv-kubernetes
|
|
|
|
mountPath: /srv/kubernetes/
|
|
|
|
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
|
2021-04-08 14:02:27 +00:00
|
|
|
- name: etc-cni-netd
|
|
|
|
mountPath: /etc/cni/net.d/
|
|
|
|
readOnly: true
|
|
|
|
- name: opt-cni-bin
|
|
|
|
mountPath: /opt/cni/bin/
|
|
|
|
readOnly: true
|
2020-01-06 09:18:25 +00:00
|
|
|
restartPolicy: Never
|
|
|
|
volumes:
|
2024-02-11 09:23:17 +00:00
|
|
|
- name: var-lib-cni
|
|
|
|
hostPath:
|
|
|
|
path: "/var/lib/cni"
|
2021-04-08 14:02:27 +00:00
|
|
|
- name: var-lib-etcd
|
|
|
|
hostPath:
|
|
|
|
path: "/var/lib/etcd"
|
2019-01-11 18:44:13 +00:00
|
|
|
- name: var-lib-kubelet
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/var/lib/kubelet"
|
2021-04-08 14:02:27 +00:00
|
|
|
- name: var-lib-kube-scheduler
|
|
|
|
hostPath:
|
|
|
|
path: "/var/lib/kube-scheduler"
|
|
|
|
- name: var-lib-kube-controller-manager
|
|
|
|
hostPath:
|
|
|
|
path: "/var/lib/kube-controller-manager"
|
2019-01-11 18:44:13 +00:00
|
|
|
- name: etc-systemd
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/etc/systemd"
|
2021-04-08 14:02:27 +00:00
|
|
|
- name: lib-systemd
|
|
|
|
hostPath:
|
|
|
|
path: "/lib/systemd"
|
|
|
|
- name: srv-kubernetes
|
|
|
|
hostPath:
|
|
|
|
path: "/srv/kubernetes"
|
2019-01-11 18:44:13 +00:00
|
|
|
- name: etc-kubernetes
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/etc/kubernetes"
|
2019-01-11 18:44:13 +00:00
|
|
|
- name: usr-bin
|
2020-01-06 09:18:25 +00:00
|
|
|
hostPath:
|
|
|
|
path: "/usr/bin"
|
2021-04-08 14:02:27 +00:00
|
|
|
- name: etc-cni-netd
|
|
|
|
hostPath:
|
|
|
|
path: "/etc/cni/net.d/"
|
|
|
|
- name: opt-cni-bin
|
|
|
|
hostPath:
|
|
|
|
path: "/opt/cni/bin/"
|