Difficulty: Advanced
What are API groups in Kubernetes, and why does the API use groups and versions like apps/v1 or networking.k8s.io/v1?
API groups organise Kubernetes resources into related sets, each versioned independently, so the API can grow and change without breaking existing clients. The core (legacy) group has no name and is served at /api/v1 (Pods, Services, ConfigMaps, Secrets), while named groups are served at /apis/<group>/<version>, such as apps/v1 for Deployments or batch/v1 for Jobs. The apiVersion field in every manifest is exactly this group and version.
Every object is identified by its Group, Version, Kind (GVK). For example, a Deployment is group apps, version v1, kind Deployment. The REST path uses the resource name instead of the kind: /apis/apps/v1/namespaces/shop/deployments/cart. Controllers and client libraries work in terms of GVK and GVR (group, version, resource).
| Group (apiVersion) | Example resources |
|---|---|
core (v1) | Pod, Service, ConfigMap, Secret, Namespace, Node, PersistentVolumeClaim |
apps/v1 | Deployment, StatefulSet, DaemonSet, ReplicaSet |
batch/v1 | Job, CronJob |
networking.k8s.io/v1 | Ingress, NetworkPolicy, IngressClass |
rbac.authorization.k8s.io/v1 | Role, ClusterRole, RoleBinding |
autoscaling/v2 | HorizontalPodAutoscaler |
policy/v1 | PodDisruptionBudget |
apiextensions.k8s.io/v1 | CustomResourceDefinition |
CRDs add their own groups, such as cert-manager.io/v1 or monitoring.coreos.com/v1.
batch/v1 without touching apps.v1alpha1 (may change or vanish, off by default), v1beta1 (well tested; new beta APIs have been off by default since 1.24), and v1 (stable).Many cluster upgrades break because manifests or Helm charts use removed versions:
extensions/v1beta1 Deployments removed in 1.16.networking.k8s.io/v1beta1 Ingress removed in 1.22.batch/v1beta1 CronJob and policy/v1beta1 PodSecurityPolicy removed in 1.25.autoscaling/v2beta2 HPA removed in 1.26.Before upgrading, scan manifests with tools like pluto or kubent, and check API server metrics for requests to deprecated APIs.
RBAC rules list apiGroups. The core group is written as an empty string, so a rule for Pods uses apiGroups: [""], while a rule for Deployments uses apiGroups: ["apps"]. Getting this wrong is a common reason a Role "does nothing".
# All group/version pairs served by the cluster
kubectl api-versions
# Resources with their group and whether they are namespaced
kubectl api-resources --api-group=apps
kubectl api-resources --namespaced=false
# Field docs for a specific group/version
kubectl explain deployment.spec.strategy --api-version=apps/v1
# Raw REST call showing the path structure
kubectl get --raw /apis/apps/v1/namespaces/default/deployments | head -c 300
`kubectl api-resources` is the fastest way to check which group a resource belongs to before writing a manifest or an RBAC rule.
API Groups, Group Version Kind, API Versioning, Deprecation Policy, kubectl api-resources