ในการเชื่อมต่อผ่าน network ของ pod ภายใน cluster มีหลายตัวเลือกให้เลือกใช้ ในเอกสารนี้เลือก weave เป็นตัวอย่างในการติดตั้ง ซี่งต้องทำงานร่วมกัน Container Network Interface (CNI)
wget https://github.com/containernetworking/plugins/releases/download/v0.8.7/cni-plugins-linux-amd64-v0.8.7.tgz
tar xvfz cni-plugins-linux-amd64-v0.8.7.tgz --directory /opt/cni/bin
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
kubectl get pods -n kube-system
ผลการทดสอบ
NAME READY STATUS RESTARTS AGE
weave-net-c8wgm 1/2 Running 0 35s
weave-net-lxwpn 1/2 Running 0 35s
จะพบว่ามี pod ที่ชื่อว่า weave-net-xxxxx ที่มีสถานะ Running ทำงานอยู่
kubectl get nodes
ผลการทดสอบ
NAME STATUS ROLES AGE VERSION
node0 Ready <none> 14m v1.19.0
node1 Ready <none> 11m v1.19.0