Raven

    Suppose you have an edge kubernetes cluster with nodes in different physical regions, and already deploy the in this cluster, the details of Raven Controller Manager are in here.

    We use a CR to manage nodes in different physical regions, and label nodes to indicate which Gateway these nodes are managed by.

    1. $ kubectl label nodes hhht-node1 hhht-node2 raven.openyurt.io/gateway=gw-hhht
    2. hhht-node1 labeled
    3. hhht-node2 labeled

    Similarly, we label node in cloud with value gw-cloud, and nodes in region cn-wulanchabu with value gw-wlcb.

    1. $ kubectl label nodes master raven.openyurt.io/gateway=gw-cloud
    2. master labeled
    1. git clone https://github.com/openyurtio/raven.git
    2. cd raven
    3. make deploy
    1. $ kubectl get pod -n kube-system | grep raven-agent-ds
    2. raven-agent-ds-2jw47 1/1 Running 0 91s
    3. raven-agent-ds-bq8zc 1/1 Running 0 91s
    4. raven-agent-ds-cj7k4 1/1 Running 0 91s
    5. raven-agent-ds-rlb9q 1/1 Running 0 91s

    How to Use

    • create gateways
    • Get gateways
    1. $ kubectl get gateways
    2. NAME ACTIVEENDPOINT
    3. gw-hhht hhht-node1
    4. gw-master master
    5. gw-wlcb wlcb-node1
    • Create test pod
    1. $ cat <<EOF | kubectl apply -f -
    2. apiVersion: v1
    3. kind: Pod
    4. metadata:
    5. name: fedora-1
    6. spec:
    7. nodeName: hhht-node2
    8. containers:
    9. - name: fedora
    10. image: njucjc/fedora:latest
    11. imagePullPolicy: Always
    12. ---
    13. apiVersion: v1
    14. metadata:
    15. spec:
    16. nodeName: wlcb-node2
    17. containers:
    18. - name: fedora
    19. image: njucjc/fedora:latest
    20. imagePullPolicy: Always
    21. EOF
    • Get test pod
    • Test networking across edge
    1. $ kubectl exec -it fedora-1 -- bash
    2. [root@fedora-1]# ping 10.14.2.70 -c 4
    3. PING 10.14.2.70 (10.14.2.70) 56(84) bytes of data.
    4. 64 bytes from 10.14.2.70: icmp_seq=1 ttl=60 time=32.2 ms
    5. 64 bytes from 10.14.2.70: icmp_seq=2 ttl=60 time=32.2 ms
    6. 64 bytes from 10.14.2.70: icmp_seq=3 ttl=60 time=32.0 ms
    7. 64 bytes from 10.14.2.70: icmp_seq=4 ttl=60 time=32.1 ms
    8. --- 10.14.2.70 ping statistics ---
    9. 4 packets transmitted, 4 received, 0% packet loss, time 3003ms
    10. rtt min/avg/max/mdev = 32.047/32.136/32.246/0.081 ms