Skip to content

Commit 3ad1683

Browse files
authored
Merge pull request #107 from consideRatio/pr/ref0
Rely on k3s to provide cri-dockerd
2 parents b10d49d + 9dc56f1 commit 3ad1683

File tree

2 files changed

+3
-37
lines changed

2 files changed

+3
-37
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![GitHub Action badge](https://github.com/jupyterhub/action-k3s-helm/workflows/Test/badge.svg)](https://github.com/jupyterhub/action-k3s-helm/actions)
44

55
Creates a Kubernetes cluster using [K3s](https://k3s.io/) (1.24+) with
6-
[Calico](https://www.projectcalico.org/) (3.24) for
6+
[Calico](https://www.projectcalico.org/) (3.27.0) for
77
[NetworkPolicy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
88
enforcement, and installs [Helm 3](https://helm.sh/) (3.5+).
99

action.yml

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -90,40 +90,6 @@ runs:
9090
echo "::endgroup::"
9191
shell: bash
9292

93-
# NOTE: The sed substitution operation is to run cri-dockerd in a way that
94-
# makes it work with calico as a CNI. This was based on
95-
# https://github.com/Mirantis/cri-dockerd/issues/42.
96-
#
97-
- name: Setup cri-dockerd as a dockershim
98-
if: inputs.docker-enabled == 'true'
99-
env:
100-
# https://github.com/Mirantis/cri-dockerd/tags
101-
CRI_DOCKERD_VERSION: "0.3.0"
102-
run: |
103-
echo "::group::Setup cri-dockerd as a dockershim"
104-
cd /tmp
105-
106-
wget -qO- https://github.com/Mirantis/cri-dockerd/releases/download/v${CRI_DOCKERD_VERSION}/cri-dockerd-${CRI_DOCKERD_VERSION}.amd64.tgz | tar -xvz --strip-components=1
107-
chmod +x cri-dockerd
108-
sudo mv cri-dockerd /usr/bin/
109-
110-
wget -q https://raw.githubusercontent.com/Mirantis/cri-dockerd/v${CRI_DOCKERD_VERSION}/packaging/systemd/cri-docker.socket
111-
sudo mv cri-docker.socket /etc/systemd/system/
112-
113-
wget -q https://raw.githubusercontent.com/Mirantis/cri-dockerd/v${CRI_DOCKERD_VERSION}/packaging/systemd/cri-docker.service
114-
sed --in-place --expression \
115-
's,--network-plugin=,--network-plugin=cni --cni-bin-dir=/opt/cni/bin --cni-cache-dir=/var/lib/cni/cache --cni-conf-dir=/etc/cni/net.d,' \
116-
cri-docker.service
117-
sudo mv cri-docker.service /etc/systemd/system/
118-
119-
sudo systemctl daemon-reload
120-
sudo systemctl enable cri-docker.service
121-
sudo systemctl enable --now cri-docker.socket
122-
123-
cri-dockerd --buildinfo
124-
echo "::endgroup::"
125-
shell: bash
126-
12793
# NOTE: We apply a workaround as of version 3.0.1 by passing
12894
# --egress-selector-mode=disabled by default as not doing so following
12995
# modern versions of k3s has led to issues with `kubectl exec` and
@@ -143,7 +109,7 @@ runs:
143109
k3s_disable_traefik="--disable traefik"
144110
fi
145111
if [[ "${{ inputs.docker-enabled }}" == true ]]; then
146-
k3s_docker=--container-runtime-endpoint=/run/cri-dockerd.sock
112+
k3s_docker=--docker
147113
fi
148114
# We want to provide a new default value for the --egress-selector-mode
149115
# flag to avoid an intermittent issue possibly not fully resolved:
@@ -191,7 +157,7 @@ runs:
191157
- name: Setup calico
192158
run: |
193159
echo "::group::Setup calico"
194-
curl -sfL --output /tmp/calico.yaml https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/calico.yaml
160+
curl -sfL --output /tmp/calico.yaml https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/calico.yaml
195161
cat /tmp/calico.yaml \
196162
| sed '/"type": "calico"/a\
197163
"container_settings": {\

0 commit comments

Comments
 (0)