GKE: kubernetes nodes don't require kubectl package

5/3/2019

Do we really need kubectl to be part of kubernetes nodes ?

GKE

-- Barath
google-cloud-platform
google-kubernetes-engine

2 Answers

10/16/2019

One more possibility can be compatibility issues. Imagine you upgrade kubectl on your local machine to a newer version that is incompatible(or a default behaviour is changed) with one of your older k8 clusters.

So in a way it is kind of ensuring that there is always a compatible version of kubectl running on the nodes.

Note: in ideal situations commands and apis should be backward compatible.

-- Ankit Deshpande
Source: StackOverflow

5/3/2019

I don't know if there is a "correct" answer to this. But, I feel it is needed as a resource created should be manageable.
I understand your point where we all have gcloud and kubectl installed to our local machine but this is not the case for everyone. There could be developers who only have SSH access to the nodes and not enough IAM role or even gcloud installed in their local machine. So, if you are just able to SSH into any of the nodes, you should be able to view (or add, delete and edit as per the requirement) the resources on the cluster.

Personally, I never felt a need for this in my case as I have an editor role in my project but there could be situations/people who do not even have gcloud or kubectl installed or any such access or they are using a VDI or for security constraints (e.g developers are allowed to carry their laptops to their homes) the organization not allowing these developers to have access to any such thing on there local and enforces to access them using these nodes only.

So, in my opinion, this could one of the use cases why the creators decided to keep it there in every node.

-- Amit Yadav
Source: StackOverflow