Highlighted
Contributor
Contributor

kubelet fails to start since --api-server is not a valid option. Any pointers to configuring kubelet through a config file?

Jump to solution

Deployed kubernetes on photon OS as per the instructions below:

Kubernetes on Photon OS · VMware Photon OS 3.0 Documentation

Facing an issue where kubelet did not start on the node.

systemd unit file configuration is to look for /etc/kubernetes/kubelet  and /etc/kubernetes/config file for env variables.

jounalctl -u kubelet.service shows error message that --apiserver is not valid option.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Contributor
Contributor

Edited systemd unit file for kubelet on node such that it does not look at deprecated --api-server but looks at the --kubeconfig <YAML file> for master node. Restarted all services and it worked fine.

View solution in original post

0 Kudos
6 Replies
Highlighted
Immortal
Immortal

Those are really old instructions for instantiating a Kubernetes cluster. You're getting that error because the --api-servers flag was deprecated MANY versions ago. kubelet now has a parameter called --kubeconfig. Honestly, you're far better off using something like kubeadm which is kept updated with versions.

0 Kudos
Highlighted
Contributor
Contributor

Thank you!

Is there a way to install kubeadm on photon OS 3.0. tdnf install kubeadm did not match any package.

0 Kudos
Highlighted
Immortal
Immortal

No, the Photon repos aren't going to have kubeadm, you'll have to curl it from the Google repo. Lots of docs online to follow for that.

0 Kudos
Highlighted
Contributor
Contributor

Thanks again. Assuming photon OS 3.0 is valid to configure a basic kubernetes cluster for a basic dev environment.

0 Kudos
Highlighted
Immortal
Immortal

I've not personally tried it, but it should be.

0 Kudos
Highlighted
Contributor
Contributor

Edited systemd unit file for kubelet on node such that it does not look at deprecated --api-server but looks at the --kubeconfig <YAML file> for master node. Restarted all services and it worked fine.

View solution in original post

0 Kudos