Merge pull request #329 from BlaineEXE/make-master-and-release-multi-arch-manifests

build & use multi-arch manifests for doc/crds
This commit is contained in:
Miguel Duarte Barroso 2023-05-22 20:56:37 +02:00 committed by GitHub
commit fbd57ab684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 97 additions and 6 deletions

View File

@ -58,3 +58,25 @@ jobs:
tags: ghcr.io/${{ github.repository }}:latest-arm64
file: Dockerfile.arm64
platforms: linux/arm64
build-multi-arch:
name: Image build multi-arch
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build container image
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: ghcr.io/${{ github.repository }}:latest
file: Dockerfile
platforms: linux/amd64, linux/arm64

View File

@ -89,3 +89,33 @@ jobs:
tags: ghcr.io/${{ github.repository }}:latest-arm64
file: Dockerfile.arm64
platforms: linux/arm64
push-multi-arch:
name: Image build multi-arch
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Container Registry
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest
file: Dockerfile
platforms: linux/amd64, linux/arm64

View File

@ -79,3 +79,42 @@ jobs:
${{ steps.docker_meta.outputs.tags }}-arm64
file: Dockerfile
platforms: linux/arm64
push-multi-arch:
name: Image push multi-arch
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Container Registry
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/${{ github.repository }}
tag-latest: false
- name: Push container image
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
${{ steps.docker_meta.outputs.tags }}
file: Dockerfile
platforms: linux/amd64, linux/arm64

View File

@ -91,10 +91,8 @@ spec:
app: whereabouts
name: whereabouts
spec:
hostNetwork: true
hostNetwork: true
serviceAccountName: whereabouts
nodeSelector:
kubernetes.io/arch: amd64
tolerations:
- operator: Exists
effect: NoSchedule
@ -106,7 +104,7 @@ spec:
- >
SLEEP=false /install-cni.sh &&
/ip-control-loop -log-level debug
image: ghcr.io/k8snetworkplumbingwg/whereabouts:latest-amd64
image: ghcr.io/k8snetworkplumbingwg/whereabouts:latest
env:
- name: NODENAME
valueFrom:

View File

@ -26,7 +26,7 @@ KIND_CLUSTER_NAME="whereabouts"
OCI_BIN="${OCI_BIN:-"docker"}"
IMG_PROJECT="whereabouts"
IMG_REGISTRY="ghcr.io/k8snetworkplumbingwg"
IMG_TAG="latest-amd64"
IMG_TAG="latest"
IMG_NAME="$IMG_REGISTRY/$IMG_PROJECT:$IMG_TAG"
create_cluster() {
@ -99,7 +99,9 @@ kind load image-archive --name "$KIND_CLUSTER_NAME" /tmp/whereabouts-img.tar
echo "## install whereabouts"
for file in "daemonset-install.yaml" "whereabouts.cni.cncf.io_ippools.yaml" "whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml"; do
retry kubectl apply -f "$ROOT/doc/crds/$file"
# insert 'imagePullPolicy: Never' under the container 'image' so it is certain that the image used
# by the daemonset is the one loaded into KinD and not one pulled from a repo
sed '/ image:/a\ imagePullPolicy: Never' "$ROOT/doc/crds/$file" | retry kubectl apply -f -
done
retry kubectl wait -n kube-system --for=condition=ready -l app=whereabouts pod --timeout=$TIMEOUT_K8
echo "## done"