Bootstrap FreeKB - OpenShift - List stateful sets using REST API
OpenShift - List stateful sets using REST API

Updated:   |  OpenShift articles

This assumes you have used the REST API to obtain an OAuth bearer token. Let's say the bearer token is sha256~0Rs__hPuXmBD3TJTXNDisC7wRBN-nrFnYTxgdBrFT-U.

A stateful set is a resource in OpenShift that is used to deploy one or more pods running a stateful application (an application that keeps track of the state of something), such as the state of a connection to some backend, such as a SQL database.

Here is how you would list the stateful sets using curl.

curl
--insecure
--request GET
--header "Accept: application/json"
--header "Authorization: Bearer sha256~0Rs__hPuXmBD3TJTXNDisC7wRBN-nrFnYTxgdBrFT-U"
--url "https://api.openshift.example.com:6443/apis/apps/v1/statefulsets"

 

Here is now to list the stateful sets in a namespace.

curl
--insecure
--request GET
--header "Accept: application/json"
--header "Authorization: Bearer sha256~0Rs__hPuXmBD3TJTXNDisC7wRBN-nrFnYTxgdBrFT-U"
--url "https://api.openshift.example.com:6443/apis/apps/v1/namespaces/my-project/statefulsets"

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter d9177e in the box below so that we can be sure you are a human.