curl --request GET -k \
--cert certs/client-1.crt \
--key certs/client-1.key \
--cacert certs/ca_cert.pem \
https://localhost:8443/api/v1/namespaces/deployments
HTTP/2 200
content-type: application/json
content-length: 1563
date: Tue, 30 Aug 2022 04:23:22 GMT
{
"count": 20,
"deployments": [
{
"name": "<name>",
"namespace": "<namepsace>",
"replicas": 1
}...
Get deployments from a namespace
NAMESPACE=< namespace>
curl --request GET -k \
--cert certs/client-1.crt \
--key certs/client-1.key \
--cacert certs/ca_cert.pem \
" https://localhost:8443/api/v1/namespaces/${NAMESPACE} /deployments"
HTTP/2 200
content-type: application/json
content-length: 1563
date: Tue, 30 Aug 2022 04:23:22 GMT
{
"count": 2,
"deployments": [
{
"name": "deployment-1",
"namespace": "<namespace>",
"replicas": 1
},
{
"name": "deployment-2",
"namespace": "<namespace>",
"replicas": 1
}
]
}
Get deployment from namespace
NAMESPACE=< namespace>
NAME=< name>
curl --request GET -k \
--cert certs/client-1.crt \
--key certs/client-1.key \
--cacert certs/ca_cert.pem \
" https://localhost:8443/api/v1/namespaces/${NAMESPACE} /deployments/${NAME} "
HTTP/2 200
content-type: application/json
content-length: 1563
date: Tue, 30 Aug 2022 04:23:22 GMT
{
"name": "<name>",
"namespace": "<namespace>",
"replicas": 1
}
Set replicas for a deployment
NAMESPACE=< namespace>
NAME=< name>
REPLICAS=< replicas>
curl --request PUT -k \
--cert certs/client-1.crt \
--key certs/client-1.key \
--cacert certs/ca_cert.pem \
" https://localhost:8443/api/v1/namespaces/${NAMESPACE} /deployments/${NAME} /replicas/${REPLICAS} "
HTTP/2 200
content-type: application/json
content-length: 1563
date: Tue, 30 Aug 2022 04:23:22 GMT
{
"name": "<name>",
"namespace": "<namespace>",
"replicas": <replicas>,
"Reconcile": false,
"Time": "2022-08-30T00:33:36.280228-04:00"
}
Set replicas and reconcile for a deployment
NAMESPACE=< namespace>
NAME=< name>
REPLICAS=< replicas>
curl --request PUT -k \
--cert certs/client-1.crt \
--key certs/client-1.key \
--cacert certs/ca_cert.pem \
" https://localhost:8443/api/v1/namespaces/${NAMESPACE} /deployments/${NAME} /replicas/${REPLICAS} /reconcile"
HTTP/2 200
content-type: application/json
content-length: 1563
date: Tue, 30 Aug 2022 04:23:22 GMT
{
"name": "<name>",
"namespace": "<namespace>",
"replicas": <replicas>,
"Reconcile": true,
"Time": "2022-08-30T00:37:52.477146-04:00"
}
Show replicas diff for a deployment
NAMESPACE=< namespace>
NAME=< name>
curl --request GET -k \
--cert certs/client-1.crt \
--key certs/client-1.key \
--cacert certs/ca_cert.pem \
" https://localhost:8443/api/v1/namespaces/${NAMESPACE} /deployments/${NAME} /diff"
HTTP/2 200
content-type: application/json
content-length: 1563
date: Tue, 30 Aug 2022 04:23:22 GMT
{
"name": "<name>",
"namespace": "<namespace>",
"diff": "replicas: 2 => 1"
}
Kubernetes API Health Check
curl --request GET -k \
--cert certs/client-1.crt \
--key certs/client-1.key \
--cacert certs/ca_cert.pem \
" https://localhost:8443/livez"
HTTP/2 200
content-type: application/json
content-length: 1563
date: Tue, 30 Aug 2022 04:23:22 GMT
ok