multus

by joaquinito2051

Helm chartv0.1.1App v4.2.4

A Helm chart for Multus CNI - Meta CNI plugin for attaching multiple network interfaces to pods

About this chart

Multus CNI

A Helm chart for Multus CNI - Meta CNI plugin for attaching multiple network interfaces to pods.

Homepage: https://github.com/k8snetworkplumbingwg/multus-cni

TL;DR;

# Install Multus
helm install my-multus ./stable/multus --namespace kube-system

Introduction

Multus CNI is a container network interface (CNI) plugin for Kubernetes that enables attaching multiple network interfaces to pods. It acts as a "meta" plugin that can call other CNI plugins to configure additional network interfaces.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.0+
  • A primary CNI plugin (e.g., Calico, Cilium) already installed
  • Note: CRDs are automatically installed by Helm Chart API v2

Installing the Chart

Step 1: Install Multus

helm install my-multus ./stable/multus --namespace kube-system

Step 2: Configure Primary CNI Detection

Set the readiness indicator file for your primary CNI:

# For Cilium
helm upgrade my-multus ./stable/multus --set daemonConfig.readinessIndicatorFile="/run/cilium/cilium.sock"

# For Calico
helm upgrade my-multus ./stable/multus --set daemonConfig.readinessIndicatorFile="/run/calico/calico.sock"

Uninstalling the Chart

helm delete my-multus
# Note: CRDs are not automatically removed

Configuration

ParameterDescriptionDefault
image.repositoryMultus image repositoryghcr.io/k8snetworkplumbingwg/multus-cni
image.tagMultus image tag (overrides suffix)"" (uses Chart.AppVersion + suffix)
image.suffixOptional suffix for image tag"-thick"
image.pullPolicyImage pull policyIfNotPresent
imagePullSecretsImage pull secrets[]
serviceAccount.createCreate service accounttrue
serviceAccount.nameService account namemultus
serviceAccount.annotationsService account annotations{}
rbac.createCreate RBAC resourcestrue
podSecurityContext.privilegedPod security contexttrue
securityContext.privilegedContainer security contexttrue
securityContext.capabilities.addAdditional capabilities[NET_ADMIN, SYS_ADMIN]
priorityClassNamePriority class namesystem-node-critical
hostNetworkEnable host network for podstrue
hostPIDEnable host PID namespace for podstrue
terminationGracePeriodSecondsGrace period for pod termination10
updateStrategy.typeUpdate strategyRollingUpdate
updateStrategy.rollingUpdate.maxUnavailableMax unavailable pods1
tolerationsPod tolerations[{"operator": "Exists", "effect": "NoSchedule"}, {"operator": "Exists", "effect": "NoExecute"}]
nodeSelectorNode selector{}
affinityPod affinity{}
podAnnotationsPod annotations{}
podLabelsPod labels{}
resources.limits.cpuCPU limit100m
resources.limits.memoryMemory limit128Mi
resources.requests.cpuCPU request100m
resources.requests.memoryMemory request128Mi
daemonConfig.chrootDirChroot directory/hostroot
daemonConfig.cniVersionCNI version0.3.1
daemonConfig.logLevelLog levelverbose
daemonConfig.logToStderrLog to stderrtrue
daemonConfig.readinessIndicatorFileReadiness indicator file"" (must be set)
daemonConfig.cniConfigDirCNI config directory/host/etc/cni/net.d
daemonConfig.multusAutoconfigDirMultus autoconfig directory/host/etc/cni/net.d
daemonConfig.multusConfigFileMultus config fileauto
daemonConfig.socketDirSocket directory/host/run/multus/

Dynamic Configuration

This chart supports dynamic configuration based on the primary CNI provider:

Image Tag Configuration

The image tag follows this priority order:

  1. Explicit tag (highest priority):

    • Set image.tag to override everything
    image:
      tag: "v4.2.4-custom"
    
  2. Base version with suffix (default):

    • Uses Chart.AppVersion + image.suffix
    • Default: v4.2.4-thick
    image:
      tag: ""  # Empty
      suffix: "-thick"  # Results in: v4.2.4-thick
    
  3. Base version with different suffix:

    • Override the default suffix
    image:
      tag: ""  # Empty
      suffix: "-thin"  # Results in: v4.2.4-thin
    
  4. Base version without suffix:

    • Set image.suffix="" to use only Chart.AppVersion
    image:
      tag: ""  # Empty
      suffix: ""  # Results in: v4.2.4
    

For Cilium as Primary CNI:

daemonConfig:
  readinessIndicatorFile: "/run/cilium/cilium.sock"

For Calico as Primary CNI:

daemonConfig:
  readinessIndicatorFile: "/run/calico/calico.sock"

Usage

Multus works by delegating to other CNI plugins. After installation, create NetworkAttachmentDefinition resources to define additional networks:

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: macvlan-conf
  namespace: default
spec:
  config: '{
    "cniVersion": "0.3.1",
    "type": "macvlan",
    "master": "eth0",
    "mode": "bridge",
    "ipam": {
      "type": "host-local",
      "subnet": "192.168.1.0/24"
    }
  }'

Then annotate your pods to use additional networks:

metadata:
  annotations:
    k8s.v1.cni.cncf.io/networks: macvlan-conf

Troubleshooting

CRD Verification

Check if CRDs are installed:

kubectl get crd network-attachment-definitions.k8s.cni.cncf.io

Primary CNI Not Detected

Ensure daemonConfig.readinessIndicatorFile is set to the correct socket path for your primary CNI.

Pod Security Policy Errors

This chart requires privileged containers. Ensure your cluster's Pod Security Policy or Pod Security Standards allow privileged containers for the kube-system namespace.

License

Copyright 2024 Nutanix. All rights reserved. SPDX-License-Identifier: Apache-2.0

Deploy multus with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has multus on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmultus is pinned at v0.1.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply