Skip to content

Commit

Permalink
feat: add multi-arch support for thick plugin (#1)
Browse files Browse the repository at this point in the history
* feat: add multi-arch support for thick plugin
  • Loading branch information
fishgrimsby authored Feb 17, 2024
1 parent ca5a4c9 commit 12d4fa7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
sbom: false
provenance: false

build-amd64-thick:
name: Image build/amd64 thick plugin
build-thick:
name: Image build thick plugin
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
Expand All @@ -50,8 +50,9 @@ jobs:
with:
context: .
push: false
tags: ghcr.io/${{ github.repository }}:latest-amd64-thick
tags: ghcr.io/${{ github.repository }}:latest-thick
file: images/Dockerfile.thick
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x

build-origin:
name: Image build/origin
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/image-push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
branches:
- master
env:
image-push-owner: 'k8snetworkplumbingwg'
image-push-owner: 'fishgrimsby'
jobs:
push-thick-amd64:
name: Image push thick image/amd64
push-thick:
name: Image push thick image
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
Expand All @@ -34,7 +34,7 @@ jobs:
ghcr.io/${{ github.repository }}:latest-thick
ghcr.io/${{ github.repository }}:snapshot-thick
file: images/Dockerfile.thick
platforms: linux/amd64
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x

push-thin:
name: Image push thin image
Expand Down Expand Up @@ -94,15 +94,15 @@ jobs:
# uses: docker/setup-buildx-action@v3
#
# - name: Login to GitHub Container Registry
# if: github.repository_owner == 'k8snetworkplumbingwg'
# if: github.repository_owner == 'fishgrimsby'
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Push container image
# if: github.repository_owner == 'k8snetworkplumbingwg'
# if: github.repository_owner == 'fishgrimsby'
# uses: docker/build-push-action@v5
# with:
# context: .
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/image-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
tags:
- v*
env:
image-push-owner: 'k8snetworkplumbingwg'
image-push-owner: 'fishgrimsby'
jobs:
push-thick-amd64:
name: Image push thick image/amd64
push-thick:
name: Image push thick image
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
ghcr.io/${{ github.repository }}:stable-thick
${{ steps.docker_meta.outputs.tags }}-thick
file: images/Dockerfile.thick
platforms: linux/amd64
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x

push-thin:
name: Image push thin image/amd64
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
# uses: docker/setup-buildx-action@v3
#
# - name: Login to GitHub Container Registry
# if: github.repository_owner == 'k8snetworkplumbingwg'
# if: github.repository_owner == 'fishgrimsby'
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
Expand All @@ -125,7 +125,7 @@ jobs:
# tag-latest: false
#
# - name: Push container image
# if: github.repository_owner == 'k8snetworkplumbingwg'
# if: github.repository_owner == 'fishgrimsby'
# uses: docker/build-push-action@v5
# with:
# context: .
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
> [!NOTE]
> This fork provides arm64 and other architecture builds for [multus-cni thick plugin](deployments/multus-daemonset-thick.yaml) as the official repo only builds for amd64.
# Multus-CNI

![multus-cni Logo](https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/docs/images/Multus.png)

[![Build](https://github.com/k8snetworkplumbingwg/multus-cni/actions/workflows/build.yml/badge.svg)](https://github.com/k8snetworkplumbingwg/multus-cni/actions/workflows/build.yml)[![Test](https://github.com/k8snetworkplumbingwg/multus-cni/actions/workflows/test.yml/badge.svg)](https://github.com/k8snetworkplumbingwg/multus-cni/actions/workflows/test.yml)[![Go Report Card](https://goreportcard.com/badge/github.com/k8snetworkplumbingwg/multus-cni)](https://goreportcard.com/report/github.com/k8snetworkplumbingwg/multus-cni)[![Coverage Status](https://coveralls.io/repos/github/k8snetworkplumbingwg/multus-cni/badge.svg)](https://coveralls.io/github/k8snetworkplumbingwg/multus-cni)
[![Build](https://github.com/fishgrimsby/multus-cni/actions/workflows/build.yml/badge.svg)](https://github.com/fishgrimsby/multus-cni/actions/workflows/build.yml)[![Test](https://github.com/fishgrimsby/multus-cni/actions/workflows/test.yml/badge.svg)](https://github.com/fishgrimsby/multus-cni/actions/workflows/test.yml)[![Go Report Card](https://goreportcard.com/badge/github.com/fishgrimsby/multus-cni)](https://goreportcard.com/report/github.com/fishgrimsby/multus-cni)[![Coverage Status](https://coveralls.io/repos/github/fishgrimsby/multus-cni/badge.svg)](https://coveralls.io/github/fishgrimsby/multus-cni)

Multus CNI enables attaching multiple network interfaces to pods in Kubernetes.

Expand Down Expand Up @@ -46,8 +49,8 @@ cat ./deployments/multus-daemonset.yml | kubectl apply -f -

In addition to the [quick-start guide](docs/quickstart.md), you may:

- Download binaries from [release page](https://github.com/k8snetworkplumbingwg/multus-cni/releases)
- By Docker image from [GitHub Container Registry](https://github.com/orgs/k8snetworkplumbingwg/packages/container/package/multus-cni)
- Download binaries from [release page](https://github.com/fishgrimsby/multus-cni/releases)
- By Docker image from [GitHub Container Registry](https://github.com/orgs/fishgrimsby/packages/container/package/multus-cni)
- Or, roll-your-own and build from source
- See [Development](docs/development.md)

Expand Down
4 changes: 2 additions & 2 deletions deployments/multus-daemonset-thick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ spec:
serviceAccountName: multus
containers:
- name: kube-multus
image: ghcr.io/k8snetworkplumbingwg/multus-cni:snapshot-thick
image: ghcr.io/fishgrimsby/multus-cni:snapshot-thick
command: [ "/usr/src/multus-cni/bin/multus-daemon" ]
resources:
requests:
Expand Down Expand Up @@ -197,7 +197,7 @@ spec:
fieldPath: spec.nodeName
initContainers:
- name: install-multus-binary
image: ghcr.io/k8snetworkplumbingwg/multus-cni:snapshot-thick
image: ghcr.io/fishgrimsby/multus-cni:snapshot-thick
command:
- "cp"
- "/usr/src/multus-cni/bin/multus-shim"
Expand Down
3 changes: 2 additions & 1 deletion images/Dockerfile.thick
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# This Dockerfile is used to build the image available on DockerHub
FROM golang:1.21 as build
FROM --platform=$BUILDPLATFORM golang:1.21 as build

# Add everything
ADD . /usr/src/multus-cni

ARG TARGETPLATFORM
RUN cd /usr/src/multus-cni && \
./hack/build-go.sh

Expand Down

0 comments on commit 12d4fa7

Please sign in to comment.