Upgrading Calico on Kubernetes

About upgrading Calico

This page describes how to upgrade to master from Calico v3.0 or later. The procedure varies by datastore type.

Important: Do not use older versions of calicoctl after the upgrade. This may result in unexpected behavior and data.

Upgrading an installation that uses the Kubernetes API datastore

  1. Download the master manifest that corresponds to your original installation method.

    Calico for policy and networking

    curl \
    https://docs.projectcalico.org/master/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml \
    -O
    

    Calico for policy and flannel for networking

    curl \
    https://docs.projectcalico.org/master/getting-started/kubernetes/installation/hosted/canal/canal.yaml \
    -O
    

    Calico for policy (advanced)

    curl \
    https://docs.projectcalico.org/master/getting-started/kubernetes/installation/hosted/kubernetes-datastore/policy-only/1.7/calico.yaml \
    -O
    

    Note: If you manually modified the manifest, you must manually apply the same changes to the downloaded manifest.

  2. Use the following command to initiate a rolling update, after replacing <manifest-file-name> with the file name of your master manifest.

    kubectl apply -f <manifest-file-name>
    
  3. Watch the status of the upgrade as follows.

    watch kubectl get pods -n kube-system
    

    Verify that the status of all Calico pods indicate Running.

    calico-node-hvvg8     2/2   Running   0    3m
    calico-node-vm8kh     2/2   Running   0    3m
    calico-node-w92wk     2/2   Running   0    3m
    
  4. Remove any existing calicoctl instances, install the new calicoctl and configure it to connect to your datastore.

  5. Use the following command to check the Calico version number.

    calicoctl version
    

    It should return a Cluster Version of master.x.

  6. Congratulations! You have upgraded to Calico master.

Upgrading an installation that uses an etcd datastore

  1. Download the master manifest that corresponds to your original installation method.

    Calico for policy and networking

    curl \
    https://docs.projectcalico.org/master/getting-started/kubernetes/installation/hosted/calico.yaml \
    -O
    

    Calico for policy and flannel for networking

    curl \
    https://docs.projectcalico.org/master/getting-started/kubernetes/installation/hosted/canal/canal-etcd.yaml \
    -O
    

    Note: You must must manually apply the changes you made to the manifest during installation to the downloaded master manifest. At a minimum, you must set the etcd_endpoints value.

  2. Use the following command to initiate a rolling update, after replacing <manifest-file-name> with the file name of your master manifest.

    kubectl apply -f <manifest-file-name>
    
  3. Watch the status of the upgrade as follows.

    watch kubectl get pods -n kube-system
    

    Verify that the status of all Calico pods indicate Running.

    calico-kube-controllers-6d4b9d6b5b-wlkfj   1/1       Running   0          3m
    calico-node-hvvg8                          1/2       Running   0          3m
    calico-node-vm8kh                          1/2       Running   0          3m
    calico-node-w92wk                          1/2       Running   0          3m
    

    Tip: The calico-node pods will report 1/2 in the READY column, as shown.

  4. Remove any existing calicoctl instances, install the new calicoctl and configure it to connect to your datastore.

  5. Use the following command to check the Calico version number.

    calicoctl version
    

    It should return a Cluster Version of master.

  6. Congratulations! You have upgraded to Calico master.