diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..6271fdb --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,23 @@ +name: Push Multiarch Images +on: + pull_request: + push: + branches: + - main + +jobs: + build-and-push-arch-specifics: + name: Build Rocks and Push Arch Specific Images + uses: canonical/k8s-workflows/.github/workflows/build_rocks.yaml@main + with: + owner: ${{ github.repository_owner }} + trivy-image-config: "trivy.yaml" + multiarch-awareness: true + cache-action: ${{ (github.event_name == 'push') && 'save' || 'restore' }} + build-and-push-multiarch-manifest: + name: Combine Rocks and Push Multiarch Manifest + uses: canonical/k8s-workflows/.github/workflows/assemble_multiarch_image.yaml@main + needs: [build-and-push-arch-specifics] + with: + rock-metas: ${{ needs.build-and-push-arch-specifics.outputs.rock-metas }} + dry-run: ${{ github.event_name != 'push' }} diff --git a/rockcraft.yaml b/rockcraft.yaml new file mode 100644 index 0000000..f9d578e --- /dev/null +++ b/rockcraft.yaml @@ -0,0 +1,37 @@ +name: metrics-server +summary: ROCK for the metrics-server Project. +description: This ROCK is a drop in replacement for the metrics-server/metrics-server image. +version: "0.7.0" +license: Apache-2.0 + +base: bare +build-base: ubuntu@22.04 +platforms: + amd64: + # TODO: Add after workflows support bulding arm64 ROCKs + # arm64: + +services: + metrics-server: + override: replace + summary: "metrics-server service" + startup: enabled + command: "/metrics-server [ ]" + on-failure: shutdown + +entrypoint-service: metrics-server + +parts: + metrics-server: + plugin: nil + source: https://github.com/kubernetes-sigs/metrics-server.git + source-type: git + source-tag: v0.7.0 + source-depth: 1 + build-packages: + - build-essential + build-snaps: + - go/1.21/stable + override-build: | + make + cp $CRAFT_PART_BUILD/metrics-server $CRAFT_PART_INSTALL diff --git a/trivy.yaml b/trivy.yaml new file mode 100644 index 0000000..c895d69 --- /dev/null +++ b/trivy.yaml @@ -0,0 +1,3 @@ +timeout: 20m +scan: + offline-scan: true