Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Metadata declares information used to identify and find resources.

Code Block
languageyaml
# Kubernetes objects are versioned and grouped. When objects evolve in ways that
# aren't backwards compatible, they are released as a new version.
apiVersion: apps/v1

# Every Kubernetes object has a kind which declares the type of the resource.
kind: Deployment

metadata:

  # Every Kubernetes object has a name, which must be unique within its
  # namespace for its kind.
  name: example-web

  # Labels are used to select relevant resources by deployments and services.
  labels:

    # Kubernetes has some recommended labels such as name and component.
    app.kubernetes.io/component: web
    app.kubernetes.io/instance: production
    app.kubernetes.io/name: example
    app.kubernetes.io/part-of: example

  # Kubernetes objects are grouped in namespaces.
  namespace: default

# Most objects have a spec that describe the resource being created.
spec:
  # ...

...