Quickstart for Calico Enterprise on Kubernetes

3 MINUTE READ

Big picture

This quickstart gets you a single-host Kubernetes cluster with Calico Enterprise in approximately 15 minutes.

Value

Use this quickstart to quickly and easily try Calico Enterprise features. To deploy a cluster suitable for production, refer to Calico Enterprise on Kubernetes.

Concepts

Operator based installation

This quickstart guide uses the Tigera operator to install Calico Enterprise. The operator provides lifecycle management for Calico Enterprise exposed via the Kubernetes API defined as a custom resource definition.

Before you begin

Required

A Linux host that meets the following requirements.

How to

The geeky details of what you get:

Policy
Calico
IPAM
Calico
CNI
Calico
Overlay
IPIP
Routing
BGP
Datastore
kubernetes
?

Install Kubernetes

  1. Follow the Kubernetes instructions to install kubeadm

    Note: After installing kubeadm, do not power down or restart the host. Instead, continue directly to the next step.

  2. As a regular user with sudo privileges, open a terminal on the host that you installed kubeadm on.

  3. Initialize the master using the following command.

    sudo kubeadm init --pod-network-cidr=192.168.0.0/16 \
    --apiserver-cert-extra-sans=127.0.0.1
    

    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.

  4. 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
    
  5. Remove master taint in order to allow kubernetes to schedule pods on the master node.

    kubectl taint nodes --all node-role.kubernetes.io/master-
    

Install Calico Enterprise

  1. Configure a storage class for Calico Enterprise.

  2. Install the Tigera operator and custom resource definitions.

    kubectl create -f https://docs.tigera.io/v3.11/manifests/tigera-operator.yaml
    
  3. Install the Prometheus operator and related custom resource definitions. The Prometheus operator will be used to deploy Prometheus server and Alertmanager to monitor Calico Enterprise metrics.

    Note: If you have an existing Prometheus operator in your cluster that you want to use, skip this step. To work with Calico Enterprise, your Prometheus operator must be v0.40.0 or higher.

    kubectl create -f https://docs.tigera.io/v3.11/manifests/tigera-prometheus-operator.yaml
    
  4. Install your pull secret.

    kubectl create secret generic tigera-pull-secret \
        --from-file=.dockerconfigjson=<path/to/pull/secret> \
        --type=kubernetes.io/dockerconfigjson -n tigera-operator
    
  5. Install the Tigera custom resources. For more information on configuration options available in this manifest, see the installation reference.

    kubectl create -f https://docs.tigera.io/v3.11/manifests/custom-resources.yaml
    

    You can now monitor progress with the following command:

    watch kubectl get tigerastatus
    

    Wait until the apiserver shows a status of Available, then proceed to the next section.

Install the Calico Enterprise license

In order to use Calico Enterprise, you must install the license provided to you by Tigera.

kubectl create -f </path/to/license.yaml>

You can now monitor progress with the following command:

watch kubectl get tigerastatus

When all components show a status of Available, proceed to the next section.

Log in to Calico Enterprise Manager

  1. Create network admin user “Jane”.

    kubectl create sa jane -n default
    kubectl create clusterrolebinding jane-access --clusterrole tigera-network-admin --serviceaccount default:jane
    
  2. Extract the login token for use with the Calico Enterprise UI.
    kubectl get secret $(kubectl get serviceaccount jane -o jsonpath='{range .secrets[*]}{.name}{"\n"}{end}' | grep token) -o go-template='{{.data.token | base64decode}}' && echo
    

    Copy the above token to your clipboard for use in the next step.

  3. Set up a channel from your local computer to the Calico Enterprise UI.

    kubectl port-forward -n tigera-manager svc/tigera-manager 9443
    

    Visit https://localhost:9443/ to log in to the Calico Enterprise UI. Use the token from the previous step to authenticate.

Secure Calico Enterprise with network policy

To secure Calico Enterprise component communications, install the following set of network policies.

kubectl create -f https://docs.tigera.io/v3.11/manifests/tigera-policies.yaml

Congratulations! You now have a single-host Kubernetes cluster with Calico Enterprise.

Next steps