Skip to content

Latest commit

 

History

History
84 lines (69 loc) · 3.28 KB

kind.md

File metadata and controls

84 lines (69 loc) · 3.28 KB

Deploying Antrea on a Kind cluster

At the moment Kind is only supported on Linux hosts. We are working on supporting macOS hosts as well.

Create a Kind cluster and deploy Antrea in a few seconds

Create a Kind cluster

The only requirement is to use a Kind configuration file which disables the Kubernetes default CNI (kubenet). For example, your configuration file may look like this:

kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
networking:
  disableDefaultCNI: true
  podSubnet: 10.10.0.0/16
nodes:
- role: control-plane
- role: worker
- role: worker

Once you have created your configuration file (let's call it kind-config.yml), create your cluster with:

kind create cluster --config kind-config.yml

Deploy Antrea to your Kind cluster

These instructions assume that you have built the antrea/antrea-ubuntu Docker image locally (e.g. by running make from the root of the repository).

# "fix" the host's veth interfaces (for the different Kind Nodes)
kind get nodes | xargs ./hack/kind-linux.sh
# load the Antrea Docker image in the Nodes
kind load docker-image antrea/antrea-ubuntu:latest
# deploy Antrea
./hack/generate-manifest.sh --kind | kubectl apply -f -

Check that everything is working

After a few seconds you should be able to observe the following when running kubectl get -n kube-system pods -l app=antrea:

NAME                                 READY   STATUS    RESTARTS   AGE
antrea-agent-dgsfs                   2/2     Running   0          8m56s
antrea-agent-nzsmx                   2/2     Running   0          8m56s
antrea-agent-zsztq                   2/2     Running   0          8m56s
antrea-controller-775f4d79f8-6tksp   1/1     Running   0          8m56s

FAQ

Why is the YAML manifest different when using Kind?

By default Antrea uses the Open vSwitch (OVS) kernel datapath type to provide connectivity between Pods, and each Kubernetes Node runs its own datapath (named br-int by default). Because of the very nature of Kind (which uses containers to run Kubernetes Nodes), it is not possible to use the kernel datapath type for Kind clusters. Instead, we use OVS in userspace mode, which requires some changes to the way Antrea is deployed. Most notably:

  • the tun device driver needs to be mounted in the antrea-ovs container
  • the Antrea agent's ConfigMap needs to be updated so that the userspace (netdev) OVS datapath type is used
  • the Antrea agent's Init Container no longer needs to load the openvswitch kernel module
  • the start_ovs script used by the antrea-ovs container needs to be replaced with the start_ovs_netdev script, which creates an additional bridge (br-phy) as required for OVS userspace tunneling

Why do I need to run the hack/kind-linux.sh script on my host?

The script is required for Antrea to work properly in a Kind cluster on Linux. It takes care of disabling TX hardware checksum offload for the veth interface (in the host's network namespace) of each Kind Node. This is required when using OVS in userspace mode. Refer to this Antrea Github issue #14 for more information.