How to run kube-bench in my cluster? | Как запустить kube-bench в кластере? |
First, you have to exec in Deckhouse Pod: | Вначале необходимо зайти внутрь пода Deckhouse: |
shell kubectl -n d8-system exec -ti deploy/deckhouse – bash | shell kubectl -n d8-system exec -ti deploy/deckhouse – bash |
Then you have to select which node you want to run kube-bench. | Далее необходимо выбрать, на каком узле запустить kube-bench. |
|
|
shell curl -s https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml | kubectl create -f - | shell curl -s https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml | kubectl create -f - |
|
|
shell curl -s https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml | yq r - -j | jq ‘.spec.template.spec.tolerations=[{“operator”: “Exists”}] | .spec.template.spec.nodeSelector={“node-role.kubernetes.io/control-plane”: “”}’ | kubectl create -f - | shell curl -s https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml | yq r - -j | jq ‘.spec.template.spec.tolerations=[{“operator”: “Exists”}] | .spec.template.spec.nodeSelector={“node-role.kubernetes.io/control-plane”: “”}’ | kubectl create -f - |
Then you can check report: | Далее можно проверить результат выполнения: |
shell kubectl logs job.batch/kube-bench | shell kubectl logs job.batch/kube-bench |
How to collect debug info? | Как собрать информацию для отладки? |
We always appreciate helping users with debugging complex issues. Please follow these steps so that we can help you: | Мы всегда рады помочь пользователям с расследованием сложных проблем. Пожалуйста, выполните следующие шаги, чтобы мы смогли вам помочь: |
|
|
sh
kubectl -n d8-system exec deploy/deckhouse -c deckhouse
| sh
kubectl -n d8-system exec deploy/deckhouse -c deckhouse
|
|
|
Data that will be collected:
| Данные, которые будут собраны:
|
How to debug pod problems with ephemeral containers? | Как отлаживать проблемы в подах с помощью ephemeral containers? |
Run the following command: | Выполните следующую команду: |
shell
kubectl -n | shell
kubectl -n |
More info in official documentation. | Подробнее можно почитать в официальной документации. |
How to debug node problems with ephemeral containers? | Как отлаживать проблемы на узлах с помощью ephemeral containers? |
Run the following command: | Выполните следующую команду: |
shell kubectl debug node/mynode -it –image=ubuntu | shell kubectl debug node/mynode -it –image=ubuntu |
More info in official documentation. | Подробнее можно почитать в официальной документации. |