Skip to content

Commit

Permalink
Build multi-arch controller images (#153)
Browse files Browse the repository at this point in the history
By default we build the controller for all architectured supported by
the default base image `gcr.io/distroless/static:nonroot`. Including:
- linux/arm64
- linux/arm
- linux/ppc64le
- linux/s390x
- linux/amd64

At development time, a subset can be built by setting KO_PLATFORMS:

```
KO_PLATFORMS=linux/amd64 make deploy
```

Signed-off-by: Scott Andrews <andrewssc@vmware.com>
  • Loading branch information
scothis committed Aug 5, 2022
1 parent 15404ab commit f4c659c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
echo "##[group]Build"
cat hack/boilerplate.yaml.txt > "${scratch}/config/servicebinding-runtime.yaml"
${KO} resolve -f config/servicebinding-runtime.yaml >> "${scratch}/config/servicebinding-runtime.yaml"
${KO} resolve --platform all -f config/servicebinding-runtime.yaml >> "${scratch}/config/servicebinding-runtime.yaml"
${KBLD} -f "${scratch}/config/servicebinding-runtime.yaml" --imgpkg-lock-output "${scratch}/.imgpkg/images.yml" > /dev/null
echo "##[endgroup]"
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ YTT ?= go run -modfile hack/ytt/go.mod github.com/vmware-tanzu/carvel-ytt/cmd/yt
KAPP_APP ?= servicebinding-runtime
KAPP_APP_NAMESPACE ?= default

KO_PLATFORMS ?= all

# Setting SHELL to bash allows bash commands to be executed by recipes.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
Expand Down Expand Up @@ -73,7 +75,7 @@ test: manifests generate fmt vet ## Run tests.

.PHONY: deploy
deploy: manifests ## Deploy controller to the K8s cluster specified in ~/.kube/config.
$(KAPP) deploy -a $(KAPP_APP) -n $(KAPP_APP_NAMESPACE) -c -f config/kapp -f <($(KO) resolve -f config/servicebinding-runtime.yaml)
$(KAPP) deploy -a $(KAPP_APP) -n $(KAPP_APP_NAMESPACE) -c -f config/kapp -f <($(KO) resolve --platform $(KO_PLATFORMS) -f config/servicebinding-runtime.yaml)

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
Expand Down

0 comments on commit f4c659c

Please sign in to comment.