k8s拾遗 - 网络调试工具busybox

10,054 阅读1分钟

busybox是一个不错的选择。它提及非常小,并且包含了nslookup,ping,wget等网络处理命令。略微遗憾这里没有包含curl

编辑busybox.yaml如下

apiVersion: v1
kind: Pod
metadata:
  name: busybox
  namespace: default
spec:
  containers:
  - name: busybox
    image: busybox:1.28.4
    command:
      - sleep
      - "3600"
    imagePullPolicy: IfNotPresent
  restartPolicy: Always

启动这个pod: kubectl create -f busybox.yaml

跳到这个容器肚子里:kubectl exec -it busybox sh

> 注意: 不要使用busybox:latest,最高版本的nslookup工具有bug。