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

node name inconsistencies across platforms. #115

Closed
hexfusion opened this issue Feb 11, 2020 · 1 comment · Fixed by #143
Closed

node name inconsistencies across platforms. #115

hexfusion opened this issue Feb 11, 2020 · 1 comment · Fixed by #143

Comments

@hexfusion
Copy link
Contributor

hexfusion commented Feb 11, 2020

research

I ran into this in the past when I was trying to conclude a standard for etcd names. What I found is that some instances where using what is the equivalent of $(hostname), while others were using a concat of $(hostname) master-1 and ($hostname -d) ip-10-0-132-53.ec2.internal

Within a cloud instance, various status APIs exists to easily obtain metadata for the compute.

Example AWS.

$ curl http://169.254.169.254/latest/meta-data/hostname
ip-10-0-139-133.ec2.internal

So it appears that the kubelet is smart enough in some clouds to get what CEO expects which is a routable internal DNS name for the node name.

https://github.com/kubernetes/kubernetes/blob/38acec9bbc955a33c3366dc6082df90d18229b6f/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go#L902

https://github.com/kubernetes/kubernetes/blob/38acec9bbc955a33c3366dc6082df90d18229b6f/pkg/kubelet/kubelet.go#L457

But then for metal, we just see master-1, yet it does have a routable FQDN.

oc get nodes                                               
NAME       STATUS   ROLES    AGE   VERSION
master-0   Ready    master   15h   v1.17.1
master-1   Ready    master   15h   v1.17.1
master-2   Ready    master   15h   v1.17.1
worker-0   Ready    worker   14h   v1.17.1
$ dig +short master-0.ostest.test.metalkube.org
192.168.111.20

proposed resolution

Non clouds use --hostname-override which is populated by ENV.

ExecStart=/usr/bin/hyperkube \
    kubelet \
      --config=/etc/kubernetes/kubelet.conf \
      --bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
      --kubeconfig=/var/lib/kubelet/kubeconfig \
      --container-runtime=remote \
      --container-runtime-endpoint=/var/run/crio/crio.sock \
      --node-labels=node-role.kubernetes.io/master,node.openshift.io/os_id=${ID} \
      --minimum-container-ttl-duration=6m0s \
      --hostname-override=${KUBLET_HOSTNAME_OVERRIDE} \
      --cloud-provider=aws \
      --volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume/exec \
       \
      --register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
      --v=${KUBELET_LOG_LEVEL}

I understand we can change our code to reflect master-1 as ETCD_NAME. But I feel standardizing node naming standard might be a good move across the product.

@deads2k
Copy link
Contributor

deads2k commented Feb 11, 2020

I think we can move away from dns names entirely. By relying solely on internal IPs, we can have the operator avoid the dns dependency and conflicting values like this entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants