클라우드 배우기
Kubernetes Pod Networking - Centos7 본문
Pod 통신
CNI(Container Network Interface*) 이용 - Weave
*CNI: 컨테이너 기반 오케스트레이션 시스템에서 컨테이너 네트워크를 관리하고 설정하기 위한 표준 인터페이스
yum install -y traceroute
ip address
vi alpine.yml
node1과 node2에 각각 al1과 al2를 생성
apiVersion: v1
kind: Pod
metadata:
name: al1
spec:
containers:
- name: alpine1
image: alpine
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-c", "while true; do sleep 1000; done"]
nodeName: node1
---
apiVersion: v1
kind: Pod
metadata:
name: al2
spec:
containers:
- name: alpine2
image: alpine
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "-c", "while true; do sleep 1000; done"]
nodeName: node2
kubectl apply -f alpine.yml
kubectl exec al1 -it -- bash : Pod 진입하여 node 2와 ping
<참고>
kubectl exec al1 -it -- sh : alpine은 shell만
kubectl exec c1 -it -- sh / kubectl exec c1 -it -- bash : centos는 shell과 bash 둘 다 실행 가능
Master
kubectl exec al1 -it --sh : pod 진입 후, traceroute 실행
traceroute 10.36.0.2 와 traceroute 8.8.8.8 비교
- 10.36.0.2와는 동일 스위치 내 host 간의 통신과 같이 라우팅 경로가 표시되지 않음.
ifconfig 내 ip 확인
route -n 으로 gateway 주소 확인
10번 vxlan 기준으로 그 이전에는 내부적인 연결
pod 내, 25와 if26이 연결된 것을 확인 -> node1 내 26과 if25가 연결이 된 것이 확인 가능
'kubernetes' 카테고리의 다른 글
Kubernetes(K8S): POD 및 Service 구성 (0) | 2023.10.05 |
---|---|
Kubernetes(K8s) Helm + Prometheus stack(Prometheus + Grafana 설치 - Centos7 (0) | 2023.09.23 |
Kubernetes AutoScaling - Centos7 (0) | 2023.09.22 |
Kubernetes(K8S) Ingress - Centos7 (0) | 2023.09.18 |
Kubernetes Storage : Persistent Volume & Claim - Centos7 (0) | 2023.09.17 |