Skip to content

Commit 59a34b9

Browse files
committed
build: create kind cluster on local colima vm instance
1 parent cd4aed1 commit 59a34b9

File tree

5 files changed

+48
-3
lines changed

5 files changed

+48
-3
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ See [upstream documentation](https://cluster-api.sigs.k8s.io/tasks/experimental-
1111

1212
## Development
1313

14+
Export Docker hub credentials to prevent rate-limited by DockerHub
15+
16+
```shell
17+
export DOCKER_HUB_USERNAME=<DOCKER_HUB_USERNAME>
18+
export DOCKER_HUB_PASSWORD=<DOCKER_HUB_TOKEN>
19+
```
20+
21+
Install [devbox](https://www.jetpack.io/devbox) and development tools
22+
23+
```shell
24+
make devbox
25+
```
26+
1427
To deploy a local build, either initial install to update an existing deployment, run:
1528

1629
```shell

devbox.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"yamllint@latest",
3434
"path:./hack/flakes#go-mod-upgrade",
3535
"path:./hack/flakes#golangci-lint",
36-
"path:./hack/flakes#setup-envtest"
36+
"path:./hack/flakes#setup-envtest",
37+
"colima@latest"
3738
],
3839
"shell": {
3940
"scripts": {

devbox.lock

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,23 @@
6161
}
6262
}
6363
},
64+
"colima@latest": {
65+
"last_modified": "2023-12-31T07:44:09Z",
66+
"resolved": "github:NixOS/nixpkgs/d44d59d2b5bd694cd9d996fd8c51d03e3e9ba7f7#colima",
67+
"source": "devbox-search",
68+
"version": "0.6.7",
69+
"systems": {
70+
"aarch64-darwin": {
71+
"store_path": "/nix/store/r05liknck7104c58m4gbg10afdi23jlc-colima-0.6.7"
72+
},
73+
"aarch64-linux": {
74+
"store_path": "/nix/store/vjrqn84rgnc9fsfwpv7np1klv33xkr6y-colima-0.6.7"
75+
},
76+
"x86_64-linux": {
77+
"store_path": "/nix/store/gkckwqfv6dpynvg7dcgw1f6vcpirkd2g-colima-0.6.7"
78+
}
79+
}
80+
},
6481
"coreutils@latest": {
6582
"last_modified": "2023-12-13T22:54:10Z",
6683
"resolved": "github:NixOS/nixpkgs/fd04bea4cbf76f86f244b9e2549fca066db8ddff#coreutils",

make/dev.mk

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,22 @@
33

44
ADDONS_PROVIDER := ClusterResourceSet
55

6+
.PHONY: devbox
7+
devbox: /usr/local/bin/devbox
8+
/usr/local/bin/devbox install
9+
devbox shell
10+
11+
/usr/local/bin/devbox:
12+
curl -fsSL https://get.jetpack.io/devbox | bash
13+
14+
.PHONY: colima.start
15+
colima.start:
16+
colima start --arch $(shell uname -m)
17+
618
.PHONY: dev.run-on-kind
719
dev.run-on-kind: export KUBECONFIG := $(KIND_KUBECONFIG)
8-
dev.run-on-kind: kind.create clusterctl.init
20+
dev.run-on-kind: export DOCKER_HOST := unix://$(HOME)/.colima/default/docker.sock
21+
dev.run-on-kind: colima.start kind.create clusterctl.init
922
ifndef SKIP_BUILD
1023
$(MAKE) release-snapshot
1124
endif

make/goreleaser.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ release: dockerauth go-generate ; $(info $(M) building release $*)
3131

3232
.PHONY: release-snapshot
3333
release-snapshot: ## Builds a snapshot release with goreleaser
34-
release-snapshot: dockerauth go-generate ; $(info $(M) building snapshot release $*)
34+
release-snapshot: export DOCKER_HOST := unix://$(HOME)/.colima/default/docker.sock
35+
release-snapshot: colima.start dockerauth go-generate ; $(info $(M) building snapshot release $*)
3536
goreleaser --debug=$(GORELEASER_DEBUG) \
3637
release \
3738
--snapshot \

0 commit comments

Comments
 (0)