This PR fixes the node registration using v1alpha2 NodeConfiguration. I spun up a full quickstart on AWS and was able to reproduce @stevesloka issue by running kubectl run nginx --image=nginx and kubectl expose deployment nginx --port=80 --type=LoadBalancer.
Kubelet logs showed No cloud provider specified, even though the --cloud-provider=aws flag was being set in the extra args with systemd, as shown below:
root@ip-10-0-31-162:/home/ubuntu# systemctl cat kubelet
# /lib/systemd/system/kubelet.service
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=https://kubernetes.io/docs/home/
[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10
[Install]
WantedBy=multi-user.target
# /etc/systemd/system/kubelet.service.d/10-hostname.conf
[Service]
Environment="KUBELET_EXTRA_ARGS= --hostname-override=ip-10-0-31-162.ec2.internal --cloud-provider=aws --authentication-token-webhook=true"
# /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
# Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
# This is a file that "kubeadm init" and "kubeadm join" generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/default/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS
Fixes #214 Signed-off-by: Vince Prignano vince@vincepri.com
This PR fixes the node registration using v1alpha2 NodeConfiguration. I spun up a full quickstart on AWS and was able to reproduce @stevesloka issue by running
kubectl run nginx --image=nginx
andkubectl expose deployment nginx --port=80 --type=LoadBalancer
.Kubelet logs showed
No cloud provider specified
, even though the --cloud-provider=aws flag was being set in the extra args with systemd, as shown below:Which produces this runtime service:
After applying the changes in this PR, the runtime service looks better: