How to access a node from kubectl

3/25/2018

In this doc they use u@node$ to define that the command is done from a node in a cluster. But how do you get to the node from kubectl?

It is well described how to get to a pod u@pod$

-- Chris G.
google-kubernetes-engine
kubectl
kubernetes

2 Answers

3/25/2018

The apiserver can be used as a HTTP proxy (as described here) to hit endpoints on Nodes, but I assume you need an SSH session which won't help.

On GKE you can SSH into your nodes using gcloud as follows:

  • gcloud compute instances list
  • gcloud compute ssh <nodeName>
-- dippynark
Source: StackOverflow

3/27/2018

On GKE you simply select your cluster and click on SSH button. If from the command line, then:

gcloud compute ssh NODE --zone ZONE
-- suren
Source: StackOverflow