Skip to content

Commit

Permalink
added support for multiarch (#81)
Browse files Browse the repository at this point in the history
* added support for multiarch

Signed-off-by: raffaelespazzoli <[email protected]>

* removedn s390x

Signed-off-by: raffaelespazzoli <[email protected]>
  • Loading branch information
raffaelespazzoli committed Aug 27, 2021
1 parent edef82f commit 4451763
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 5 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

# - uses: shivanshs9/setup-k8s-operator-sdk@v1
# with:
# version: "1.9.0" # The operator-sdk version to download (if necessary) and use.

- name: Download operator sdk
shell: bash
env:
Expand All @@ -48,3 +52,29 @@ jobs:
- name: build chart
shell: bash
run: make helmchart VERSION=0.0.1 IMG=quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY):0.0.1

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: "Build Operator Image"
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
push: false
tags: "quay.io/${{ github.repository_owner }}/${{ env.REPOSITORY_NAME }}:v0.0.1"

- name: "Build Bundle Image"
uses: docker/build-push-action@v2
with:
context: .
file: ./bundle.Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
push: false
tags: "quay.io/${{ github.repository_owner }}/${{ env.REPOSITORY_NAME }}-bundle:0.0.1"
14 changes: 13 additions & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

# - uses: shivanshs9/setup-k8s-operator-sdk@v1
# with:
# version: "1.9.0" # The operator-sdk version to download (if necessary) and use.

- name: Download operator sdk
shell: bash
env:
Expand All @@ -46,7 +50,7 @@ jobs:
echo "BUNDLE_IMAGE_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
export TAG=${GITHUB_REF/refs\/tags\//}
echo "BUNDLE_VERSION=${TAG:1}" >> $GITHUB_ENV
export SEMVER_COMPLIANT=$(echo ${TAG:1} | egrep '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-])(?:\.(?:0|[1-9]\d|\d*[a-zA-Z-][0-9a-zA-Z-]))))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')
export SEMVER_COMPLIANT=$(echo ${TAG:1} | egrep '^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-((?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')
if [ -z "$SEMVER_COMPLIANT" ]; then echo "invalid semver tag ${GITHUB_REF/refs\/tags\//}"; exit 1; fi
- name: Get the version for merge
Expand Down Expand Up @@ -77,6 +81,8 @@ jobs:

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand All @@ -93,6 +99,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
push: true
tags: "quay.io/${{ github.repository_owner }}/${{ env.REPOSITORY_NAME }}:${{ env.OPERATOR_IMAGE_TAG }}"

Expand All @@ -101,6 +108,7 @@ jobs:
with:
context: .
file: ./bundle.Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
push: true
tags: "quay.io/${{ github.repository_owner }}/${{ env.REPOSITORY_NAME }}-bundle:${{ env.BUNDLE_IMAGE_TAG }}"

Expand Down Expand Up @@ -216,6 +224,10 @@ jobs:
with:
go-version: ^1.16

# - uses: shivanshs9/setup-k8s-operator-sdk@v1
# with:
# version: "1.9.0" # The operator-sdk version to download (if necessary) and use.

- name: Download operator sdk
shell: bash
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY api/ api/
COPY controllers/ controllers/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: kube-rbac-proxy
image: quay.io/coreos/kube-rbac-proxy:v0.5.0
image: registry.redhat.io/openshift4/ose-kube-rbac-proxy@sha256:6d57bfd91fac9b68eb72d27226bc297472ceb136c996628b845ecc54a48b31cb
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
Expand Down
4 changes: 2 additions & 2 deletions config/helmchart/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ affinity: {}

kube_rbac_proxy:
image:
repository: quay.io/coreos/kube-rbac-proxy
repository: gcr.io/kubebuilder/kube-rbac-proxy
pullPolicy: IfNotPresent
tag: v0.5.0
tag: v0.8.0
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ metadata:
operators.openshift.io/infrastructure-features: '["Disconnected"]'
name: egressip-ipam-operator.v0.0.0
namespace: placeholder
labels:
operatorframework.io/os.linux: supported
operatorframework.io/arch.amd64: supported
operatorframework.io/arch.arm64: supported
operatorframework.io/arch.ppc64le: supported
spec:
apiservicedefinitions: {}
customresourcedefinitions:
Expand Down
9 changes: 9 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@ This is a cluster-level operator that you can deploy in any namespace, `egressip

It is recommended to deploy this operator via [`OperatorHub`](https://operatorhub.io/), but you can also deploy it using [`Helm`](https://helm.sh/).

### Multiarch Support

| Arch | Support |
|:-:|:-:|
| amd64 | ✅ |
| arm64 | ✅ |
| ppc64le | ✅ |
| s390x | ❌ |

### Deploying from OperatorHub

> **Note**: This operator supports being installed disconnected environments
Expand Down

0 comments on commit 4451763

Please sign in to comment.