Difference between revisions of "Accessing a Kubernetes cluster"

From MyWiki
Jump to: navigation, search
Line 23: Line 23:
  
 
'''APIs - without 'kubectl proxy'''<br>
 
'''APIs - without 'kubectl proxy'''<br>
https://courses.edx.org/courses/course-v1:LinuxFoundationX+LFS158x+2T2019/courseware/05eb503ab837469cae8637755d55fa79/7b044c7dafae45a7a3c4773195b8f11b/?child=first
 

Revision as of 14:38, 22 September 2019

We access a Kubernetes cluster by three methods:

  • kubectl, the CLI tool
  • Kubernetes Dashboard
  • curl with the right credentials to access the cluster via APIs

$ kubectl config view
$ kubectl cluster-info
$ kubectl cluster-info dump


$ minikube dashboard
$ kubectl proxy

When kubectl proxy is running, we can send requests to the API over the localhost on the proxy port 8001 (from another terminal, since the proxy locks the first terminal):

$ curl http://localhost:8001/

We can explore every single path combination with curl or in a browser, such as:
http://localhost:8001/api/v1
http://localhost:8001/apis/apps/v1
http://localhost:8001/healthz
http://localhost:8001/metrics

APIs - without 'kubectl proxy