본문 바로가기
IT 잡지식/DevOps

[CKA] KodeKloud - Networking Weave

by 쯀리♥️ 2024. 8. 10.

안녕하세요, 쯀리입니다.

오늘은 Weave Net에 대해 배워보겠습니다. 

https://kubernetes.io/docs/tasks/administer-cluster/network-policy-provider/weave-network-policy/

 

Weave Net for NetworkPolicy

This page shows how to use Weave Net for NetworkPolicy. Before you begin You need to have a Kubernetes cluster. Follow the kubeadm getting started guide to bootstrap one. Install the Weave Net addon Follow the Integrating Kubernetes via the Addon guide. Th

kubernetes.io

 


 

Weave Net이란?

"Weave Net"은 Kubernetes 환경에서 컨테이너 간의 네트워크 통신을 제공하는 CNI(Container Network Interface) 플러그인 중에 하나입니다. Weave Net을 배울 때 주로 다루는 내용은 Kubernetes 클러스터에서 Weave Net을 사용하여 네트워크를 설정하고 관리하는 방법입니다.


Quiz

1. How many Nodes are part of this cluster?
Including master and worker nodes

controlplane ~ ➜  k get node
NAME           STATUS   ROLES           AGE   VERSION
controlplane   Ready    control-plane   87m   v1.30.0
node01         Ready    <none>          86m   v1.30.0

 

2. What is the Networking Solution used by this cluster?

controlplane ~ ➜  kubectl get pods -n kube-system
NAME                                   READY   STATUS    RESTARTS      AGE
coredns-768b85b76f-kphj8               1/1     Running   0             88m
coredns-768b85b76f-qjjxf               1/1     Running   0             88m
etcd-controlplane                      1/1     Running   0             88m
kube-apiserver-controlplane            1/1     Running   0             88m
kube-controller-manager-controlplane   1/1     Running   0             88m
kube-proxy-lrcfb                       1/1     Running   0             88m
kube-proxy-vv8df                       1/1     Running   0             87m
kube-scheduler-controlplane            1/1     Running   0             88m
weave-net-bb42h                        2/2     Running   1 (87m ago)   88m
weave-net-vj67r                        2/2     Running   0             87m

weave가 설치되어있는것을 알 수 있습니다. 

3. How many weave agents/peers are deployed in this cluster?

weave-net-bb42h                        2/2     Running   1 (87m ago)   87m   192.5.90.3   controlplane   <none>           <none>
weave-net-vj67r                        2/2     Running   0             87m   192.5.90.6   node01         <none>

 

4. On which nodes are the weave peers present?

"peer"는 Weave Net 네트워크의 각 노드를 지칭합니다. 각 노드는 다른 노드와 연결되어 "peer" 관계를 형성하며, 이를 통해 네트워크 트래픽이 전달됩니다.

정답 :  One on every node

5. Identify the name of the bridge network/interface created by weave on each node.

controlplane ~ ➜  ip link
...

4: weave: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether c6:d0:00:56:99:50 brd ff:ff:ff:ff:ff:ff
...

 

6. What is the POD IP address range configured by weave?

controlplane ~ ➜  ifconfig
..
weave: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1376
        inet 10.244.0.1  netmask 255.255.0.0  broadcast 10.244.255.255
        ether c6:d0:00:56:99:50  txqueuelen 1000  (Ethernet)
        RX packets 13325  bytes 1072228 (1.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13668  bytes 1298876 (1.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        

# 또는 
controlplane ~ ➜  ip addr show weave
4: weave: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue state UP group default qlen 1000
    link/ether c6:d0:00:56:99:50 brd ff:ff:ff:ff:ff:ff
    inet 10.244.0.1/16 brd 10.244.255.255 scope global weave
       valid_lft forever preferred_lft forever

inet은 10.대로시작되고 brd 도 동일합니다.

7. What is the default gateway configured on the PODs scheduled on node01?
Try scheduling a pod on node01 and check ip route output

controlplane ~ ➜  ssh node01


node01 ~ ➜  ip route
default via 172.25.0.1 dev eth1 
10.244.0.0/16 dev weave proto kernel scope link src 10.244.192.0 
172.25.0.0/24 dev eth1 proto kernel scope link src 172.25.0.12 
192.5.90.0/24 dev eth0 proto kernel scope link src 192.5.90.6

정답 : 10.244.192.0


Weave net은 대체로 대규모 클러스터 환경에서 사용되며 확장성을 관리합니다. 
Weave Net은 설치와 구성이 간단하여 Kubernetes 클러스터에 네트워크를 빠르게 설정하는데 용이합니다. 

네트워크 설정에 복잡성이 낮고, 안정적이며, 보안이 중요한 경우 Weave Net은 좋은 선택이 될 수 있습니다.


참조

 Udemy Labs - Certified Kubernetes Administrator with Practice Tests

'IT 잡지식 > DevOps' 카테고리의 다른 글

[CKA] KodeKloud - CoreDNS in Kubernetes  (0) 2024.08.15
[CKA] KodeKloud - Service Networking  (0) 2024.08.10
[CKA] KodeKloud - Deploy Network Solution  (0) 2024.08.08
[CKA] KodeKloud - CNI  (0) 2024.08.08
[CKA] KodeKloud - Explore Environment  (0) 2024.08.08