Skip to content

Commit dd5b8bc

Browse files
authored
Merge pull request #4083 from camilamacedo86/improve-doc-art
📖 (cleanup and enhance) improve and make clear info about setup envtest and its binaries and that old location is deprecated
2 parents 7b21ee0 + 10e5ab5 commit dd5b8bc

File tree

3 files changed

+59
-41
lines changed

3 files changed

+59
-41
lines changed

RELEASE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ This action will caall the job [./build/.goreleaser.yml](./build/.goreleaser.yml
7272

7373
### (Deprecated) - To build the Kubebuilder-tools: (Artifacts required to use ENV TEST)
7474

75-
> We are working on to move all out from GCP Kubebuilder project. As it fits as part of Controller-Runtime domain of responsability it is under a ongoing work to change the build of those binaries to controller-tools and how it is implemented in controller-runtime. For further information see the PR: https://github.com/kubernetes-sigs/controller-runtime/pull/2811
75+
> We no longer build the artifacts and the promotion of those is deprecated. For more info
76+
see: https://github.com/kubernetes-sigs/kubebuilder/discussions/4082
7677

7778
Kubebuilder projects requires artifacts which are used to do test with ENV TEST (when we call `make test` target)
7879
These artifacts can be checked in the service page: https://storage.googleapis.com/kubebuilder-tools
@@ -86,7 +87,7 @@ For further information see the [README](https://github.com/kubernetes-sigs/kube
8687

8788
### (Deprecated) - To build the `kube-rbac-proxy` images:
8889

89-
> We no longer build and promote those images. For more info
90+
> We no longer build the images and the promotion of those images is deprecated. For more info
9091
see: https://github.com/kubernetes-sigs/kubebuilder/discussions/3907
9192

9293
These images are built from the project [brancz/kube-rbac-proxy](https://github.com/brancz/kube-rbac-proxy).

docs/book/src/reference/artifacts.md

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,61 @@
11
# Artifacts
22

3-
# Artifacts
3+
To test your controllers, you will need to use the tarballs containing the required binaries:
44

5-
<aside class="note warning">
6-
<h1>IMPORTANT: Kubebuilder no longer produces artifacts</h1>
5+
```shell
6+
./bin/k8s/
7+
└── 1.25.0-darwin-amd64
8+
├── etcd
9+
├── kube-apiserver
10+
└── kubectl
11+
```
712

8-
Kubebuilder has been building those artifacts binaries to allow users
9-
to use the [ENV TEST][env-test-doc] functionality provided by [controller-runtime][controller-runtime]
10-
for several years. However, Google Cloud Platform has [deprecated the Container Registry](https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr),
11-
which has been used to build and promote these binaries tarballs.
13+
These tarballs are released by [controller-tools](https://github.com/kubernetes-sigs/controller-tools),
14+
and you can find the list of available versions at: [envtest-releases.yaml](https://github.com/kubernetes-sigs/controller-tools/blob/main/envtest-releases.yaml).
1215

13-
Additionally, ongoing changes and the phase-out of the previous GCP infrastructure mean
14-
that **Kubebuilder maintainers are no longer able to build or ensure the promotion of these binaries.**
16+
When you run `make envtest` or `make test`, the necessary tarballs are downloaded and properly
17+
configured for your project.
1518

16-
Therefore, since those have been building to allow the controller-runtime
17-
[ENV TEST][env-test-doc] library to work, it has been started to be built by [controller-runtime][controller-runtime] itself
18-
under the [controller-gen releases page][controller-gen]. From [controller-runtime][controller-runtime]
19-
release `v0.19.0` the binaries will begin to be pulled out from this page instead.
20-
For more information, see the PR that introduces this change [here](https://github.com/kubernetes-sigs/controller-runtime/pull/2811).
19+
<aside class="note">
20+
<h1>Setup ENV TEST tool</h1>
21+
22+
To learn more about the tooling used to configure ENVTEST, which is utilized in the `setup-envtest`
23+
target in the Makefile of projects built with Kubebuilder, see the [README](https://github.com/kubernetes-sigs/controller-runtime/blob/main/tools/setup-envtest/README.md)
24+
of its tooling. Additionally, you can find more information by reviewing the Kubebuilder [ENVTEST][env-test-doc] documentation.
2125

2226
</aside>
2327

2428

25-
Kubebuilder publishes test binaries and container images in addition
26-
to the main binary releases.
29+
<aside class="note warning">
30+
<h1>IMPORTANT: Action Required: Ensure that you no longer use https://storage.googleapis.com/kubebuilder-tools </h1>
2731

28-
## **(Deprecated)** - Test Binaries (Used by ENV TEST)
32+
**Artifacts provided under [https://storage.googleapis.com/kubebuilder-tools](https://storage.googleapis.com/kubebuilder-tools) are deprecated and Kubebuilder maintainers are no longer able to support, build, or ensure the promotion of these artifacts.**
2933

30-
You can find test binary tarballs for all Kubernetes versions and host platforms at `https://go.kubebuilder.io/test-tools`.
31-
You can find a test binary tarball for a particular Kubernetes version and host platform at `https://go.kubebuilder.io/test-tools/${version}/${os}/${arch}`.
34+
You will find the [ENVTEST][env-test-doc] binaries available in the new location from k8s release `1.28`, see: [https://github.com/kubernetes-sigs/controller-tools/blob/main/envtest-releases.yaml](https://github.com/kubernetes-sigs/controller-tools/blob/main/envtest-releases.yaml).
35+
Also, binaries to test your controllers after k8s `1.29.3` will no longer be found in the old location.
3236

33-
<aside class="note">
34-
<h1>Setup ENV TEST tool</h1>
35-
To know more about the tooling used to configure ENVTEST which is used in the setup-envtest target in the Makefile
36-
of the projects build with Kubebuilder see the [README][readme]
37-
of its tooling.
38-
</aside>
37+
**New binaries are only promoted in the new location**.
38+
39+
**You should ensure that your projects are using the new location.**
40+
Please ensure you use `setup-envtest` from the controller-runtime `release v0.19.0` to be able to download those.
41+
**This update is fully transparent for Kubebuilder users.**
42+
43+
The artefacts for [ENVTEST][env-test-doc] k8s `1.31` are exclusively available at: [Controller Tools Releases][controller-gen].
3944

45+
You can refer to the Makefile of the Kubebuilder scaffold and observe that the envtest setup is consistently aligned across all controller-runtime releases. Starting from `release-0.19`, it is configured to automatically download the artefact from the correct location, **ensuring that kubebuilder users are not impacted.**
46+
47+
```shell
48+
ENVTEST_K8S_VERSION = 1.31.0
49+
ENVTEST_VERSION ?= release-0.19
50+
...
51+
.PHONY: envtest
52+
envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
53+
$(ENVTEST): $(LOCALBIN)
54+
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
55+
```
56+
57+
</aside>
4058

4159
[env-test-doc]: ./envtest.md
4260
[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
4361
[controller-gen]: https://github.com/kubernetes-sigs/controller-tools/releases
44-
[readme]: https://github.com/kubernetes-sigs/controller-runtime/blob/main/tools/setup-envtest/README.md

docs/book/src/reference/envtest.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@ Kubernetes API server, without kubelet, controller-manager or other components.
88
Installing the binaries is as a simple as running `make envtest`. `envtest` will download the Kubernetes API server binaries to the `bin/` folder in your project
99
by default. `make test` is the one-stop shop for downloading the binaries, setting up the test environment, and running the tests.
1010

11-
The make targets require `bash` to run.
11+
12+
You can refer to the Makefile of the Kubebuilder scaffold and observe that the envtest setup is consistently aligned across all controller-runtime releases. Starting from `release-0.19`, it is configured to automatically download the artefact from the correct location, **ensuring that kubebuilder users are not impacted.**
13+
14+
```shell
15+
ENVTEST_K8S_VERSION = 1.31.0
16+
ENVTEST_VERSION ?= release-0.19
17+
...
18+
.PHONY: envtest
19+
envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
20+
$(ENVTEST): $(LOCALBIN)
21+
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
22+
```
1223

1324
## Installation in Air Gapped/disconnected environments
1425
If you would like to download the tarball containing the binaries, to use in a disconnected environment you can use
@@ -25,7 +36,7 @@ make envtest
2536
Installing the binaries using `setup-envtest` stores the binary in OS specific locations, you can read more about them
2637
[here](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest#where-does-it-put-all-those-binaries)
2738
```sh
28-
./bin/setup-envtest use 1.21.2
39+
./bin/setup-envtest use 1.31.0
2940
```
3041

3142
### Update the test make target
@@ -42,15 +53,6 @@ NOTE: The `ENVTEST_K8S_VERSION` needs to match the `setup-envtest` you downloade
4253
no such version (1.24.5) exists on disk for this architecture (darwin/amd64) -- try running `list -i` to see what's on disk
4354
```
4455
45-
## Kubernetes 1.20 and 1.21 binary issues
46-
47-
There have been many reports of the `kube-apiserver` or `etcd` binary [hanging during cleanup][cr-1571]
48-
or misbehaving in other ways. We recommend using the 1.19.2 tools version to circumvent such issues,
49-
which do not seem to arise in 1.22+. This is likely NOT the cause of a `fork/exec: permission denied`
50-
or `fork/exec: not found` error, which is caused by improper tools installation.
51-
52-
[cr-1571]:https://github.com/kubernetes-sigs/controller-runtime/issues/1571
53-
5456
## Writing tests
5557
5658
Using `envtest` in integration tests follows the general flow of:
@@ -97,8 +99,6 @@ Ie,
9799
├── etcd
98100
├── kube-apiserver
99101
└── kubectl
100-
101-
1 directory, 3 files
102102
```
103103
104104
You can use environment variables and/or flags to specify the `kubectl`,`api-server` and `etcd` setup within your integration tests.

0 commit comments

Comments
 (0)