Let's see this how it works using 'curl' command, where we need to provide the URL then api call object path.
Examples
To view the Kubernetes version we can use :
curl https://controlplane:6443/version -kTo get the list of pods in default cluster
curl https://controlplane:6443/api/v1/pods -kin this post we will get to know more about the api specifically Kubernetes API Groups. Each group is defined with a specific purpose, such as on api for health check, other for metrics collection logs etc. These metrics, health check will be used for health of the Kubernetes cluster. And the logs will be used for collecting by third party system where all logs will be collected such as ELK stack uses logstash agent.
The API are categorized into two :
1. Core group /api
2. Named group /apis
Here all core group will be associated with the core functionality such as namespaces, pod, replication controllers, nodes, endpoints, bindings, events, pv, pvc, configmaps, services, secrets etc. Where as named group API are more organized and going forward all the newer features are going to be made available to these named groups. apps, extensions, networking.k8s.io, storage.k8s.io, certificates.k8s.io etc comes under named groups.
To list out the
curl https://localhost:6443To list all apis names
curl https://localhost:6443/apis -k |grep "name"
No comments:
Post a Comment