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

[CPDEV-98822] Remove default resolvConf from kubelet-config ConfigMap #619

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

ilia1243
Copy link
Contributor

@ilia1243 ilia1243 commented Mar 7, 2024

Description

Default value of resolvConf is uploaded to kubelet-config ConfigMap by kubeadm.
This causes problems in migration of operating systems, because resolvConf is taken from the ConfigMap,
while it should be different on different OS.

Fixes #586

Solution

If resolvConf is not redefined in the inventory, remove it from kubelet-config ConfigMap

  • during kubeadm init of the first control plane.
  • during kubemarine reconfigure
  • in services.kubelet.configuration PaaS check when generating the CM for comparison.

How to apply

Run kubemarine migrate_kubemarine --force-apply kubelet_resolvConf

Test Cases

TestCase 1

Migrate from Ubuntu 22.04 to RHEL9.

Steps:

  1. Install cluster on Ubuntu 22.04.
  2. Add node on RHEL9.

Results:

Before After
Node is not joined. journalctl for kubelet contains error "open /run/systemd/resolve/resolv.conf: no such file or directory" Node is joined

TestCase 2

Migrate from Centos 7 to Ubuntu 22.04

Steps:

  1. Install cluster on Centos 7.
  2. Migrate on Ubuntu 22.04.
  3. Run check_paas --tasks services.kubelet.configuration

Results:

Before After
failed: "kubelet-config ConfigMap is not consistent with services.kubeadm_kubelet section" Check is successful

TestCase 3

Migration of old clusters.

Steps:

  1. Install cluster on Ubuntu 22.04 using older version of Kubemarine.

Next steps should be done using new version of Kubemarine.

  1. Run check_paas --tasks services.kubelet.configuration

ER: failed: "kubelet-config ConfigMap is not consistent with services.kubeadm_kubelet section"

  1. Run kubemarine migrate_kubemarine --force-apply kubelet_resolvConf
  2. Run check_paas --tasks services.kubelet.configuration

ER: check is successful.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Integration CI passed
  • Unit tests. If Yes list of new/changed tests with brief description
  • There is no merge conflicts

@ilia1243 ilia1243 added the bug Something isn't working label Mar 7, 2024
@ilia1243 ilia1243 force-pushed the bugfix/undefined_resolv_conf branch from 4d1d210 to 4f59115 Compare March 7, 2024 14:53
@koryaga koryaga requested review from alexarefev, Imadzuma and n549 March 11, 2024 07:36
@ilia1243 ilia1243 force-pushed the bugfix/undefined_resolv_conf branch from 4f59115 to 6524fe8 Compare March 13, 2024 15:36
@koryaga koryaga merged commit 390c397 into main Mar 20, 2024
42 checks passed
@koryaga koryaga deleted the bugfix/undefined_resolv_conf branch March 20, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Floating resolvConf of KubeletConfiguration breaks migration from Ubuntu 22.04 to RHEL9
3 participants