Skip to content

Commit

Permalink
Merge pull request #3369 from CecileRobertMichon/calico-mcr
Browse files Browse the repository at this point in the history
Use MCR registry for Calico images
  • Loading branch information
k8s-ci-robot authored May 31, 2023
2 parents 30eb671 + e31df81 commit ef6ec6d
Show file tree
Hide file tree
Showing 30 changed files with 107 additions and 76 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,18 @@ generate-addons: fetch-calico-manifests ## Generate metric-server, calico calico
$(KUSTOMIZE) build $(ADDONS_DIR)/calico-dual-stack > $(ADDONS_DIR)/calico-dual-stack.yaml

# When updating this, make sure to also update the Windows image version in templates/addons/windows/calico.
CALICO_VERSION := v3.25.0
export CALICO_VERSION := v3.25.1
# Where all downloaded Calico manifests are unpacked and stored.
CALICO_RELEASES := $(ARTIFACTS)/calico
# Path to manifests directory in a Calico release archive.
CALICO_RELEASE_MANIFESTS_DIR := release-$(CALICO_VERSION)/manifests
# Path where Calico manifests are stored which should be used for addons generation.
CALICO_MANIFESTS_DIR := $(ARTIFACTS)/calico/$(CALICO_RELEASE_MANIFESTS_DIR)

.PHONY: get-calico-version
get-calico-version: ## Print the Calico version used for CNI in the repo.
@echo $(CALICO_VERSION)

.PHONY: fetch-calico-manifests
fetch-calico-manifests: $(CALICO_MANIFESTS_DIR) ## Get Calico release manifests and unzip them.
cp $(CALICO_MANIFESTS_DIR)/calico-vxlan.yaml $(ADDONS_DIR)/calico
Expand Down
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def get_addons(flavor_name):
else:
calico_values = "./templates/addons/calico/values.yaml"

addon_cmd = "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://docs.tigera.io/calico/charts calico tigera-operator -f " + calico_values + " --namespace tigera-operator --create-namespace"
addon_cmd = "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://docs.tigera.io/calico/charts --version ${CALICO_VERSION} calico tigera-operator -f " + calico_values + " --namespace tigera-operator --create-namespace"

if "intree-cloud-provider" not in flavor_name:
addon_cmd += "; " + helm_cmd + " --kubeconfig ./${CLUSTER_NAME}.kubeconfig install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${CLUSTER_NAME}"
Expand Down
6 changes: 3 additions & 3 deletions docs/book/src/topics/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Then install the Helm chart on the workload cluster:

```bash
helm repo add projectcalico https://docs.tigera.io/calico/charts && \
helm install calico projectcalico/tigera-operator -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico/values.yaml --set-string "installation.calicoNetwork.ipPools[0].cidr=${IPV4_CIDR_BLOCK}" --namespace tigera-operator --create-namespace
helm install calico projectcalico/tigera-operator --version v3.25.1 -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico/values.yaml --set-string "installation.calicoNetwork.ipPools[0].cidr=${IPV4_CIDR_BLOCK}" --namespace tigera-operator --create-namespace
```

### For IPv6 Clusters
Expand All @@ -44,7 +44,7 @@ Then install the Helm chart on the workload cluster:

```bash
helm repo add projectcalico https://docs.tigera.io/calico/charts && \
helm install calico projectcalico/tigera-operator -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico-ipv6/values.yaml --set-string "installation.calicoNetwork.ipPools[0].cidr=${IPV6_CIDR_BLOCK}" --namespace tigera-operator --create-namespace
helm install calico projectcalico/tigera-operator --version v3.25.1 -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico-ipv6/values.yaml --set-string "installation.calicoNetwork.ipPools[0].cidr=${IPV6_CIDR_BLOCK}" --namespace tigera-operator --create-namespace
```

### For Dual-Stack Clusters
Expand All @@ -60,7 +60,7 @@ Then install the Helm chart on the workload cluster:

