Install Calico on a single-host Kubernetes cluster
Big picture​
This gets you a single-host Kubernetes cluster with Calico in approximately 15 minutes.
Value​
Use this guide to quickly and easily try Calico features. To deploy a cluster suitable for production, refer to Calico on Kubernetes.
Before you begin​
Required
-
A Linux host that meets the following requirements:
- x86-64, arm64, ppc64le, or s390x processor
- 2CPU
- 2GB RAM
- 10GB free disk space
- RedHat Enterprise Linux 7.x+, CentOS 7.x+, Ubuntu 18.04+, or Debian 9.x+
-
Calico can manage
caliandtunlinterfaces on the hostIf NetworkManager is present on the host, see Configure NetworkManager.
Concepts​
Operator based installation​
This quickstart guide uses the Tigera Operator to install Calico. The operator provides lifecycle management for Calico exposed via the Kubernetes API defined as a custom resource definition.
It is also possible to install Calico without an operator using Kubernetes manifests directly. For platforms and guides that do not use the Tigera Operator, you may notice some differences in the steps and Kubernetes resources compared to those presented in this guide.
How to​
The geeky details of what you get:
| Policy | IPAM | CNI | Overlay | Routing | Datastore |
|---|---|---|---|---|---|
Create a single-host Kubernetes cluster​
-
Follow the Kubernetes instructions to install kubeadm
noteAfter installing kubeadm, do not power down or restart the host. Instead, continue directly to the next step.
-
As a regular user with sudo privileges, open a terminal on the host that you installed kubeadm on.
-
Initialize the control plane using the following command.
sudo kubeadm init --pod-network-cidr=192.168.0.0/16noteIf 192.168.0.0/16 is already in use within your network you must select a different pod network CIDR, replacing 192.168.0.0/16 in the above command.
-
Execute the following commands to configure kubectl (also returned by
kubeadm init).mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Install Calico​
-
Install the Tigera Operator and custom resource definitions.
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.31.0/manifests/operator-crds.yaml
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.31.0/manifests/tigera-operator.yamlnoteDue to the large size of the CRD bundle,
kubectl applymight exceed request limits. Instead, usekubectl createorkubectl replace. -
Install Calico by creating the necessary custom resource. For more information on configuration options available in this manifest, see the installation reference.
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.31.0/manifests/custom-resources-bpf.yamlThis will complete the Calico Open Source installation with the eBPF data plane as the default.
noteBefore creating this manifest, read its contents and make sure its settings are correct for your environment. For example, you may need to change the default IP pool CIDR to match your pod network CIDR.
-
Confirm that all of the pods are running with the following command.
watch kubectl get pods -n calico-systemWait until each pod has the
STATUSofRunning.noteThe Tigera Operator installs resources in the
calico-systemnamespace. Other install methods may use thekube-systemnamespace instead. -
Remove the taints on the control plane so that you can schedule pods on it.
kubectl taint nodes --all node-role.kubernetes.io/control-plane-It should return the following.
node/<your-hostname> untainted -
Monitor the deployment by running the following command:
watch kubectl get tigerastatusAfter a few minutes, all the Calico components display
Truein theAVAILABLEcolumn.Expected outputNAME AVAILABLE PROGRESSING DEGRADED SINCE
apiserver True False False 4m9s
calico True False False 3m29s
goldmane True False False 3m39s
ippools True False False 6m4s
kubeproxy-monitor True False False 6m15s
whisker True False False 3m19sCongratulations! You now have a single-host Kubernetes cluster with Calico.
Next steps​
Required
Recommended tutorials