logo

Kubernetes - APIs

Last Updated: 2024-01-28

The /api endpoint is already legacy and used only for core resources (pods, secrets, configmaps, etc.). A more modern and generic /apis/<group-name> endpoint is used for the rest of resources, including user-defined custom resources.

k8s.io (in-tree): Core

e.g.

apiVersion: v1
kind: Pod

k8s.io (in-tree): Non-core

  • REST Path: /apis/$GROUP_NAME/$VERSION
  • apiVersion: $GROUP_NAME/$VERSION, e.g. apiVersion: batch/v1
  • Groups without k8s.io: apps/v1, batch/v1, policy/v1, autoscaling/v2
  • Groups with k8s.io: metrics.k8s.io, networking.k8s.io, node.k8s.io, storage.k8s.io, rbac.authorization.k8s.io
  • Source code: https://github.com/kubernetes/kubernetes/tree/master/pkg/apis

E.g.

apiVersion: apps/v1
kind: Deployment

k8s.io: sigs / extensions

Separate repos under https://github.com/kubernetes-sigs

E.g.

apiVersion: cluster.x-k8s.io/v1alpha3
kind: Cluster

Addons

other projects, e.g.

  • knative.dev
  • kubevirt.io
  • istio.io

Custom Resources

Add your own APIs.

Links