Quickstart for Calico on Kubernetes
This quickstart gets you a single-host Kubernetes cluster with Calico in approximately 15 minutes.
Use this quickstart to quickly and easily try features. To deploy a cluster suitable for production, refer to Calico on Kubernetes.
Before you begin
- Make sure you have a linux host that meets the following requirements:
- x86-64 processor
- 2GB RAM
- 10GB free disk space
- RedHat Enterprise Linux 7.x+, CentOS 7.x+, Ubuntu 16.04+, or Debian 9.x+
- Ensure that Calico can manage
tunlinterfaces on the host. If NetworkManager is present on the host, refer to Configure NetworkManager.
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.
Note: 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.
The geeky details of what you get:
Create a single-host Kubernetes cluster
Note: After 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 master using the following command.
sudo kubeadm init --pod-network-cidr=192.168.0.0/16
Note: If 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
mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config
Install the Tigera Calico operator and custom resource definitions.
kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
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://docs.projectcalico.org/manifests/custom-resources.yaml
Note: Before 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-system
Wait until each pod has the
Note: The Tigera operator installs resources in the
calico-systemnamespace. Other install methods may use the
Remove the taints on the master so that you can schedule pods on it.
kubectl taint nodes --all node-role.kubernetes.io/master-
It should return the following.
Confirm that you now have a node in your cluster with the following command.
kubectl get nodes -o wide
It should return something like the following.
Congratulations! You now have a single-host Kubernetes cluster with Calico.