我想开始为 Kuberntes 项目开发。我想调试master和worker之间的网络。
目前他们正在使用 x509 证书进行 SSL 通信,我需要查看此通信。
我在带有 kubeadm 和 weave 网络插件的 linux 机器上安装了 Kubernetes 集群,我现在想禁用 SSL 网络以查看它们之间的所有流量。
我尝试了此答案中描述的步骤,并且:
- 已从
--insecure-port=0
_/etc/kubernetes/manifests/kube-apiserver.yaml
- 添加
--insecure-bind-address=0.0.0.0
到/etc/kubernetes/manifests/kube-controller-manager.yaml
和/etc/kubernetes/manifests/kube-scheduler.yaml
- 重启 kubelet
service kubelet restart
我创建了新的部署:kubectl run nginx --image nginx
在主服务器和我运行的工作人员中tcpdump -i ens3 -w ./traffic.pcap
。
部署未能运行。
我检查了 kubelet 日志journalctl -u kubelet
:
Apr 01 12:16:57 master kubelet[10614]: E0401 12:16:57.238125 10614 pod_workers.go:190] Error syncing pod 26ead5e19e83a1d9426b732dc183b75d ("kube-controller-manager-master_kube-system(26ead5e19e83a1d9426b732dc183b75d)"), skipping: failed to "StartContainer" for "kube-controller-manager" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=kube-controller-manager pod=kube-controller-manager-master_kube-system(26ead5e19e83a1d9426b732dc183b75d)"
Apr 01 12:16:59 master kubelet[10614]: E0401 12:16:59.238970 10614 pod_workers.go:190] Error syncing pod 448824ad8c321fa307186a36765b0ee4 ("kube-scheduler-master_kube-system(448824ad8c321fa307186a36765b0ee4)"), skipping: failed to "StartContainer" for "kube-scheduler" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=kube-scheduler pod=kube-scheduler-master_kube-system(448824ad8c321fa307186a36765b0ee4)"
如何禁用 Kubernetes SSL 通信并对其进行调试以进行开发?