Skip to content

Commit 984816b

Browse files
authored
Merge pull request #2062 from estroz/docs/update-redirects
📖 update redirects for v3.0.0
2 parents 2b46403 + bc7ce7d commit 984816b

File tree

3 files changed

+76
-64
lines changed

3 files changed

+76
-64
lines changed

docs/book/src/quick-start.md

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,23 @@ Projects created by Kubebuilder contain a Makefile that will install tools at ve
2222
- [controller-gen](https://github.com/kubernetes-sigs/controller-tools)
2323

2424
The versions which are defined in the `Makefile` and `go.mod` files are the versions tested and therefore is recommend to use the specified versions.
25-
25+
2626
</aside>
2727

2828
## Installation
2929

3030
Install [kubebuilder](https://sigs.k8s.io/kubebuilder):
3131

3232
```bash
33-
os=$(go env GOOS)
34-
arch=$(go env GOARCH)
35-
36-
# download kubebuilder and extract it to tmp
37-
curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/
38-
```
39-
40-
If you are using a Kubebuilder plugin version less than version `v3+`, you must configure the Kubernetes binaries required for the [envtest][envtest], run:
41-
42-
```bash
43-
# move to a long-term location and put it on your path
44-
# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else)
45-
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder
46-
export PATH=$PATH:/usr/local/kubebuilder/bin
33+
# download kubebuilder and install locally.
34+
curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$(go env GOOS)/$(go env GOARCH)
35+
chmod +x kubebuilder && mv kubebuilder /usr/local/bin/
4736
```
4837

4938
<aside class="note">
5039
<h1>Using master branch</h1>
5140

52-
Also, you can install a master snapshot from `https://go.kubebuilder.io/dl/latest/${os}/${arch}`.
41+
You can work with a master snapshot by installing from `https://go.kubebuilder.io/dl/master/$(go env GOOS)/$(go env GOARCH)`.
5342

5443
</aside>
5544

@@ -65,25 +54,18 @@ Kubebuilder provides autocompletion support for Bash and Zsh via the command `ku
6554
Create a directory, and then run the init command inside of it to initialize a new project. Follows an example.
6655

6756
```bash
68-
mkdir $GOPATH/src/example
69-
cd $GOPATH/src/example
70-
kubebuilder init --domain my.domain
57+
mkdir -p ~/projects/guestbook
58+
cd ~/projects/guestbook
59+
kubebuilder init --domain my.domain --repo my.domain/guestbook
7160
```
7261

7362
<aside class="note">
74-
<h1>Not in $GOPATH</h1>
63+
<h1>Developing in $GOPATH</h1>
7564

76-
If you're not in `GOPATH`, you'll need to run `go mod init <modulename>` in order to tell kubebuilder and Go the base import path of your module.
65+
If your project is initialized within [`GOPATH`][GOPATH-golang-docs], the implicitly called `go mod init` will interpolate the module path for you.
66+
Otherwise `--repo=<module path>` must be set.
7767

78-
For a further understanding of `GOPATH` see [The GOPATH environment variable][GOPATH-golang-docs] in the [How to Write Go Code][how-to-write-go-code-golang-docs] golang page doc.
79-
80-
</aside>
81-
82-
<aside class="note">
83-
<h1>Go package issues</h1>
84-
85-
Ensure that you activate the module support by running `$ export GO111MODULE=on`
86-
to solve issues as `cannot find package ... (from $GOROOT)`.
68+
Read the [Go modules blogpost][go-modules-blogpost] if unfamiliar with the module system.
8769

8870
</aside>
8971

@@ -99,7 +81,7 @@ kubebuilder create api --group webapp --version v1 --kind Guestbook
9981
<aside class="note">
10082
<h1>Press Options</h1>
10183

102-
If you press `y` for Create Resource [y/n] and for Create Controller [y/n] then this will create the files `api/v1/guestbook_types.go` where the API is defined
84+
If you press `y` for Create Resource [y/n] and for Create Controller [y/n] then this will create the files `api/v1/guestbook_types.go` where the API is defined
10385
and the `controllers/guestbook_controller.go` where the reconciliation business logic is implemented for this Kind(CRD).
10486

10587
</aside>
@@ -162,7 +144,7 @@ type Guestbook struct {
162144
</details>
163145

164146

165-
## Test It Out
147+
## Test It Out
166148

167149
You'll need a Kubernetes cluster to run against. You can use
168150
[KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or
@@ -174,7 +156,7 @@ run against a remote cluster.
174156
Your controller will automatically use the current context in your
175157
kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
176158

177-
</aside>
159+
</aside>
178160

179161
Install the CRDs into the cluster:
180162
```bash
@@ -216,7 +198,7 @@ make deploy IMG=<some-registry>/<project-name>:tag
216198
If you encounter RBAC errors, you may need to grant yourself cluster-admin
217199
privileges or be logged in as admin. See [Prerequisites for using Kubernetes RBAC on GKE cluster v1.11.x and older][pre-rbc-gke] which may be your case.
218200

219-
</aside>
201+
</aside>
220202

221203
## Uninstall CRDs
222204

@@ -234,13 +216,13 @@ UnDeploy the controller to the cluster:
234216
make undeploy
235217
```
236218

237-
## Next Step
219+
## Next Step
238220

239-
Now, see the [architecture concept diagram][architecture-concept-diagram] for a better overview and follow up the [CronJob tutorial][cronjob-tutorial] to better understand how it works by developing a demo example project.
221+
Now, see the [architecture concept diagram][architecture-concept-diagram] for a better overview and follow up the [CronJob tutorial][cronjob-tutorial] to better understand how it works by developing a demo example project.
240222

241223
[pre-rbc-gke]: https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#iam-rolebinding-bootstrap
242224
[cronjob-tutorial]: https://book.kubebuilder.io/cronjob-tutorial/cronjob-tutorial.html
243225
[GOPATH-golang-docs]: https://golang.org/doc/code.html#GOPATH
244-
[how-to-write-go-code-golang-docs]: https://golang.org/doc/code.html
226+
[go-module-blogpost]:https://blog.golang.org/using-go-modules
245227
[envtest]: https://book.kubebuilder.io/reference/testing/envtest.html
246-
[architecture-concept-diagram]: architecture.md
228+
[architecture-concept-diagram]: architecture.md

docs/book/src/reference/artifacts.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ to the main binary releases.
55

66
## Test Binaries
77

8-
You can find all of the test binaries at `https://go.kubebuilder.io/test-tools`.
9-
You can find individual test binaries at `https://go.kubebuilder.io/test-tools/${version}/${os}/${arch}`.
8+
You can find test binary tarballs for all Kubernetes versions and host platforms at `https://go.kubebuilder.io/test-tools`.
9+
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}`.
1010

1111
## Container Images
1212

13-
You can find all container images for your os at `https://go.kubebuilder.io/images/${os}`
14-
or at `gcr.io/kubebuilder/thirdparty-${os}`.
15-
You can find individual container images at `https://go.kubebuilder.io/images/${os}/${version}`
16-
or at `gcr.io/kubebuilder/thirdparty-${os}:${version}`.
13+
You can find all container image versions for a particular platform at `https://go.kubebuilder.io/images/${os}/${arch}`
14+
or at `gcr.io/kubebuilder/thirdparty-${os}-${arch}`.
15+
You can find the container image for a particular version and platform at `https://go.kubebuilder.io/images/${os}/${arch}/${version}`
16+
or at `gcr.io/kubebuilder/thirdparty-${os}-${arch}:${version}`.

netlify.toml

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
status = 301
2525
force = true
2626

27-
# Go Links
27+
# kubebuilder binary (v3+) and tarball (< v3) redirects.
2828
[[redirects]]
2929
from = "https://go.kubebuilder.io/dl/*"
3030
to = "https://go.kubebuilder.io/releases/:splat"
@@ -37,9 +37,17 @@
3737
status = 302
3838
force = true
3939

40+
# Development branch redirect.
4041
[[redirects]]
41-
from = "https://go.kubebuilder.io/releases/:version"
42-
to = "https://github.com/kubernetes-sigs/kubebuilder/releases/v:version"
42+
from = "https://go.kubebuilder.io/releases/master/:os/:arch"
43+
to = "https://storage.googleapis.com/kubebuilder-release/kubebuilder_master_:os_:arch.tar.gz"
44+
status = 302
45+
force = true
46+
47+
# Latest redirects.
48+
[[redirects]]
49+
from = "https://go.kubebuilder.io/releases/latest"
50+
to = "https://github.com/kubernetes-sigs/kubebuilder/releases/latest"
4351
status = 302
4452
force = true
4553

@@ -50,47 +58,70 @@
5058
force = true
5159

5260
[[redirects]]
53-
from = "https://go.kubebuilder.io/releases/:version/:os"
54-
to = "https://go.kubebuilder.io/releases/:version/:os/amd64"
61+
from = "https://go.kubebuilder.io/releases/latest/:os/:arch"
62+
to = "https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_:os_:arch"
5563
status = 302
5664
force = true
5765

66+
# v1 redirects.
5867
[[redirects]]
59-
from = "https://go.kubebuilder.io/releases/latest/:os/:arch"
60-
to = "https://storage.googleapis.com/kubebuilder-release/kubebuilder_master_:os_:arch.tar.gz"
68+
from = "https://go.kubebuilder.io/releases/1.:minorpatch/:os/:arch"
69+
to = "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v1.:minorpatch/kubebuilder_1.:minorpatch_:os_:arch.tar.gz"
70+
status = 302
71+
force = true
72+
73+
# v2 redirects.
74+
[[redirects]]
75+
from = "https://go.kubebuilder.io/releases/2.:minorpatch/:os/:arch"
76+
to = "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.:minorpatch/kubebuilder_2.:minorpatch_:os_:arch.tar.gz"
77+
status = 302
78+
force = true
79+
80+
# v3+ redirects.
81+
[[redirects]]
82+
from = "https://go.kubebuilder.io/releases/:version"
83+
to = "https://github.com/kubernetes-sigs/kubebuilder/releases/v:version"
84+
status = 302
85+
force = true
86+
87+
[[redirects]]
88+
from = "https://go.kubebuilder.io/releases/:version/:os"
89+
to = "https://go.kubebuilder.io/releases/:version/:os/amd64"
6190
status = 302
6291
force = true
6392

6493
[[redirects]]
6594
from = "https://go.kubebuilder.io/releases/:version/:os/:arch"
66-
to = "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v:version/kubebuilder_:version_:os_:arch.tar.gz"
95+
to = "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v:version/kubebuilder_:os_:arch"
6796
status = 302
6897
force = true
6998

99+
# Tools redirects.
70100
[[redirects]]
71101
from = "https://go.kubebuilder.io/test-tools"
72102
to = "https://storage.googleapis.com/kubebuilder-tools"
73103
status = 302
74104
force = true
75105

76106
[[redirects]]
77-
from = "https://go.kubebuilder.io/test-tools/:version"
78-
to = "https://storage.googleapis.com/kubebuilder-tools/?prefix=kubebuilder-tools-:version"
107+
from = "https://go.kubebuilder.io/test-tools/:k8sversion"
108+
to = "https://storage.googleapis.com/kubebuilder-tools/?prefix=kubebuilder-tools-:k8sversion"
79109
status = 302
80110
force = true
81111

82112
[[redirects]]
83-
from = "https://go.kubebuilder.io/test-tools/:version/:os"
84-
to = "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-:version-:os-amd64.tar.gz"
113+
from = "https://go.kubebuilder.io/test-tools/:k8sversion/:os"
114+
to = "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-:k8sversion-:os-amd64.tar.gz"
85115
status = 302
86116
force = true
87117

88118
[[redirects]]
89-
from = "https://go.kubebuilder.io/test-tools/:version/:os/:arch"
90-
to = "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-:version-:os-:arch.tar.gz"
119+
from = "https://go.kubebuilder.io/test-tools/:k8sversion/:os/:arch"
120+
to = "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-:k8sversion-:os-:arch.tar.gz"
91121
status = 302
92122
force = true
93123

124+
# Image redirects.
94125
[[redirects]]
95126
from = "https://go.kubebuilder.io/images"
96127
to = "gcr.io/kubebuilder"
@@ -99,20 +130,19 @@
99130

100131
[[redirects]]
101132
from = "https://go.kubebuilder.io/images/:os"
102-
to = "gcr.io/kubebuilder/thirdparty-:os"
133+
to = "https://go.kubebuilder.io/images/:os/amd64"
103134
status = 302
104135
force = true
105136

106137
[[redirects]]
107-
from = "https://go.kubebuilder.io/images/:os/:version"
108-
to = "gcr.io/kubebuilder/thirdparty-:os::version"
138+
from = "https://go.kubebuilder.io/images/:os/:arch"
139+
to = "gcr.io/kubebuilder/thirdparty-:os-:arch"
109140
status = 302
110141
force = true
111142

112-
# TODO(directxman12): change this to standard kustomize when the next version is released (2.1.0)
113143
[[redirects]]
114-
from = "https://go.kubebuilder.io/kustomize/:os/:arch"
115-
to = "https://storage.googleapis.com/kubebuilder-kustomize/kustomize_:os_:arch"
144+
from = "https://go.kubebuilder.io/images/:os/:arch/:k8sversion"
145+
to = "gcr.io/kubebuilder/thirdparty-:os-:arch::k8sversion"
116146
status = 302
117147
force = true
118148

0 commit comments

Comments
 (0)