From 7978b317553c10c0a75886e22b756ef03d936cc7 Mon Sep 17 00:00:00 2001 From: Kunju Perath Date: Thu, 20 Oct 2022 22:27:03 -0600 Subject: [PATCH] add steps on building this project for M1 users --- Makefile | 4 ++++ README.md | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 80509cec..3d8206e3 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,11 @@ KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/k .PHONY: kustomize kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. $(KUSTOMIZE): $(LOCALBIN) +ifeq ("$(wildcard $(KUSTOMIZE))","") curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN) +else + $(info Using preexisting ${KUSTOMIZE}) +endif .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. diff --git a/README.md b/README.md index 9dffaf97..d6c94ece 100644 --- a/README.md +++ b/README.md @@ -61,12 +61,14 @@ Make sure you are aware of [DigitalOcean's pricing](https://www.digitalocean.com make install ``` -2. Build and push your image to the location specified by `IMG`: - +**Note M1 Macbook users:** this project is made with Kubebuilder which uses `Kustomize v3.8.7` which doesn't have an ARM release and so you need to [manually install kustomize](#manually-installing-kustomize-m1-mac-users) for this step to succeed + +2. Build and push your image to the location specified by `IMG` (in the [Makefile](Makefile)): + ```sh make docker-build docker-push IMG=/do-operator:tag ``` - + 3. [Deploy cert-manager](https://cert-manager.io/docs/installation/), which is necessary to manage certificates for the webhooks. 4. Generate a [DigitalOcean API token](https://docs.digitalocean.com/reference/api/create-personal-access-token/) to use for testing. @@ -103,6 +105,13 @@ To delete the CRDs from the cluster: make uninstall ``` +### Manually Installing Kustomize (M1 Mac users) +1. Clone the [Kustomize project](https://github.com/kubernetes-sigs/kustomize) +2. Go to the `v3.5.7` branch: `git checkout kustomize/v3.8.7` +3. Go into the `kustomize` folder (so from the project root it would be `kustomize/kustomize/`) +4. `go build .` +5. Now move the generated `kustomize` binary into the `bin` directory in this project (create it if it doesn't exist `mkdir bin`): `mv kustomize /bin/kustomize` + ## Contributing At DigitalOcean we value and love our community!