```bash
helm repo add projectcalico https://docs.tigera.io/calico/charts && \
helm install calico projectcalico/tigera-operator -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico-dual-stack/values.yaml --set-string "installation.calicoNetwork.ipPools[0].cidr=${IPV4_CIDR_BLOCK}","installation.calicoNetwork.ipPools[1].cidr=${IPV6_CIDR_BLOCK}" --namespace tigera-operator --create-namespace
helm install calico projectcalico/tigera-operator --version v3.25.1 -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico-dual-stack/values.yaml --set-string "installation.calicoNetwork.ipPools[0].cidr=${IPV4_CIDR_BLOCK}","installation.calicoNetwork.ipPools[1].cidr=${IPV6_CIDR_BLOCK}" --namespace tigera-operator --create-namespace
```

<aside class="note">
Expand Down
4 changes: 3 additions & 1 deletion scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export AZURE_LOCATION_GPU="${AZURE_LOCATION_GPU:-$(capz::util::get_random_region
export AZURE_LOCATION_EDGEZONE="${AZURE_LOCATION_EDGEZONE:-$(capz::util::get_random_region_edgezone)}"
export AZURE_CONTROL_PLANE_MACHINE_TYPE="${AZURE_CONTROL_PLANE_MACHINE_TYPE:-"Standard_B2s"}"
export AZURE_NODE_MACHINE_TYPE="${AZURE_NODE_MACHINE_TYPE:-"Standard_B2s"}"
export KIND_EXPERIMENTAL_DOCKER_NETWORK="bridge"
CALICO_VERSION=$(make get-calico-version)
export CALICO_VERSION


capz::util::generate_ssh_key

