Start a Pod in Kubernetes using curl
Recently I came across the issue that a customer needed to start a Pod without the kubectl
or the oc
command line tooling. Since the Kubernetes API is a relatively straight-forward REST API, we can come up with a nice curl
command for that, which basically does the following:
- To create the Pod, send a POST request
- The Pod definition is sent as JSON
- The endpoint we’re using is
/api/v1/namespaces/mynamespace/pods