Hosts file entries are removed when kubectl -w passes NULL or empty parameters to the sed command preventing kube-api-server endpoint startup
book
Article ID: 318813
calendar_today
Updated On:
Products
VMware Aria Suite
Issue/Introduction
Symptoms:
When attempting to access https://vRAFQDN/csp/gateway/portal a 404 error is seen
Log entries within the kubelet.service similar to the below are found:
Oct 20 12:13:08 <applianceFQDN> kubelet[8634]: F1020 12:13:08.726641 8634 docker_service.go:412] Streaming server stopped unexpectedly: listen tcp: lookup localhost on <localIP>: no such host
/etc/hosts file appears malformed or empty of the localhost and/or FQDN entries for the appliance.
kubectl get nodes generates a NotReady status for any impacted host in the cluster.
A Kubernetes pod named update-etc-hosts, under the kube-system namespace, updates the pod name to IP mapping in /etc/hosts every time a new resolvable pod is discovered. The updates are performed through a watch implemented with kubectl -w. When this processes an error condition, kubectl -w pipes empty parameters to the 'sed' function removing values from within the /etc/hosts file.
Resolution
This issue is resolved in vRealize Automation 8.2 P1.
Workaround:
Copy the /etc/hosts file entries for a functioning node in the cluster and update the FQDN values for each respective node.
Note: See the Related Information section for a sample of a /etc/hosts file.