Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Support --container-runtime kubelet arg removal and kustomize v5 for k8s 1.27 #4429

Merged
merged 4 commits into from
Apr 26, 2023

Conversation

rrpolanco
Copy link
Contributor

What this PR does / why we need it:

The containerd addon provides a kubeadm init and join configuration that sets the field kubeletExtraArgs.container-runtime. However, Kubernetes 1.27 removed this kubelet argument: https://kubernetes.io/blog/2023/03/17/upcoming-changes-in-kubernetes-v1-27/#removal-of-container-runtime-command-line-argument.

Kubernetes 1.27 also introduced a new major version of kustomize, v5:

Upgrades functionality of kubectl kustomize as described at https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.0.0 and https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.0.1.

This was causing the flannel addon to fail since it was using the legacy style patches specification.

This is a new major release of kustomize, so there are a few backwards-incompatible changes, most of which are rare use cases, bug fixes with side effects, or things that have been deprecated for multiple releases already:

kubernetes-sigs/kustomize#4911: Drop support for a very old, legacy style of patches. patches used to be allowed to be used as an alias for patchesStrategicMerge in kustomize v3. You now have to use patchesStrategicMerge explicitly, or update to the new syntax supported by patches. See examples in the PR description of kubernetes-sigs/kustomize#4911.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Steps to reproduce

Does this PR introduce a user-facing change?


Does this PR require documentation?

@rrpolanco rrpolanco requested a review from a team as a code owner April 26, 2023 04:59
@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

emosbaugh
emosbaugh previously approved these changes Apr 26, 2023
@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@rrpolanco rrpolanco changed the title WIP: chore: Support --container-runtime kubelet arg removal and kustomize v5 for k8s 1.27 chore: Support --container-runtime kubelet arg removal and kustomize v5 for k8s 1.27 Apr 26, 2023
@rrpolanco
Copy link
Contributor Author

rrpolanco commented Apr 26, 2023

There is a bug in kustomize v5.0.0 and v5.0.1 where it doesn't allow me to migrate legacy kustomization.yaml files via kustomize edit fix as I get the following error:

rafael@rafael-k8s127-dev-test-20230426103405:~$ kustomize edit fix 
Error: invalid Kustomization: json: cannot unmarshal string into Go struct field Kustomization.patches of type types.Patch
Usage:
  kustomize edit fix [flags]

Examples:

	# Fix the missing and deprecated fields in kustomization file
	kustomize edit fix



Flags:
  -h, --help   help for fix
      --vars   If specified, kustomize will attempt to convert vars to replacements. 
               We recommend doing this in a clean git repository where the change is easy to undo.

Global Flags:
      --stack-trace   print a stack-trace on error

In the interim I'm going to use kustomize-v3.5.4 until the aforementioned bug is fixed. The drawback is that for Kubernetes 1.27 these warnings will appear when the Flannel addon is applied:

# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.

@rrpolanco rrpolanco merged commit 6535749 into main Apr 26, 2023
@rrpolanco rrpolanco deleted the rafaelpolanco/sc-74454/kurl-k8s-127-fixes branch April 26, 2023 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants