Install CNI - Cilium

In this chapter, we will deploy Cilium CNI

You need to execute these steps only from master node

  • Download the cilium CLI

    CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)
    CLI_ARCH=amd64
    if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
    curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
    sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
    sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
    rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
  • Deploy CNI

    cilium install --version 1.17.0
  • Check the deployment status (It may take 10-15mins depends on your internet speed)

    cilium status --wait
  • Once deployment completes the output will show all in good shape like below.

        /¯¯\
     /¯¯\__/¯¯\    Cilium:             OK
     \__/¯¯\__/    Operator:           OK
     /¯¯\__/¯¯\    Envoy DaemonSet:    OK
     \__/¯¯\__/    Hubble Relay:       disabled
        \__/       ClusterMesh:        disabled
    
    DaemonSet              cilium             Desired: 2, Ready: 2/2, Available: 2/2
    DaemonSet              cilium-envoy       Desired: 2, Ready: 2/2, Available: 2/2
    Deployment             cilium-operator    Desired: 1, Ready: 1/1, Available: 1/1
    Containers:            cilium             Running: 2
                        cilium-envoy       Running: 2
                        cilium-operator    Running: 1
    Cluster Pods:          2/2 managed by Cilium
    Helm chart version:    1.17.0
    Image versions         cilium             quay.io/cilium/cilium:v1.17.0@sha256:51f21bdd003c3975b5aaaf41bd21aee23cc08f44efaa27effc91c621bc9d8b1d: 2
                        cilium-envoy       quay.io/cilium/cilium-envoy:v1.31.5-1737535524-fe8efeb16a7d233bffd05af9ea53599340d3f18e@sha256:57a3aa6355a3223da360395e3a109802867ff635cb852aa0afe03ec7bf04e545: 2
                        cilium-operator    quay.io/cilium/operator-generic:v1.17.0@sha256:1ce5a5a287166fc70b6a5ced3990aaa442496242d1d4930b5a3125e44cccdca8: 1
  • Delete the cilium operator to cleanup transient errors that may get flagged during test

    kubectl delete pods -n kube-system -l name=cilium-operator
  • You can run a connectivity test to verify the kubernetes network health

    cilium connectivity test

    After a while, you should see below output

    ...
    ℹ️  Single-node environment detected, enabling single-node connectivity test
    ℹ️  Monitor aggregation detected, will skip some flow validation steps
    ⌛ [kubernetes] Waiting for deployment cilium-test-1/client to become ready...
    ⌛ [kubernetes] Waiting for deployment cilium-test-1/client2 to become ready...
    ⌛ [kubernetes] Waiting for deployment cilium-test-1/echo-same-node to become ready...
    ⌛ [kubernetes] Waiting for pod cilium-test-1/client-b65598b6f-n99h7 to reach DNS server on cilium-test-1/echo-same-node-5c4dc4674d-7vtmj pod...
    ⌛ [kubernetes] Waiting for pod cilium-test-1/client2-84576868b4-6xjp5 to reach DNS server on cilium-test-1/echo-same-node-5c4dc4674d-7vtmj pod...
    ⌛ [kubernetes] Waiting for pod cilium-test-1/client-b65598b6f-n99h7 to reach default/kubernetes service...
    ⌛ [kubernetes] Waiting for pod cilium-test-1/client2-84576868b4-6xjp5 to reach default/kubernetes service...
    ⌛ [kubernetes] Waiting for Service cilium-test-1/echo-same-node to become ready...
    ⌛ [kubernetes] Waiting for Service cilium-test-1/echo-same-node to be synchronized by Cilium pod kube-system/cilium-vlnmr
    ⌛ [kubernetes] Waiting for NodePort 192.168.0.175:32072 (cilium-test-1/echo-same-node) to become ready...
    ⌛ [kubernetes] Waiting for NodePort 192.168.0.149:32072 (cilium-test-1/echo-same-node) to become ready...
    ..............
    .. redacted..
    ..............
    ✅ [cilium-test-1] All 66 tests (275 actions) successful, 44 tests skipped, 1 scenarios skipped.
  • Now cluster is ready!

    ubuntu@cks-master:~$ kubectl get nodes
    NAME         STATUS   ROLES           AGE   VERSION
    cks-master   Ready    control-plane   32m   v1.31.5
    cks-worker   Ready    <none>          31m   v1.31.5
    ubuntu@cks-master:~$ 

Congratulations on setting up your cluster! Now we can start practicing our topics. See you there.