Users can control Kubernetes clusters via the kubectl
command; it supports local and remote execution. However, some administrators or operators may need to integrate a program to control the Kubernetes cluster.
Kubernetes has a RESTful API that controls Kubernetes clusters via an API, similar to the kubectl
command. Let's learn how to manage Kubernetes resources by submitting API requests.
In this recipe, to bypass additional network settings and having to verify permissions, we will demonstrate the a minikube-created cluster with a Kubernetes proxy: it is easy to create a Kubernetes cluster on the host, and enable local proximity to an API server with a proxy entry.
First, run up a proxy for fast API request forwarding:
//curl by API endpoint $ kubectl proxy Starting to serve on 127.0.0.1:8001
Having worked with Kubernetes proxy for a while, you may find it is somehow annoying that the command kubectl proxy
is a halt process on your terminal, forcing...