Skip to content

Instantly share code, notes, and snippets.

@seanb4t
Forked from janeczku/01-multus-k3s.md
Created December 9, 2021 01:04
Show Gist options
  • Save seanb4t/4f02a3d988a767bba253273de471b97b to your computer and use it in GitHub Desktop.
Save seanb4t/4f02a3d988a767bba253273de471b97b to your computer and use it in GitHub Desktop.

Revisions

  1. @janeczku janeczku revised this gist Dec 1, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 03-external.md
    Original file line number Diff line number Diff line change
    @@ -3,3 +3,4 @@
    - https://medium.com/@sarpkoksal/multus-installation-on-kubernetes-a0a6ef04972f
    - https://github.com/k8snetworkplumbingwg/reference-deployment/blob/a3b4d3066ac0e130deee7d20fa02a72d67e9e683/multus-calico/multus-crio-daemonset.yml
    - https://github.com/rancher/kontainer-driver-metadata/blob/497e5d720660bf9c8dc7ab0c7b44ee6daca28534/rke/templates/calico.go
    - https://github.com/rancher/rke/issues/873#issuecomment-420457017
  2. @janeczku janeczku revised this gist Dec 1, 2020. 2 changed files with 10 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions 02-multus-rke.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,11 @@ RKE cluster.yaml:
    ...
    network:
    plugin: none
    services:
    kubelet:
    extra_args:
    cni-conf-dir: "/etc/cni/net.d"
    cni-bin-dir: "/opt/cni/bin"
    ...
    ```

    5 changes: 5 additions & 0 deletions 03-external.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    - https://github.com/intel/multus-cni/issues/539
    - https://github.com/kubernetes-sigs/kubespray/blob/master/docs/multus.md
    - https://medium.com/@sarpkoksal/multus-installation-on-kubernetes-a0a6ef04972f
    - https://github.com/k8snetworkplumbingwg/reference-deployment/blob/a3b4d3066ac0e130deee7d20fa02a72d67e9e683/multus-calico/multus-crio-daemonset.yml
    - https://github.com/rancher/kontainer-driver-metadata/blob/497e5d720660bf9c8dc7ab0c7b44ee6daca28534/rke/templates/calico.go
  3. @janeczku janeczku revised this gist Nov 13, 2020. No changes.
  4. @janeczku janeczku revised this gist Nov 13, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 02-multus-rke.md
    Original file line number Diff line number Diff line change
    @@ -18,3 +18,4 @@ Use the following Helm chart for conveniance:
    https://github.com/ibrokethecloud/multus-helm

    https://github.com/ibrokethecloud/cni-plugins
    https://ubuntu.com/kubernetes/docs/cni-sriov
  5. @janeczku janeczku revised this gist Nov 13, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 02-multus-rke.md
    Original file line number Diff line number Diff line change
    @@ -17,4 +17,4 @@ Use the following Helm chart for conveniance:

    https://github.com/ibrokethecloud/multus-helm

    https://github.com/ibrokethecloud/cni-plugins
    https://github.com/ibrokethecloud/cni-plugins
  6. @janeczku janeczku revised this gist Nov 13, 2020. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  7. @janeczku janeczku created this gist Nov 13, 2020.
    20 changes: 20 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # Using Multus CNI in RKE

    1. Provision RKE cluster with automatic CNI deployment disabled

    RKE cluster.yaml:

    ```
    ...
    network:
    plugin: none
    ...
    ```

    2. Install Multus

    Use the following Helm chart for conveniance:

    https://github.com/ibrokethecloud/multus-helm

    https://github.com/ibrokethecloud/cni-plugins
    30 changes: 30 additions & 0 deletions multus-k3s.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # Using Multus CNI in K3S

    By default, K3S will run with flannel as the CNI and use custom directories to store CNI plugin binaries and config files(You can inspect the kubelet args K3S uses via `journalctl -u k3s|grep cni-conf-dir`).
    So you need to configure that properly When deploying Multus CNI.

    For example given the official Multus manifests in `https://github.com/intel/multus-cni/blob/36f2fd64e0965e639a0f1d17ab754f0130951aba/images/multus-daemonset.yml`, the following changes are needed:

    ```yaml
    volumes:
    - name: cni
    hostPath:
    path: /var/lib/rancher/k3s/agent/etc/cni/net.d
    - name: cnibin
    hostPath:
    path: /var/lib/rancher/k3s/data/<replace-with-your-hash>/bin
    ```
    ```yaml
    containers:
    - name: kube-multus
    image: nfvpe/multus:v3.4.1
    command: ["/entrypoint.sh"]
    args:
    - "--multus-conf-file=auto"
    - "--cni-version=0.3.1"
    # Add the following arg
    - "--multus-kubeconfig-file-host=/var/lib/rancher/k3s/agent/etc/cni/net.d/multus.d/multus.kubeconfig"
    ```
    Once Multus CNI is deployed properly it works as normal in K3S.