API reference
This document contains the endpoints of the KubeArchive API and the query parameters they support.
Collection of Resources
/apis/:group/:version/:resourceType
/apis/:group/:version/namespaces/:namespace/:resourceType
/api/:version/:resourceType
/api/:version/namespaces/:namespace/:resourceType
Examples:
/apis/apps/v1/deployments
/apis/batch/v1/namespaces/default/jobs
/api/v1/services
/api/v1/namespaces/default/pods
Parameters allowed:
-
limit
: defaults to 100. Not higher than 1000. Limits the number of entries returned. -
continue
: token to access the next page of the pagination. Retrieve it at.metadata.continue
of the returnedList
resource. An empty string if there are no more pages remaining. -
labelSelector
: allows filtering resources based on label filtering.
Label Selector
It implements the same filters available in the Kubernetes API:
- Existence
-
labelSelector=wantedLabelKey
- Not existence
-
labelSelector=!unwantedLabelKey
orlabelSelector=%21unwantedLabelKey
with URL encoding - Equality
-
labelSelector=labelKey=labelValue
orlabelSelector=labelKey%3DlabelValue
with URL encoding - Inequality
-
labelSelector=labelKey!=unwantedLabelValue
orlabelSelector=labelKey%21%3DlabelValue
with URL encoding - Set based
-
labelSelector=labelKey in (value1, value2)
orlabelSelector=labelKey+in+%28value1,+value2%29
with URL encoding - Set not based
-
labelSelector=labelKey notin (value1, value2)
orlabelSelector=labelKey+notin+%28value1,+value2%29
with URL encoding
Label selectors can be combined based on a logical AND by separating them with a comma. For example to retrieve pods in the The API call is:
|
Individual Resources
/apis/:group/:version/namespaces/:namespace/:resourceType/:name
/api/:version/namespaces/:namespace/:resourceType/:name
Examples:
/apis/batch/v1/namespaces/default/cronjobs/cleanup-tasks
/api/v1/namespaces/default/pods/busybox-tooling
Logs
/apis/:group/:version/namespaces/:namespace/:resourceType/:name/log
/api/:version/namespaces/:namespace/:resourceType/:name/log
Examples:
/apis/batch/v1/namespaces/default/cronjobs/cleanup-tasks/log
/api/v1/namespaces/default/pods/busybox-tooling/log
Parameters allowed:
* container
: name of the container to select the log from, defaults to an
empty string.
When /log
endpoint is called for a resource other than a Pod
, KubeArchive
searches, recursively, for any Pod
owned by the resource. If a Pod
is found
its log is returned.
When a Pod
has multiple containers, a single container is selected in the following
order of preference:
-
container
parameter -
kubectl.kubernetes.io/default-container
Pod annotation -
First container listed in the Pod definition