Skip to content

Commit

Permalink
Merge pull request k8snetworkplumbingwg#329 from BlaineEXE/make-maste…
Browse files Browse the repository at this point in the history
…r-and-release-multi-arch-manifests

build & use multi-arch manifests for doc/crds
  • Loading branch information
maiqueb authored May 22, 2023
2 parents 475be37 + 03a7bb4 commit fbd57ab
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 30 additions & 0 deletions .github/workflows/image-push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 39 additions & 0 deletions .github/workflows/image-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 2 additions & 4 deletions doc/crds/daemonset-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions hack/e2e-setup-kind-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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"

0 comments on commit fbd57ab

Please sign in to comment.