Expand Down
5 changes: 3 additions & 2 deletions scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ install_calico() {
"${KUBECTL}" get configmap kubeadm-config --namespace=kube-system -o yaml | sed 's/namespace: kube-system/namespace: calico-system/' | "${KUBECTL}" apply -f - || return 1
fi
# install Calico CNI
echo "Installing Calico CNI via helm"
CALICO_VERSION=$(make get-calico-version)
echo "Installing Calico CNI ${CALICO_VERSION} via helm"
if [[ "${CIDR0:-}" =~ .*:.* ]]; then
echo "Cluster CIDR is IPv6"
CALICO_VALUES_FILE="${REPO_ROOT}/templates/addons/calico-ipv6/values.yaml"
Expand All @@ -192,7 +193,7 @@ install_calico() {
CALICO_VALUES_FILE="${REPO_ROOT}/templates/addons/calico/values.yaml"
CIDR_STRING_VALUES="installation.calicoNetwork.ipPools[0].cidr=${CIDR0}"
fi
"${HELM}" upgrade calico --install --repo https://docs.tigera.io/calico/charts tigera-operator -f "${CALICO_VALUES_FILE}" --set-string "${CIDR_STRING_VALUES}" --namespace calico-system || return 1
"${HELM}" upgrade calico --install --repo https://docs.tigera.io/calico/charts --version "${CALICO_VERSION}" tigera-operator -f "${CALICO_VALUES_FILE}" --set-string "${CIDR_STRING_VALUES}" --namespace calico-system || return 1
}

# install_cloud_provider_azure installs OOT cloud-provider-azure componentry onto the Cluster.
Expand Down
10 changes: 5 additions & 5 deletions templates/addons/calico-dual-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4351,7 +4351,7 @@ spec:
value: node
- name: DATASTORE_TYPE
value: kubernetes
image: docker.io/calico/kube-controllers:v3.25.0
image: docker.io/calico/kube-controllers:v3.25.1
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -4428,7 +4428,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/typha:v3.25.0
image: docker.io/calico/typha:v3.25.1
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down Expand Up @@ -4546,7 +4546,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
Expand Down Expand Up @@ -4621,7 +4621,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/cni:v3.25.0
image: docker.io/calico/cni:v3.25.1
imagePullPolicy: IfNotPresent
name: install-cni
securityContext:
Expand All @@ -4635,7 +4635,7 @@ spec:
- calico-node
- -init
- -best-effort
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
name: mount-bpffs
securityContext:
Expand Down
7 changes: 7 additions & 0 deletions templates/addons/calico-dual-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ installation:
encapsulation: None
natOutgoing: Enabled
nodeSelector: all()
registry: mcr.microsoft.com/oss
# Image and registry configuration for the tigera/operator pod.
tigeraOperator:
image: tigera/operator
registry: mcr.microsoft.com/oss
calicoctl:
image: mcr.microsoft.com/oss/calico/ctl
10 changes: 5 additions & 5 deletions templates/addons/calico-ipv6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4340,7 +4340,7 @@ spec:
value: node
- name: DATASTORE_TYPE
value: kubernetes
image: docker.io/calico/kube-controllers:v3.25.0
image: docker.io/calico/kube-controllers:v3.25.1
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -4417,7 +4417,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/typha:v3.25.0
image: docker.io/calico/typha:v3.25.1
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down Expand Up @@ -4535,7 +4535,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
Expand Down Expand Up @@ -4610,7 +4610,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/cni:v3.25.0
image: docker.io/calico/cni:v3.25.1
imagePullPolicy: IfNotPresent
name: install-cni
securityContext:
Expand All @@ -4624,7 +4624,7 @@ spec:
- calico-node
- -init
- -best-effort
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
name: mount-bpffs
securityContext:
Expand Down
10 changes: 5 additions & 5 deletions templates/addons/calico-ipv6/calico-policy-only.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4441,7 +4441,7 @@ spec:
# This container installs the CNI binaries
# and CNI network config file on each node.
- name: install-cni
image: docker.io/calico/cni:v3.25.0
image: docker.io/calico/cni:v3.25.1
imagePullPolicy: IfNotPresent
command: ["/opt/cni/bin/install"]
envFrom:
Expand Down Expand Up @@ -4478,7 +4478,7 @@ spec:
# i.e. bpf at /sys/fs/bpf and cgroup2 at /run/calico/cgroup. Calico-node initialisation is executed
# in best effort fashion, i.e. no failure for errors, to not disrupt pod creation in iptable mode.
- name: "mount-bpffs"
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
command: ["calico-node", "-init", "-best-effort"]
volumeMounts:
Expand All @@ -4504,7 +4504,7 @@ spec:
# container programs network policy and routes on each
# host.
- name: calico-node
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
Expand Down Expand Up @@ -4692,7 +4692,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: calico-kube-controllers
image: docker.io/calico/kube-controllers:v3.25.0
image: docker.io/calico/kube-controllers:v3.25.1
imagePullPolicy: IfNotPresent
env:
# Choose which controllers to run.
Expand Down Expand Up @@ -4776,7 +4776,7 @@ spec:
securityContext:
fsGroup: 65534
containers:
- image: docker.io/calico/typha:v3.25.0
- image: docker.io/calico/typha:v3.25.1
imagePullPolicy: IfNotPresent
name: calico-typha
ports:
Expand Down
7 changes: 7 additions & 0 deletions templates/addons/calico-ipv6/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ installation:
encapsulation: None
natOutgoing: Enabled
nodeSelector: all()
registry: mcr.microsoft.com/oss
# Image and registry configuration for the tigera/operator pod.
tigeraOperator:
image: tigera/operator
registry: mcr.microsoft.com/oss
calicoctl:
image: mcr.microsoft.com/oss/calico/ctl
10 changes: 5 additions & 5 deletions templates/addons/calico.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4355,7 +4355,7 @@ spec:
value: node
- name: DATASTORE_TYPE
value: kubernetes
image: docker.io/calico/kube-controllers:v3.25.0
image: docker.io/calico/kube-controllers:v3.25.1
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -4468,7 +4468,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
Expand Down Expand Up @@ -4540,7 +4540,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/cni:v3.25.0
image: docker.io/calico/cni:v3.25.1
imagePullPolicy: IfNotPresent
name: upgrade-ipam
securityContext:
Expand Down Expand Up @@ -4575,7 +4575,7 @@ spec:
- configMapRef:
name: kubernetes-services-endpoint
optional: true
image: docker.io/calico/cni:v3.25.0
image: docker.io/calico/cni:v3.25.1
imagePullPolicy: IfNotPresent
name: install-cni
securityContext:
Expand All @@ -4589,7 +4589,7 @@ spec:
- calico-node
- -init
- -best-effort
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
name: mount-bpffs
securityContext:
Expand Down
10 changes: 5 additions & 5 deletions templates/addons/calico/calico-vxlan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4440,7 +4440,7 @@ spec:
# It can be deleted if this is a fresh installation, or if you have already
# upgraded to use calico-ipam.
- name: upgrade-ipam
image: docker.io/calico/cni:v3.25.0
image: docker.io/calico/cni:v3.25.1
imagePullPolicy: IfNotPresent
command: ["/opt/cni/bin/calico-ipam", "-upgrade"]
envFrom:
Expand Down Expand Up @@ -4468,7 +4468,7 @@ spec:
# This container installs the CNI binaries
# and CNI network config file on each node.
- name: install-cni
image: docker.io/calico/cni:v3.25.0
image: docker.io/calico/cni:v3.25.1
imagePullPolicy: IfNotPresent
command: ["/opt/cni/bin/install"]
envFrom:
Expand Down Expand Up @@ -4511,7 +4511,7 @@ spec:
# i.e. bpf at /sys/fs/bpf and cgroup2 at /run/calico/cgroup. Calico-node initialisation is executed
# in best effort fashion, i.e. no failure for errors, to not disrupt pod creation in iptable mode.
- name: "mount-bpffs"
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
command: ["calico-node", "-init", "-best-effort"]
volumeMounts:
Expand All @@ -4537,7 +4537,7 @@ spec:
# container programs network policy and routes on each
# host.
- name: calico-node
image: docker.io/calico/node:v3.25.0
image: docker.io/calico/node:v3.25.1
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
Expand Down Expand Up @@ -4752,7 +4752,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: calico-kube-controllers
image: docker.io/calico/kube-controllers:v3.25.0
image: docker.io/calico/kube-controllers:v3.25.1
imagePullPolicy: IfNotPresent
env:
# Choose which controllers to run.
Expand Down
7 changes: 7 additions & 0 deletions templates/addons/calico/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ installation:
ipPools:
- cidr: 192.168.0.0/16
encapsulation: VXLAN
registry: mcr.microsoft.com/oss
# Image and registry configuration for the tigera/operator pod.
tigeraOperator:
image: tigera/operator
registry: mcr.microsoft.com/oss
calicoctl:
image: mcr.microsoft.com/oss/calico/ctl
6 changes: 3 additions & 3 deletions templates/addons/windows/calico/calico.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ spec:
# This container installs the CNI binaries
# and CNI network config file on each node.
- name: install-cni
image: sigwindowstools/calico-install:v3.25.0-hostprocess
image: sigwindowstools/calico-install:v3.25.1-hostprocess
args: ["$env:CONTAINER_SANDBOX_MOUNT_POINT/calico/install.ps1"]
imagePullPolicy: Always
env:
Expand Down Expand Up @@ -205,7 +205,7 @@ spec:
runAsUserName: "NT AUTHORITY\\system"
containers:
- name: calico-node-startup
image: sigwindowstools/calico-node:v3.25.0-hostprocess
image: sigwindowstools/calico-node:v3.25.1-hostprocess
args: ["$env:CONTAINER_SANDBOX_MOUNT_POINT/calico/node-service.ps1"]
workingDir: "$env:CONTAINER_SANDBOX_MOUNT_POINT/calico/"
imagePullPolicy: Always
Expand All @@ -232,7 +232,7 @@ spec:
- name: VXLAN_VNI
value: "4096"
- name: calico-node-felix
image: sigwindowstools/calico-node:v3.25.0-hostprocess
image: sigwindowstools/calico-node:v3.25.1-hostprocess
args: ["$env:CONTAINER_SANDBOX_MOUNT_POINT/calico/felix-service.ps1"]
imagePullPolicy: Always
workingDir: "$env:CONTAINER_SANDBOX_MOUNT_POINT/calico/"
Expand Down
6 changes: 3 additions & 3 deletions templates/test/ci/cluster-template-prow-ci-version.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ef6ec6d

Please sign in to comment.