Skip to content

Commit 1766bee

Browse files
Update calico to v3.23.3 (#3385)
1 parent 279d812 commit 1766bee

6 files changed

Lines changed: 310 additions & 69 deletions

File tree

docs/build.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,12 @@ snap install microk8s_*_amd64.snap --classic --dangerous
9090

9191
The calico CNI manifest can be found under `upgrade-scripts/000-switch-to-calico/resources/calico.yaml`.
9292
Building the manifest is subject to the upstream calico project k8s installation process.
93-
At the time of the v3.23.4 release. The `calico.yaml` manifest is a slightly modified version of:
94-
`https://projectcalico.docs.tigera.io/archive/v3.21/manifests/calico.yaml`:
93+
The `calico.yaml` manifest is a slightly modified version of:
94+
`https://projectcalico.docs.tigera.io/archive/v3.23/manifests/calico.yaml`:
9595

96+
- Set the calico backend from "bird" to "vxlan": `calico_backend: "vxlan"`
9697
- `CALICO_IPV4POOL_CIDR` was set to "10.1.0.0/16"
97-
- `CNI_NET_DIR` was set to "/var/snap/microk8s/current/args/cni-network"
98+
- `CNI_NET_DIR` had to be added and set to "/var/snap/microk8s/current/args/cni-network"
9899
- We set the following mount paths:
99100
1. `var-run-calico` to `/var/snap/microk8s/current/var/run/calico`
100101
1. `var-lib-calico` to `/var/snap/microk8s/current/var/lib/calico`
@@ -104,7 +105,6 @@ At the time of the v3.23.4 release. The `calico.yaml` manifest is a slightly mod
104105
1. `host-local-net-dir` to `/var/snap/microk8s/current/var/lib/cni/networks`
105106
1. `policysync` to `/var/snap/microk8s/current/var/run/nodeagent`
106107
- We enabled vxlan following the instructions in [the official docs.](https://docs.projectcalico.org/getting-started/kubernetes/installation/config-options#switching-from-ip-in-ip-to-vxlan)
107-
- `FELIX_LOGSEVERITYSCREEN` was set to "error"
108108
- The `liveness` and `readiness` probes of `bird-live` was commented out
109109
- We set the IP autodetection method to
110110

@@ -116,7 +116,7 @@ At the time of the v3.23.4 release. The `calico.yaml` manifest is a slightly mod
116116
```dtd
117117
"nodename_file_optional": true,
118118
```
119-
- The sys `mountpath` is commented out. This disables eBPF support but allows the CNI to deploy inside an LXC container.
119+
- The `mount-bpffs` pod is commented out. This disables eBPF support but allows the CNI to deploy inside an LXC container.
120120

121121
## Running the tests locally
122122

scripts/calico/upgrade.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,17 @@ def try_upgrade(cni_file, new_cni_file):
142142
"""
143143

144144
# If cni files are not in place do nothing
145-
if not (os.path.exists(cni_file) and os.path.exists(cni_file)):
145+
if not (os.path.exists(cni_file) and os.path.exists(new_cni_file)):
146146
return False
147147

148148
# If the current cni.yaml is not calico do nothing
149149
if not is_calico_cni_manifest(cni_file):
150150
return False
151151

152-
# If the current cni.yaml is not from 3.19 do nothing
152+
# If the current cni.yaml is not from 3.21 do nothing
153153
# s390x will be filtered out because it is in 3.15
154154
current_version = get_installed_version_of_calico(cni_file)
155-
if "3.19" not in current_version:
155+
if "3.21" not in current_version:
156156
return False
157157

158158
backup_old_cni(cni_file)

tests/unit/test_upgrade_calico_cni.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_get_version(self):
3535
Test extracting the Calico version
3636
"""
3737
res = get_installed_version_of_calico(self._calico_new_yaml)
38-
assert res == "v3.21.4"
38+
assert res == "v3.23.4"
3939

4040
def test_get_autodetect_method(self):
4141
"""
@@ -54,11 +54,11 @@ def test_patch(self):
5454
res = get_calicos_autodetection_method(self._calico_new_yaml)
5555
assert res == "first-found"
5656
res = get_installed_version_of_calico(self._calico_old_copy_yaml)
57-
assert res == "v3.19.1"
57+
assert res == "v3.21.1"
5858
res = try_upgrade(self._calico_old_copy_yaml, self._calico_new_yaml)
5959
assert os.path.exists(self._calico_old_copy_backup_yaml)
6060
res = get_installed_version_of_calico(self._calico_old_copy_yaml)
61-
assert res == "v3.21.4"
61+
assert res == "v3.23.4"
6262
os.remove(self._calico_old_copy_yaml)
6363
os.remove(self._calico_old_copy_backup_yaml)
6464

tests/unit/yamls/calico-new.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4084,7 +4084,7 @@ spec:
40844084
# It can be deleted if this is a fresh installation, or if you have already
40854085
# upgraded to use calico-ipam.
40864086
- name: upgrade-ipam
4087-
image: docker.io/calico/cni:v3.21.4
4087+
image: docker.io/calico/cni:v3.23.4
40884088
command: ["/opt/cni/bin/calico-ipam", "-upgrade"]
40894089
envFrom:
40904090
- configMapRef:
@@ -4111,7 +4111,7 @@ spec:
41114111
# This container installs the CNI binaries
41124112
# and CNI network config file on each node.
41134113
- name: install-cni
4114-
image: docker.io/calico/cni:v3.21.4
4114+
image: docker.io/calico/cni:v3.23.4
41154115
command: ["/opt/cni/bin/install"]
41164116
envFrom:
41174117
- configMapRef:
@@ -4154,7 +4154,7 @@ spec:
41544154
# Adds a Flex Volume Driver that creates a per-pod Unix Domain Socket to allow Dikastes
41554155
# to communicate with Felix over the Policy Sync API.
41564156
- name: flexvol-driver
4157-
image: docker.io/calico/pod2daemon-flexvol:v3.21.4
4157+
image: docker.io/calico/pod2daemon-flexvol:v3.23.4
41584158
volumeMounts:
41594159
- name: flexvol-driver-host
41604160
mountPath: /host/driver
@@ -4165,7 +4165,7 @@ spec:
41654165
# container programs network policy and routes on each
41664166
# host.
41674167
- name: calico-node
4168-
image: docker.io/calico/node:v3.21.4
4168+
image: docker.io/calico/node:v3.23.4
41694169
envFrom:
41704170
- configMapRef:
41714171
# Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode.
@@ -4389,7 +4389,7 @@ spec:
43894389
priorityClassName: system-cluster-critical
43904390
containers:
43914391
- name: calico-kube-controllers
4392-
image: docker.io/calico/kube-controllers:v3.21.4
4392+
image: docker.io/calico/kube-controllers:v3.23.4
43934393
env:
43944394
# Choose which controllers to run.
43954395
- name: ENABLED_CONTROLLERS

tests/unit/yamls/cni.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3827,7 +3827,7 @@ spec:
38273827
# It can be deleted if this is a fresh installation, or if you have already
38283828
# upgraded to use calico-ipam.
38293829
- name: upgrade-ipam
3830-
image: docker.io/calico/cni:v3.19.1
3830+
image: docker.io/calico/cni:v3.21.1
38313831
command: ["/opt/cni/bin/calico-ipam", "-upgrade"]
38323832
envFrom:
38333833
- configMapRef:
@@ -3854,7 +3854,7 @@ spec:
38543854
# This container installs the CNI binaries
38553855
# and CNI network config file on each node.
38563856
- name: install-cni
3857-
image: docker.io/calico/cni:v3.19.1
3857+
image: docker.io/calico/cni:v3.21.1
38583858
command: ["/opt/cni/bin/install"]
38593859
envFrom:
38603860
- configMapRef:
@@ -3897,7 +3897,7 @@ spec:
38973897
# Adds a Flex Volume Driver that creates a per-pod Unix Domain Socket to allow Dikastes
38983898
# to communicate with Felix over the Policy Sync API.
38993899
- name: flexvol-driver
3900-
image: docker.io/calico/pod2daemon-flexvol:v3.19.1
3900+
image: docker.io/calico/pod2daemon-flexvol:v3.21.1
39013901
volumeMounts:
39023902
- name: flexvol-driver-host
39033903
mountPath: /host/driver
@@ -3908,7 +3908,7 @@ spec:
39083908
# container programs network policy and routes on each
39093909
# host.
39103910
- name: calico-node
3911-
image: docker.io/calico/node:v3.19.1
3911+
image: docker.io/calico/node:v3.21.1
39123912
envFrom:
39133913
- configMapRef:
39143914
# Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode.

0 commit comments

Comments
 (0)