Skip to content

Commit b43ca7e

Browse files
📖 update migration guide
1 parent 0dbbf57 commit b43ca7e

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

docs/book/src/migration/manually_migration_guide_v2_v3.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -353,16 +353,17 @@ Ensure that your `go.mod` is using Go version `1.15` and the following dependenc
353353
```go
354354
module example
355355
356-
go 1.16
356+
go 1.18
357357
358358
require (
359-
github.com/go-logr/logr v0.3.0
360-
github.com/onsi/ginkgo v1.14.1
361-
github.com/onsi/gomega v1.10.2
362-
k8s.io/apimachinery v0.20.2
363-
k8s.io/client-go v0.20.2
364-
sigs.k8s.io/controller-runtime v0.8.3
359+
github.com/onsi/ginkgo v1.16.5
360+
github.com/onsi/gomega v1.18.1
361+
k8s.io/api v0.24.0
362+
k8s.io/apimachinery v0.24.0
363+
k8s.io/client-go v0.24.0
364+
sigs.k8s.io/controller-runtime v0.12.1
365365
)
366+
366367
```
367368

368369
#### Update the golang image
@@ -460,27 +461,33 @@ With:
460461
461462
## Location to install dependencies to
462463
LOCALBIN ?= $(shell pwd)/bin
463-
$(LOCALBIN): ## Ensure that the directory exists
464+
$(LOCALBIN):
464465
mkdir -p $(LOCALBIN)
465466
466467
## Tool Binaries
467468
KUSTOMIZE ?= $(LOCALBIN)/kustomize
468469
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
470+
ENVTEST ?= $(LOCALBIN)/setup-envtest
469471
470472
## Tool Versions
471473
KUSTOMIZE_VERSION ?= v3.8.7
472-
CONTROLLER_TOOLS_VERSION ?= v0.8.0
474+
CONTROLLER_TOOLS_VERSION ?= v0.9.0
473475
474476
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
475477
.PHONY: kustomize
476478
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
477-
$(KUSTOMIZE):
479+
$(KUSTOMIZE): $(LOCALBIN)
478480
curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN)
479481
480482
.PHONY: controller-gen
481483
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
482-
$(CONTROLLER_GEN):
484+
$(CONTROLLER_GEN): $(LOCALBIN)
483485
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
486+
487+
.PHONY: envtest
488+
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
489+
$(ENVTEST): $(LOCALBIN)
490+
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
484491
```
485492

486493
And then, to make your project use the `kustomize` version defined in the Makefile, replace all usage of `kustomize` with `$(KUSTOMIZE)`

docs/book/src/migration/migration_guide_v2tov3.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ go mod init tutorial.kubebuilder.io/migration-project
3939
<aside class="note warning">
4040
<h1> Migrating to Kubebuilder v3 while staying on the go/v2 plugin </h1>
4141

42-
You can use `--plugins=go/v2` if you wish to continue using "`Kubebuilder 2.x`" layout and avoid dealing with the breaking changes that will be faced because of the default upper versions which will be used now. See that the [controller-tools][controller-tools] `v0.5.0` & [controller-runtime][controller-runtime] `v0.8.3` are just used by default with the `go/v3` plugin layout.
42+
You can use `--plugins=go/v2` if you wish to continue using "`Kubebuilder 2.x`" layout.
43+
However, with the legacy layout you are unable to produce projects supported
44+
on Kubernetes versions >= `1.22`. Therefore, it is not recommended.
45+
4346
</aside>
4447

4548
<aside class="note">
@@ -87,9 +90,10 @@ kubebuilder create api --group batch --version v1 --kind CronJob
8790

8891
From now on, the CRDs that will be created by controller-gen will be using the Kubernetes API version `apiextensions.k8s.io/v1` by default, instead of `apiextensions.k8s.io/v1beta1`.
8992

90-
The `apiextensions.k8s.io/v1beta1` was deprecated in Kubernetes `1.16` and will be removed in Kubernetes `1.22`.
93+
The `apiextensions.k8s.io/v1beta1` was deprecated in Kubernetes `1.16` and was removed in Kubernetes `1.22`.
9194

9295
So, if you would like to keep using the previous version use the flag `--crd-version=v1beta1` in the above command which is only needed if you want your operator to support Kubernetes `1.15` and earlier.
96+
However, it is no longer recommended.
9397

9498
</aside>
9599

docs/book/src/migration/v2vsv3.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and [kb-releases][kb-releases] release notes.
99

1010
## Common changes
1111

12-
v3 projects use Go modules and request Go 1.15+. Dep is no longer supported for dependency management.
12+
v3 projects use Go modules and request Go 1.18+. Dep is no longer supported for dependency management.
1313

1414
## Kubebuilder
1515

@@ -19,7 +19,7 @@ v3 projects use Go modules and request Go 1.15+. Dep is no longer supported for
1919

2020
Furthermore, the PROJECT file itself is now versioned: the `version` field corresponds to the version of the PROJECT file itself, while the `layout` field indicates the scaffolding & primary plugin version in use.
2121

22-
- The version of the image `gcr.io/kubebuilder/kube-rbac-proxy`, which is an optional component enabled by default to secure the request made against the manager, was updated from `0.5.0` to `0.8.0` to address security concerns. The details of all changes can be found in [kube-rbac-proxy][kube-rbac-proxy].
22+
- The version of the image `gcr.io/kubebuilder/kube-rbac-proxy`, which is an optional component enabled by default to secure the request made against the manager, was updated from `0.5.0` to `0.11.0` to address security concerns. The details of all changes can be found in [kube-rbac-proxy][kube-rbac-proxy].
2323

2424
## TL;DR of the New `go/v3` Plugin
2525

@@ -41,11 +41,11 @@ Projects scaffolded with Kubebuilder v3 will use the `go.kubebuilder.io/v3` plug
4141
* A new option to create the projects using ComponentConfig is introduced. For more info see its [enhancement proposal][enhancement proposal] and the [Component config tutorial][component-config-tutorial]
4242
* Manager manifests now use `SecurityContext` to address security concerns. More info: [#1637][issue-1637]
4343
- Misc:
44-
* Support for [controller-tools][controller-tools] `v0.5.0` (for `go/v2` it is `v0.3.0` and previously it was `v0.2.5`)
45-
* Support for [controller-runtime][controller-runtime] `v0.8.3` (for `go/v2` it is `v0.6.4` and previously it was `v0.5.0`)
44+
* Support for [controller-tools][controller-tools] `v0.9.0` (for `go/v2` it is `v0.3.0` and previously it was `v0.2.5`)
45+
* Support for [controller-runtime][controller-runtime] `v0.12.1` (for `go/v2` it is `v0.6.4` and previously it was `v0.5.0`)
4646
* Support for [kustomize][kustomize] `v3.8.7` (for `go/v2` it is `v3.5.4` and previously it was `v3.1.0`)
4747
* Required Envtest binaries are automatically downloaded
48-
* The minimum Go version is now `1.15` (previously it was `1.13).
48+
* The minimum Go version is now `1.18` (previously it was `1.13`).
4949

5050
<aside class="note warning">
5151
<h1>Project customizations</h1>

0 commit comments

Comments
 (0)