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

Can not set hostNetwork for static Pod to false. This results all static pods get same IP Address, which is misleading #2655

Closed
rakarakhi opened this issue Feb 13, 2022 · 3 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@rakarakhi
Copy link

rakarakhi commented Feb 13, 2022

What keywords did you search in kubeadm issues before filing this one?

If you have found any duplicates, you should instead reply there and close this page.

If you have not found any duplicates, delete this section and continue on.

Is this a BUG REPORT or FEATURE REQUEST? BUG REPORT

Choose one: BUG REPORT or FEATURE REQUEST

Versions

kubeadm version (use kubeadm version):

kubeadm version: &version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.6", GitCommit:"f59f5c2fda36e4036b49ec027e556a15456108f0", GitTreeState:"clean", BuildDate:"2022-01-19T17:31:49Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.6", GitCommit:"f59f5c2fda36e4036b49ec027e556a15456108f0", GitTreeState:"clean", BuildDate:"2022-01-19T17:33:06Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.6", GitCommit:"f59f5c2fda36e4036b49ec027e556a15456108f0", GitTreeState:"clean", BuildDate:"2022-01-19T17:26:47Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration: AWS EC2 Instance: t3a-medium (2 vCPU and 4 GB RAM)
  • OS (e.g. from /etc/os-release):
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
  • Kernel (e.g. uname -a): 5.4.0-1065-aws #68~18.04.1-Ubuntu
  • Container runtime (CRI) (e.g. containerd, cri-o): containerd
  • Container networking plugin (CNI) (e.g. Calico, Cilium): Calico
  • Others: Ubuntu 18.04.6 LTS

What happened?

  • In kubeadm init I am setting the pod CIDR. But all static pods have the same IP Address as hostNetwork=true.
  • Changing that to false does not restart the pods with unique IP Addresses
  • The entire manifest folder was missing
  • Restoring the manifest folder from backup copy does not help

What do you expect to happen?

  • Since I am setting the pod CIDR, all static pods should take unique IP Addresses.

How to reproduce it (as minimally and precisely as possible)?

  • In kubeadm init pass the pod CIDR
  • Install a pod CNI - Calico/Flannel
  • kubectl get pods -n kube-system -o wide

Anything else we need to know?

@neolit123
Copy link
Member

kubeadm deploys the control plane components with hostNetwork: true because they may have to interact the host network interfaces. you can use kubeadm patches to disable the hostNetwork option in the pod spec of the static pods during kubeadm init and join:
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/control-plane-flags/#patches

but note that having hostNetwork: false is not a supported use case by kubeadm...

Changing that to false does not restart the pods with unique IP Addresses

i don't think changing the podspec...hostNetwork of a static pod will result in good behavior after the components are already running... if you are seeing bugs around that you can try logging an issue in kubernetes/kubernetes because the kubelet manages the static pod restarts, not kubeadm.

The entire manifest folder was missing.

this should not happen. the kubelet does not delete files there...

Restoring the manifest folder from backup copy does not help.

just a speculation on my side, but it could be that after hostNetwork is changed to false, the kube-apiserver fails to start and the kubelet starts complaining about not being able to register the mirror pods.

either way, i don't see a kubeadm bug here, since this is not a supported scenario.
you might have to start the node from scratch.

/support

@github-actions
Copy link

Hello, @rakarakhi 🤖 👋

You seem to have troubles using Kubernetes and kubeadm.
Note that our issue trackers should not be used for providing support to users.
There are special channels for that purpose.

Please see:

@github-actions github-actions bot added the kind/support Categorizes issue or PR as a support question. label Feb 14, 2022
@rakarakhi
Copy link
Author

rakarakhi commented Feb 15, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

2 participants