OpenShift - List stateful sets using REST API
by
Jeremy Canfield |
Updated: April 15 2024
| 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