Skip to content

Commit

Permalink
Merge pull request #34 from digitalocean/kperath/m1-kustomize-bypass
Browse files Browse the repository at this point in the history
add steps on building this project for M1 users
  • Loading branch information
kperath committed Oct 25, 2022
2 parents 1abf73d + 7978b31 commit 5015407
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<some-registry>/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.
Expand Down Expand Up @@ -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 <project path>/bin/kustomize`

## Contributing

At DigitalOcean we value and love our community!
Expand Down

0 comments on commit 5015407

Please sign in to comment.