Skip to content

Commit d85808f

Browse files
authored
Merge pull request #105 from consideRatio/pr/ref2
Drop support for setting up k3s 1.20 to 1.23, now only 1.24+
2 parents 3e17750 + 166bbe0 commit d85808f

File tree

3 files changed

+14
-41
lines changed

3 files changed

+14
-41
lines changed

.github/workflows/test_k3s.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ jobs:
4747
traefik-enabled: "false"
4848
docker-enabled: "false"
4949

50-
- k3s-version: v1.20.15+k3s1
50+
- k3s-version: v1.24.7+k3s1
5151
k3s-channel: ""
5252
helm-version: v3.5.0
5353
metrics-enabled: "true"
5454
traefik-enabled: "true"
5555
docker-enabled: "false"
5656

57-
- k3s-version: v1.20.15+k3s1
57+
- k3s-version: v1.24.7+k3s1
5858
k3s-channel: ""
5959
helm-version: v3.5.0
6060
metrics-enabled: "false"

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
[![GitHub Action badge](https://github.com/jupyterhub/action-k3s-helm/workflows/Test/badge.svg)](https://github.com/jupyterhub/action-k3s-helm/actions)
44

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

1010
## Optional input parameters
1111

12-
- `k3s-version` or `k3s-channel`: Specify a K3s [version](https://github.com/rancher/k3s/releases) or [release channel](https://update.k3s.io/v1-release/channels). Versions 1.20 and later are supported. Defaults to the stable channel.
12+
- `k3s-version` or `k3s-channel`: Specify a K3s [version](https://github.com/rancher/k3s/releases) or [release channel](https://update.k3s.io/v1-release/channels). Versions 1.24 and later are supported. Defaults to the stable channel.
1313
- `helm-version`: Specify a Helm [version](https://github.com/helm/helm/releases). Versions 3.1 and later are supported. Defaults to the latest version.
1414
- `metrics-enabled`: Enable or disable K3S metrics-server, `true` (default) or `false`.
1515
- `traefik-enabled`: Enable or disable K3S Traefik ingress, `true` (default) or `false`.
@@ -20,10 +20,10 @@ enforcement, and installs [Helm 3](https://helm.sh/) (3.5+).
2020

2121
- `kubeconfig`: The absolute path to the kubeconfig file (`$HOME/.kube/config`).
2222
The `KUBECONFIG` environment variable is also set by this action but may be removed in a future breaking release.
23-
- `k3s-version`: Installed k3s version, such as v1.24.3+k3s1
24-
- `k8s-version`: Installed k8s version, such as v1.24.3
25-
- `calico-version`: Installed calico version, such as v3.24.0
26-
- `helm-version`: Installed helm version, such as v3.9.3
23+
- `k3s-version`: Installed k3s version, such as v1.29.0+k3s1
24+
- `k8s-version`: Installed k8s version, such as v1.29.0
25+
- `calico-version`: Installed calico version, such as v3.27.0
26+
- `helm-version`: Installed helm version, such as v3.13.0
2727

2828
## Example
2929

action.yml

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,6 @@ runs:
103103
echo "::group::Setup cri-dockerd as a dockershim"
104104
cd /tmp
105105
106-
# Keep using cri-dockerd version 0.2.6 for versions 1.20-1.23 as 0.3.0+
107-
# doesn't support them any more.
108-
v=${{ inputs.k3s-version }}${{ inputs.k3s-channel }}
109-
if [[ "$v" == v1.20* ]] || [[ "$v" == v1.21* ]] || [[ "$v" == v1.22* ]] || [[ "$v" == v1.23* ]]; then
110-
CRI_DOCKERD_VERSION=0.2.6
111-
fi
112-
113106
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
114107
chmod +x cri-dockerd
115108
sudo mv cri-dockerd /usr/bin/
@@ -153,30 +146,14 @@ runs:
153146
k3s_docker=--container-runtime-endpoint=/run/cri-dockerd.sock
154147
fi
155148
# We want to provide a new default value for the --egress-selector-mode
156-
# flag to workaround the intermittent issue tracked here:
149+
# flag to avoid an intermittent issue possibly not fully resolved:
157150
# https://github.com/k3s-io/k3s/issues/5633#issuecomment-1181424511.
158151
#
152+
# Details about the option available at
153+
# https://docs.k3s.io/installation/network-options#control-plane-egress-selector-configuration.
154+
#
159155
if [[ "${{ inputs.extra-setup-args }}" != *--egress-selector-mode* ]]; then
160-
# We check for k3s versions 1.22.10+, 1.23.7+, or 1.24.1+ or more
161-
# recent where we know the --egress-selector-mode flag is defined.
162-
# This includes when the version isn't specified or is specified as
163-
# latest or stable.
164-
#
165-
# The verlte function was taken from this stackoverflow post:
166-
# https://stackoverflow.com/a/4024263/2220152
167-
#
168-
verlte() {
169-
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
170-
}
171-
# If a k3s channel is specified we append a patch version of 99 to it
172-
# to ensure our verlte comparisons below functions as intended.
173-
#
174-
c=${{ inputs.k3s-channel }}
175-
c=${c:+$c.99}
176-
v=${{ inputs.k3s-version }}${c}
177-
if ([[ "$v" != v* ]]) || ([[ "$v" == v1.22.* ]] && verlte "v1.22.10" "$v") || ([[ "$v" == v1.23.* ]] && verlte "v1.23.7" "$v") || (verlte "v1.24.1" "$v"); then
178-
default_extra_setup_args=--egress-selector-mode=disabled
179-
fi
156+
default_extra_setup_args=--egress-selector-mode=disabled
180157
fi
181158
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="${{ inputs.k3s-version }}" INSTALL_K3S_CHANNEL="${{ inputs.k3s-channel }}" sh -s - \
182159
${k3s_disable_metrics} \
@@ -214,11 +191,7 @@ runs:
214191
- name: Setup calico
215192
run: |
216193
echo "::group::Setup calico"
217-
if [[ "${{ inputs.k3s-version }}${{ inputs.k3s-channel }}" == v1.20* ]]; then
218-
curl -sfL --output /tmp/calico.yaml https://docs.projectcalico.org/v3.21/manifests/calico.yaml
219-
else
220-
curl -sfL --output /tmp/calico.yaml https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/calico.yaml
221-
fi
194+
curl -sfL --output /tmp/calico.yaml https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/calico.yaml
222195
cat /tmp/calico.yaml \
223196
| sed '/"type": "calico"/a\
224197
"container_settings": {\

0 commit comments

Comments
 (0)