over 5 years ago

Before we start, we should know what Project Calico is.
As per Project Calico documentation, Calico is a Tigera open source project and is primarily maintained by the Tigera team, enabling cloud native application connectivity and policy. Calico integrates with major orchestration systems like Kubernetes, Apache Mesos, Docker, OpenStack and more to provide a seamless experience for developers and operators.

The main feature of Calico are:
- Scalable, distributed control plane
- Policy-driven network security
- No overlay required
- Integrated with all major cloud platforms
- Widely deployed, and proven at scale

In this blog, we will see how to start with Project Calico with Minikube.

To start with, we need Minikube, which is a tool that makes it easy to run Kubernetes locally.

Getting started:

So we will first get kubectl and minikube in our Ubuntu OS to start with.
We will use the following commands to install kubectl in our Ubuntu OS.

echo "Installing kubectl..........................."
wget https://storage.googleapis.com/kubernetes-release/release/v1.4.4/bin/linux/amd64/kubectl
chmod +x kubectl
sudo mv kubectl /usr/local/bin/kubectl

The above command will get you kubectl installed into the /usr/local/bin location with requered access to the file.

Simmilarly, the following command will install minikube in Ubuntu OS under /usr/local/bin location with requered access to the file.
echo "Installing minikube.........................."
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.15.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

Policy-only mode (Kubernetes networking)

We can now configure Calico in Policy-only mode. In this mode Calico is not setting up the networking but uses the 'host-local' plugin for IPAM so depends on K8s for IPAM. The minikube start command that can configure is:
minikube start --memory 2096 --network-plugin=cni --host-only-cidr= \
--extra-config=kubelet.PodCIDR= \
--extra-config=proxy.ClusterCIDR= \
--extra-config=controller-manager.ClusterCIDR= \
--extra-config=controller-manager.CIDRAllocatorType=RangeAllocator \

We can see minikube getting started:

Next, we will see it has started successfully:

Now, we need to get calico.yaml from https://docs.projectcalico.org/v2.6/getting-started/kubernetes/installation/hosted/kubeadm/1.6/calico.yaml location to install Calico from calico.yaml locally.

After getting calico.yaml locally, we can use following commands to install Calico and a single node etcd with kubectl:
kubectl apply -f calico.yaml

We can see now as below:

To confirm that all of the pods are running with the following command:
kubectl get pods --all-namespaces

You can see below:

We need to wait until each pod has the STATUS of Running.

If we go back to the location /usr/local/bin/ where all our files are stored and installed, we can see as below:

← Cloud Technology Calico in networking mode →