Skip to content

Commit

Permalink
calico v3.28.1
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Aug 25, 2024
1 parent 6389a7f commit 62a9c38
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ outputs:
description: "Installed k8s version, such as v1.29.0"
value: "${{ steps.set-output.outputs.k8s-version }}"
calico-version:
description: "Installed calico version, such as v3.27.3"
description: "Installed calico version, such as v3.28.1"
value: "${{ steps.set-output.outputs.calico-version }}"
helm-version:
description: "Installed helm version, such as v3.13.0"
Expand Down Expand Up @@ -146,37 +146,34 @@ runs:
shell: bash

# Install calico as a CNI to enforce our NetworkPolicies. Note that canal
# could do this job as well, but we failed to set it up in Travis CI.
# could do this job as well.
#
# Below we download the calico.yaml Kubernetes manifest and insert a
# container_settings section just below the phrase '"type": "calico"' and
# then `kubectl apply` it.
# Below we download the calico.yaml Kubernetes manifest, split it into
# separate manifests for each object, and modify the container_settings in
# ConfigMap/calico-config
#
# ref: https://rancher.com/docs/k3s/latest/en/installation/network-options/
#
# With k3s 1.29 of recent versions, and calico v3.27.3, we have added
# DirectoryOrCreate to the hostPath volume to avoid
# https://github.com/jupyterhub/action-k3s-helm/issues/112. This is reported
# to calcio in https://github.com/projectcalico/calico/issues/8773, and
# could perhaps be closed if we bump to a calico version having resolve
# this.
#
- name: Setup calico
run: |
echo "::group::Setup calico"
curl -sfL --output /tmp/calico.yaml https://raw.githubusercontent.com/projectcalico/calico/v3.27.3/manifests/calico.yaml
cat /tmp/calico.yaml \
| sed '/"type": "calico"/a\
"container_settings": {\
"allow_ip_forwarding": true\
},' \
| sed '/path: \/opt\/cni\/bin/a\
type: DirectoryOrCreate' \
| sed '/path: \/var\/run\/calico/a\
type: DirectoryOrCreate' \
| sed '/path: \/var\/lib\/calico/a\
type: DirectoryOrCreate' \
| kubectl apply -f -
curl -sfL --output /tmp/calico.yaml https://raw.githubusercontent.com/projectcalico/calico/v3.28.1/manifests/calico.yaml
# Split manifest into separate files
mkdir calico
cd calico
yq -s '"\(.kind)-\(.metadata.name).yaml"' /tmp/calico.yaml
sed -i.bak '/"type": "calico"/a\
"container_settings": {"allow_ip_forwarding": true},'\
ConfigMap-calico-config.yaml
for f in *.yaml.bak; do
diff -u "$f" "${f%.bak}" || :
done
cat ./*.yaml | kubectl apply -f -
echo "::endgroup::"
shell: bash

Expand Down

0 comments on commit 62a9c38

Please sign in to comment.