Skip to content

Commit 0b9318a

Browse files
authored
Bump k8s to 1.29 versions (#6736)
* Bump k8s versions * Bump k8s dependencies to 0.29.3 * Bump other operator-framework lib versions to support k8s 0.29.x * Bump ginkgo/v2 to v2.17.2 TODO: * Update operator-framework/ansible-operator-plugins after operator-framework/ansible-operator-plugins#67 is merged * Add changelog * Regenerate testdata Signed-off-by: Neo2308 <[email protected]> * * Regenerate testdata Signed-off-by: Neo2308 <[email protected]> * * Use [email protected] instead of specific commit. Signed-off-by: Neo2308 <[email protected]> * * Bump up kubebuilder to v3.14.2 * Regenerate testdata Signed-off-by: Neo2308 <[email protected]> * * Updated controller-runtime to v0.17.3 Signed-off-by: Neo2308 <[email protected]> * * Updated ansible-operator-plugins to latest Signed-off-by: Neo2308 <[email protected]> * Added changelog fragment Signed-off-by: Neo2308 <[email protected]> * Use tagged versions for ansible & helm operator plugins Signed-off-by: Neo2308 <[email protected]> * Fix sanity tests Signed-off-by: Neo2308 <[email protected]> * Fix e2e tests Signed-off-by: Neo2308 <[email protected]> * Update java operator plugin version Signed-off-by: Neo2308 <[email protected]> * Use tagged java operator plugin version Signed-off-by: Neo2308 <[email protected]> * Update helm operator plugins to v0.2.2 Signed-off-by: Neo2308 <[email protected]> * Update website config for v1.20 Signed-off-by: Neo2308 <[email protected]> --------- Signed-off-by: Neo2308 <[email protected]>
1 parent e95abdb commit 0b9318a

File tree

103 files changed

+1255
-1108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1255
-1108
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export IMAGE_VERSION = v1.35.0
99
export SIMPLE_VERSION = $(shell (test "$(shell git describe --tags)" = "$(shell git describe --tags --abbrev=0)" && echo $(shell git describe --tags)) || echo $(shell git describe --tags --abbrev=0)+git)
1010
export GIT_VERSION = $(shell git describe --dirty --tags --always)
1111
export GIT_COMMIT = $(shell git rev-parse HEAD)
12-
export K8S_VERSION = 1.28.0
12+
export K8S_VERSION = 1.29.0
1313

1414
# Build settings
1515
export TOOLS_DIR = tools/bin
+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
- Upgrade Kubernetes dependencies from `1.28` to `1.29`.
6+
7+
# kind is one of:
8+
# - addition
9+
# - change
10+
# - deprecation
11+
# - removal
12+
# - bugfix
13+
kind: "change"
14+
15+
# Is this a breaking change?
16+
breaking: false
17+
18+
# NOTE: ONLY USE `pull_request_override` WHEN ADDING THIS
19+
# FILE FOR A PREVIOUSLY MERGED PULL_REQUEST!
20+
#
21+
# The generator auto-detects the PR number from the commit
22+
# message in which this file was originally added.
23+
#
24+
# What is the pull request number (without the "#")?
25+
# pull_request_override: 0
26+
27+
# Migration can be defined to automatically add a section to
28+
# the migration guide. This is required for breaking changes.
29+
migration:
30+
header: Upgrade K8s versions to use 1.29
31+
body: >
32+
Regarding the upcoming major changes in the plugin, please note that `go/v3` is being deprecated by Kubebuilder hence Operator SDK would also be migrating to `go/v4` soon.
33+
Following are the changes to be addressed in your project structure, `Makefile` and `go.mod` files:
34+
1) [go/v4] Update your `go.mod` file to upgrade the dependencies and run `go mod tidy` to download them
35+
```go
36+
k8s.io/api v0.29.2
37+
k8s.io/apimachinery v0.29.2
38+
k8s.io/client-go v0.29.2
39+
sigs.k8s.io/controller-runtime v0.17.3
40+
```
41+
2) [go/v4, helm/v1] The projects are now scaffolded with 0.16.0 version of kube-rbac-proxy. Modify the version of kube-rbac-proxy in the following scaffolded files:
42+
- config/default/manager_auth_proxy_patch.yaml
43+
```diff
44+
- gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
45+
+ gcr.io/kubebuilder/kube-rbac-proxy:v0.16.0
46+
```
47+
3) [go/v4] You can now generate a file that contains all the resources built with Kustomize, which are necessary to install this project without its dependencies. Update your Makefile by adding:
48+
```diff
49+
+ .PHONY: build-installer
50+
+ build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
51+
+ mkdir -p dist
52+
+ cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
53+
+ $(KUSTOMIZE) build config/default > dist/install.yaml
54+
```
55+
4) [go/v4] Update ENVTEST_K8S_VERSION in your Makefile:
56+
```diff
57+
- ENVTEST_K8S_VERSION = 1.28.3
58+
+ ENVTEST_K8S_VERSION = 1.29.0
59+
```
60+
5) [go/v4] Remove the following section from your Makefile:
61+
```diff
62+
- GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
63+
- GOLANGCI_LINT_VERSION ?= v1.54.2
64+
- golangci-lint:
65+
- @[ -f $(GOLANGCI_LINT) ] || { \
66+
- set -e ;\
67+
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
68+
- }
69+
```
70+
6) [go/v4] Update the following in your Makefile:
71+
```diff
72+
- ## Tool Binaries
73+
- KUBECTL ?= kubectl
74+
- KUSTOMIZE ?= $(LOCALBIN)/kustomize
75+
- CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
76+
- ENVTEST ?= $(LOCALBIN)/setup-envtest
77+
-
78+
- ## Tool Versions
79+
- KUSTOMIZE_VERSION ?= v5.2.1
80+
- CONTROLLER_TOOLS_VERSION ?= v0.13.0
81+
-
82+
- .PHONY: kustomize
83+
- kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
84+
- $(KUSTOMIZE): $(LOCALBIN)
85+
- @if test -x $(LOCALBIN)/kustomize && ! $(LOCALBIN)/kustomize version | grep -q $(KUSTOMIZE_VERSION); then \
86+
- echo "$(LOCALBIN)/kustomize version is not expected $(KUSTOMIZE_VERSION). Removing it before installing."; \
87+
- rm -rf $(LOCALBIN)/kustomize; \
88+
- fi
89+
- test -s $(LOCALBIN)/kustomize || GOBIN=$(LOCALBIN) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION)
90+
-
91+
- .PHONY: controller-gen
92+
- controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
93+
- $(CONTROLLER_GEN): $(LOCALBIN)
94+
- test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \
95+
- GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
96+
-
97+
- .PHONY: envtest
98+
- envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
99+
- $(ENVTEST): $(LOCALBIN)
100+
- test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
101+
+ ## Tool Binaries
102+
+ KUBECTL ?= kubectl
103+
+ KUSTOMIZE ?= $(LOCALBIN)/kustomize-$(KUSTOMIZE_VERSION)
104+
+ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION)
105+
+ ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
106+
+ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
107+
+
108+
+ ## Tool Versions
109+
+ KUSTOMIZE_VERSION ?= v5.3.0
110+
+ CONTROLLER_TOOLS_VERSION ?= v0.14.0
111+
+ ENVTEST_VERSION ?= release-0.17
112+
+ GOLANGCI_LINT_VERSION ?= v1.57.2
113+
+
114+
+ .PHONY: kustomize
115+
+ kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
116+
+ $(KUSTOMIZE): $(LOCALBIN)
117+
+ $(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v5,$(KUSTOMIZE_VERSION))
118+
+
119+
+ .PHONY: controller-gen
120+
+ controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
121+
+ $(CONTROLLER_GEN): $(LOCALBIN)
122+
+ $(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen,$(CONTROLLER_TOOLS_VERSION))
123+
+
124+
+ .PHONY: envtest
125+
+ envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
126+
+ $(ENVTEST): $(LOCALBIN)
127+
+ $(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
128+
+
129+
+ .PHONY: golangci-lint
130+
+ golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
131+
+ $(GOLANGCI_LINT): $(LOCALBIN)
132+
+ $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,${GOLANGCI_LINT_VERSION})
133+
+
134+
+ # go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
135+
+ # $1 - target path with name of binary (ideally with version)
136+
+ # $2 - package url which can be installed
137+
+ # $3 - specific version of package
138+
+ define go-install-tool
139+
+ @[ -f $(1) ] || { \
140+
+ set -e; \
141+
+ package=$(2)@$(3) ;\
142+
+ echo "Downloading $${package}" ;\
143+
+ GOBIN=$(LOCALBIN) go install $${package} ;\
144+
+ mv "$$(echo "$(1)" | sed "s/-$(3)$$//")" $(1) ;\
145+
+ }
146+
+ endef
147+
```
148+
7) [helm/v1] Update the kustomize version in your Makefile:
149+
```diff
150+
- curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.2.1/kustomize_v5.2.1_$(OS)_$(ARCH).tar.gz | \
151+
+ curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.3.0/kustomize_v5.3.0_$(OS)_$(ARCH).tar.gz | \
152+
```

0 commit comments

Comments
 (0)