API server

Contents

    API description

    HTTP API space of Kubernetes can be divided into three independent groups

    Core Group (/api/v1)
    This group includes objects such as Pods, Services, nodes, namespaces, configmaps, secrets, etc.

    Named Group
    This group includes objects in /apis/$NAME/$VERSION format. These different API versions imply different levels of stability and support:

    System-wide
    This group consists of system-wide API endpoints, like /healthz, /logs, /metrics, /ui, etc.

    Using API with kubectl proxy

    For starting the REST interface: kubectl proxy
    Endpoints list: curl http://localhost:8001/
    Then, for instance: curl http://localhost:8001/apis/apps/v1

    Without kubectl proxy

    Get the token:
    TOKEN=$(kubectl describe secret -n kube-system $(kubectl get secrets -n kube-system | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t' | tr -d " ")

    Get the API server endpoint:
    APISERVER=$(kubectl config view | grep https | cut -f 2- -d ":" | tr -d " ")

    Endpoints list: curl $APISERVER --header "Authorization: Bearer $TOKEN" --insecure
    Then, for instance: curl $APISERVER/apis/apps/v1 --header "Authorization: Bearer $TOKEN" --insecure

    Proudly Powered by Zim 0.75.2.

    Template by Etienne Gandrille, based on ZeroFiveEight and using JQuery Toc Plugin.