User Tools

Site Tools


k8s:core:kind

This is an old revision of the document!


kind

The `kind` field in Kubernetes defines what type of object you are creating.

It tells Kubernetes:

  • What resource to build
  • What behavior this resource has
  • What controller will manage it (if any)

1. Core idea

kind = resource type in Kubernetes

Think of Kubernetes as a system that supports many object types.

Each `kind` represents a different “role” in the system.

2. Common kinds

Kubernetes has many kinds, but the most important ones are:

  • Pod → runs containers
  • Deployment → manages Pods
  • ReplicaSet → ensures Pod count
  • Service → network access layer
  • ConfigMap → configuration data
  • Secret → sensitive data
  • Namespace → logical grouping

3. Example

apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 3

Here:

  • kind: Deployment

→ Kubernetes creates a Deployment object

4. What happens internally

When you write:

kind: Deployment

Kubernetes will:

1. Recognize this as a Deployment object
2. Send it to the Deployment Controller
3. Deployment Controller creates a ReplicaSet
4. ReplicaSet creates Pods

Flow:

Deployment ↓ ReplicaSet ↓ Pods

5. Why kind is important

Because Kubernetes is NOT just one system — it is a collection of controllers.

Each `kind`:

  • Triggers a different controller
  • Has different behavior
  • Has different lifecycle rules

Example:

  • Pod → directly runs container
  • Deployment → manages and replaces Pods
  • Service → creates stable network endpoint

6. Real-world analogy

Think of Kubernetes like a company system:

  • Pod → employee
  • Deployment → manager of employees
  • Service → receptionist (routes requests)
  • ConfigMap → instruction manual

So:

kind = “what role am I creating in the system?”

7. Key insight (VERY IMPORTANT)

kind is NOT just a label.

It determines:

  • Which controller handles the object
  • How the object behaves
  • How lifecycle is managed

8. Simple mental model

kind = “type of machine in Kubernetes”

Pod → runs workload Deployment → manages workload Service → exposes workload

9. Summary

  • kind defines the type of Kubernetes object
  • Each kind has a different purpose and behavior
  • Kubernetes uses controllers based on kind
  • kind drives the entire lifecycle of the resource
k8s/core/kind.1780198553.txt.gz · Last modified: by phong2018