Upgrading Calico
About upgrading Calico
The upgrade procedure varies according to how you originally installed Calico and your datastore type.
-
Upgrading an installation that uses the Kubernetes API datastore
-
Upgrading an installation that connects directly to an etcd datastore
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
-
If your configuration uses RBAC, use the following command to create the roles and role bindings for Calico’s components:
kubectl apply -f \ https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
Note: You can also view the manifest in your browser.
-
Download the v3.2 manifest that corresponds to your original installation method.
Calico for policy and networking
curl \ https://docs.projectcalico.org/v3.2/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/v3.2/getting-started/kubernetes/installation/hosted/canal/canal.yaml \ -O
Calico for policy (advanced)
curl \ https://docs.projectcalico.org/v3.2/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.
-
Use the following command to initiate a rolling update, after replacing
<manifest-file-name>
with the file name of your v3.2 manifest.kubectl apply -f <manifest-file-name>
-
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
-
Remove any existing
calicoctl
instances, install the newcalicoctl
and configure it to connect to your datastore. -
Use the following command to check the Calico version number.
calicoctl version
It should return a
Cluster Version
ofv3.2.x
.Note: If upgrading from Calico 2.6.x and an error occurs during the upgrade, refer to Downgrading Calico.
-
Congratulations! You have upgraded to Calico v3.2.
Upgrading an installation that uses an etcd datastore
-
If your configuration uses RBAC, use the following command to create the roles and role bindings for Calico’s components:
kubectl apply -f \ https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/rbac.yaml
Note: You can also view the manifest in your browser.
-
Download the v3.2 manifest that corresponds to your original installation method.
Calico for policy and networking
curl \ https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/hosted/calico.yaml \ -O
Calico for policy and flannel for networking
curl \ https://docs.projectcalico.org/v3.2/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 v3.2 manifest. At a minimum, you must set the
etcd_endpoints
value. -
Use the following command to initiate a rolling update, after replacing
<manifest-file-name>
with the file name of your v3.2 manifest.kubectl apply -f <manifest-file-name>
-
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 theREADY
column, as shown.Note: If upgrading from Calico 2.6.x and an error occurs during the upgrade, refer to an error occurs during the upgrade, refer to Downgrading Calico.
-
Remove any existing
calicoctl
instances, install the newcalicoctl
and configure it to connect to your datastore. -
Use the following command to check the Calico version number.
calicoctl version
It should return a
Cluster Version
ofv3.2.x
. -
If you are upgrading from Calico 3.x, skip to the next step. Otherwise, for those upgrading from Calico 2.6.x, wait for some time to really ensure that the upgrade succeeded and no problems ensued. Then complete the upgrade by running
calico-upgrade complete
. After this, you can once again schedule pods and make changes to configuration and policy.Important: If you experience errors after running
calico-upgrade complete
, such as an inability to schedule pods, downgrade Calico as soon as possible. -
Congratulations! You have upgraded to Calico v3.2.