diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5f34056..600859f 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -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: @@ -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" diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 02660e3..1804955 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -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: @@ -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 @@ -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 @@ -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 }}" @@ -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 }}" @@ -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: diff --git a/Dockerfile b/Dockerfile index 2844e00..9422c5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index f5ded83..fb1ce72 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -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/" diff --git a/config/helmchart/values.yaml.tpl b/config/helmchart/values.yaml.tpl index 778a7c5..55dfe1b 100644 --- a/config/helmchart/values.yaml.tpl +++ b/config/helmchart/values.yaml.tpl @@ -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 diff --git a/config/manifests/bases/egressip-ipam-operator.clusterserviceversion.yaml b/config/manifests/bases/egressip-ipam-operator.clusterserviceversion.yaml index 82d6f89..b9a2fe4 100644 --- a/config/manifests/bases/egressip-ipam-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/egressip-ipam-operator.clusterserviceversion.yaml @@ -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: diff --git a/readme.md b/readme.md index 4858cd3..19d723d 100644 --- a/readme.md +++ b/readme.md @@ -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