In order to get a development setup, we usually use kind. We also have a vagrant based setup
# 3 is an example of number of worker nodes in your cluster
make kind-new-cluster N_KIND_WORKERS=3This creates a dual-stack cluster with four nodes. The cluster is configured
with a local registry to allow sharing images on all nodes without having to
copy them you can read more about his here.
You can adapt the configuration by editing ./test/kind/new_cluster.sh
If you are running on Windows, you can also make this work with a few changes
You should now have kubectl get nodes reporting four nodes
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/master/manifests/tigera-operator.yamlFirst you will need to build vpp locally with the required patches. This takes a while but it's usually not run often.
make -C vpp-manager/ vppor
make -C vpp-manager/ vpp BASE=origin/masterThen build the agents, containers & push them to the local docker repository
make dev-kindThen pull calico images once and load them on the nodes (to avoid pulling image limitation issues in case you have a large cluster)
make load-kindYou can use the ./yaml/overlays/dev/kustomize.sh script that takes its
configuration from environment and generates the installation yaml for
Calico/VPP.
# ---------------- images ----------------
export CALICO_AGENT_IMAGE=localhost:5000/calicovpp/agent:latest
export CALICO_VPP_IMAGE=localhost:5000/calicovpp/vpp:latest
export MULTINET_MONITOR_IMAGE=localhost:5000/calicovpp/multinet-monitor:latest
export IMAGE_PULL_POLICY=Always
# ---------------- interfaces ----------------
export CALICOVPP_INTERFACES='{
"uplinkInterfaces": [
{
"interfaceName": "eth0",
"vppDriver": "af_packet"
}
]
}'
# ---------------- encaps ----------------
export CALICO_ENCAPSULATION_V4=IPIP
export CALICO_ENCAPSULATION_V6=None
export CALICO_NAT_OUTGOING=EnabledTo add a redirection to host rule:
# --------------- redirect ----------------
export CALICOVPP_REDIRECT_PROTO="\"udp\""
export CALICOVPP_REDIRECT_PORT=53
export CALICOVPP_REDIRECT_IP="\"172.18.0.1\""To enable memif:
# --------------- memif ----------------
export CALICOVPP_ENABLE_MEMIF=trueTo run multinet:
# --------------- multinet ----------------
export CALICOVPP_ENABLE_MULTINET=true
export CALICOVPP_ENABLE_MEMIF=true
kubectl apply -f test/yaml/multinet/projectcalico.org_networks.yaml
kubectl apply -f test/yaml/multinet/whereabouts-daemonset-install.yaml
kubectl apply -f https://github.com/k8snetworkplumbingwg/multus-cni/raw/master/deployments/multus-daemonset-thick.yml
kubectl apply -f https://github.com/k8snetworkplumbingwg/whereabouts/raw/master/doc/crds/whereabouts.cni.cncf.io_ippools.yaml
kubectl apply -f https://github.com/k8snetworkplumbingwg/whereabouts/raw/master/doc/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml
To run with hugepages on:
# ---------------- vpp config ----------------
export CALICOVPP_CONFIG_TEMPLATE="
unix {
nodaemon
full-coredump
log /var/run/vpp/vpp.log
cli-listen /var/run/vpp/cli.sock
pidfile /run/vpp/vpp.pid
}
buffers {
buffers-per-numa 262144
}
socksvr { socket-name /var/run/vpp/vpp-api.sock }
plugins {
plugin default { enable }
plugin dpdk_plugin.so { disable }
}"
bash ./yaml/overlays/dev/kustomize.sh upTo run without hugepages
# ---------------- vpp config ----------------
export CALICOVPP_DISABLE_HUGEPAGES=true
export CALICOVPP_CONFIG_TEMPLATE="
unix {
nodaemon
full-coredump
log /var/run/vpp/vpp.log
cli-listen /var/run/vpp/cli.sock
pidfile /run/vpp/vpp.pid
}
buffers {
page-size 4K
}
socksvr { socket-name /var/run/vpp/vpp-api.sock }
plugins {
plugin default { enable }
plugin dpdk_plugin.so { disable }
}"
bash ./yaml/overlays/dev/kustomize.sh upThe outputed yaml is stored in <this repo>/.tmp/calico-vpp.yaml,
you can uninstall by simply runnning :
kubectl delete -f .tmp/calico-vpp.yamlIn order to test Calico-VPP, you can simply use our test infrastructure to deploy it on a 3-VM cluster. Requirements are :
- an Ubuntu 18.04 or 20.04 machine
- 8 CPU
- 16 GB RAM
- 100GB disk
- kubectl installed: https://kubernetes.io/docs/tasks/tools/install-kubectl/
- docker installed: https://docs.docker.com/engine/install/ubuntu/
If you are connected to a network that requires the use of a proxy server to reach the public ubuntu repositories, or that restricts the use of the Google public DNS servers, configure the following variables in your environment before running any of the commands below:
export DNS_SERVER=8.8.8.8
export VAGRANT_VM_PROXY=http://proxy.corp:80Start by cloning this repository to get all the necessary scripts:
git clone git@github.com:projectcalico/vpp-dataplane.gitThen run the following commands to setup the test cluster:
make install-test-deps
make start-test-clusterAt this point, you should be able to interact with the new cluster using kubectl, but the cluster won't have a CNI configured yet.
kubectl get nodes -o wideFinally, you can install Calico with the VPP dataplane using:
make test-install-calicovppTo install development images (that allow to recompile and restart calico/vpp without recreating images), run:
# Build VPP in debug mode
make cherry-vpp
make -C vpp-manager/vpp_build install-dep build
make dev
make load-images
make test-install-calicovpp-dev