Skip to content

Commit

Permalink
Support arm64/amd64 for k3s
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinbunney committed Nov 26, 2024
1 parent e1a913e commit 1464dfd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ jobs:
for image in ${IMAGES//,/ }; do
new_image="ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-$(echo $image | sed 's/\//-/')"
echo "Caching $image as $new_image"
docker pull $image
docker tag $image $new_image
docker push $new_image
docker rmi $image
docker pull $image --platform linux/amd64
docker tag $image $new_image-amd64
docker push $new_image-amd64
docker rmi $image
docker pull $image --platform linux/arm64
docker tag $image $new_image-arm64
docker push $new_image-arm64
done
6 changes: 3 additions & 3 deletions scripts/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
server:
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-rancher-k3s:v1.31.2-k3s1
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-rancher-k3s:v1.31.2-k3s1-${ARCH:-amd64}
command: server --disable-agent --tls-san 172.17.0.1 --agent-token somethingtotallyrandom
privileged: true
environment:
Expand All @@ -20,7 +20,7 @@ services:
- 6443:6443

node:
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-rancher-k3s:v1.31.2-k3s1
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-rancher-k3s:v1.31.2-k3s1-${ARCH:-amd64}
command: agent --token somethingtotallyrandom --server https://server:6443
privileged: true
restart: always
Expand All @@ -35,6 +35,6 @@ services:

registry:
platform: linux/amd64
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-registry:2
image: ghcr.io/gavinbunney/terraform-provider-kubectl/testacc-registry:2-amd64
ports:
- 6500:5000
1 change: 1 addition & 0 deletions scripts/start-k3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cd ${DIR}

export KUBECONFIG="${DIR}/kubeconfig.yaml"
export COMPOSE_PROJECT_NAME=k3s
export ARCH=$(uname -m)
export DOCKER_DEFAULT_PLATFORM=linux/$(uname -m)

echo "--> Tearing down k3s in docker-compose"
Expand Down

0 comments on commit 1464dfd

Please sign in to comment.