Skip to main content

Command Palette

Search for a command to run...

Understanding Kubernetes GVK and GVR in 60 Seconds

Published
1 min read
Understanding Kubernetes GVK and GVR in 60 Seconds
S

An individual who uses AI prompts, stack overflow threads and coffee to assemble software that occasionally works as expected...

  1. GVK (Group, Version, Kind):

    • Group: The API group under which the resource is categorized (e.g., apps, core, etc.).

    • Version: The version of the API group (e.g., v1, v1beta1, etc.).

    • Kind: The specific type of resource within the API group (e.g., Pod, Deployment, Service).

Example:

  • A Deployment in the apps group and version v1 has a GVK of apps, v1, Deployment.

  • A Pod has a GVK of core, v1, Pod.

  1. GVR (Group, Version, Resource):

    • Group: The API group under which the resource is categorized.

    • Version: The version of the API group.

    • Resource: The plural name of the resource as used in the URL path (e.g., pods, deployments, services).

Example:

  • The API endpoint for Pods is /api/v1/pods, corresponding to GVR core, v1, pods.

  • The API endpoint for Deployments is /apis/apps/v1/deployments, corresponding to GVR apps, v1, deployments.

Remember, GVK helps describe the type of a resource (often in YAML files), while GVR is crucial for interacting with the Kubernetes API.