CertGrid CertGrid

Manifest field cheat sheet

The YAML fields worth remembering, with what each one actually does and the mistake it usually causes. Grouped by the object you are writing.

On every object

  • metadata.generation / status.observedGeneration

    generation increments on every spec change; observedGeneration is the one a controller has acted on.

    Equal means the controller has caught up. Generation ahead means your change is accepted and not yet applied, which is a sharper question than "is it ready".

    Full guide
  • metadata.ownerReferences

    Names the parent object. Drives garbage collection and controller adoption.

    Deleting the parent deletes the children through this field. Nothing walks a list.

    Full guide
  • metadata.finalizers

    Holds an object in Terminating until a controller removes the entry.

    The reason a namespace or PVC hangs in Terminating forever when the controller that owns the finalizer is gone.

    Full guide
  • metadata.labels

    What selectors match. The only thing selectors match.

    Not names, not annotations. A Service with no endpoints or a NetworkPolicy that does nothing is nearly always a label that does not match.

    Full guide
  • metadata.annotations

    Arbitrary metadata for tools. Never used for selection.

    Capped at 256KB in total, which is what breaks `kubectl apply` on very large CRDs since it stores the manifest here.

    Full guide

Pod spec

  • spec.containers[].resources.requests

    What the scheduler reserves. Determines where the Pod can be placed.

    Placement is by requests, not usage. A node at 5% CPU with 100% of requests allocated will not accept another Pod.

    Full guide
  • spec.containers[].resources.limits

    The ceiling. Exceeding a memory limit is an OOM kill; exceeding a CPU limit is throttling.

    Absent limits mean the container can use the whole node. Memory is not compressible, so a memory limit is the one that terminates rather than slows.

    Full guide
  • spec.containers[].livenessProbe

    Failing it restarts the container.

    Without one, "the process is running" is the only health signal, so a deadlocked application stays Ready and keeps taking traffic.

    Full guide
  • spec.containers[].readinessProbe

    Failing it removes the Pod from Service endpoints without restarting it.

    The difference from liveness is restart versus remove. A Running Pod that is not Ready has a failing readiness probe.

    Full guide
  • spec.containers[].startupProbe

    Suspends the liveness probe until the application has started.

    The fix for a slow-starting application being killed by liveness before it is ready, which otherwise loops forever.

    Full guide
  • spec.terminationGracePeriodSeconds

    How long between SIGTERM and SIGKILL. Default 30.

    Full guide
  • spec.securityContext.runAsNonRoot: true

    Refuse to start a container whose image runs as root.

    Pod-level securityContext sets defaults; container-level overrides them. Read both when a setting appears not to apply.

    Full guide
  • spec.containers[].securityContext.readOnlyRootFilesystem: true

    Mount the container's filesystem read-only. Anything that needs to write gets an emptyDir.

    Full guide
  • spec.containers[].envFrom[].configMapRef

    Import every key in a ConfigMap as environment variables.

    Environment variables are read once at container start. Editing the ConfigMap changes nothing until the Pod restarts.

    Full guide
  • spec.containers[].env[].valueFrom.fieldRef.fieldPath

    Inject the Pod's own metadata, such as metadata.name or status.podIP.

    The reliable way to give a container its own identity, rather than shelling out to hostname.

    Full guide
  • spec.initContainers

    Run to completion, in order, before the app containers start.

    A failing init container restarts the whole Pod, so the Pod never reaches Running. Read init container logs, not the app's.

    Full guide

Scheduling

  • spec.nodeSelector

    Hard requirement on node labels. Simplest form, no expressions.

    Full guide
  • spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution

    Hard node requirement with operators: In, NotIn, Exists, Gt, Lt.

    IgnoredDuringExecution means a Pod already running is not evicted when the node stops matching.

    Full guide
  • spec.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution

    A weighted preference. Never blocks scheduling.

    If a Pod must not run somewhere, preferred is the wrong field; it will schedule there when nothing better is free.

    Full guide
  • spec.tolerations

    Permission to be scheduled onto a tainted node. Does not attract, only permits.

    A toleration with no key and operator Exists tolerates every taint, including the control plane's and NoExecute pressure taints.

    Full guide
  • spec.topologySpreadConstraints

    Spread Pods across a topology key within maxSkew.

    nodeTaintsPolicy: Honor matters: without it a tainted node counts as a domain holding zero Pods, and maxSkew caps how many can be placed anywhere.

    Full guide
  • spec.priorityClassName

    Higher priority preempts lower when the cluster is full.

    Preemption only works downward. A high-priority Pod that still will not fit stays Pending, having already evicted something.

    Full guide

Deployment, StatefulSet, DaemonSet, Job

  • spec.selector.matchLabels

    Which Pods this controller owns. Immutable after creation.

    Cannot be changed. A label transformer that touches it leaves an object only deletion can fix.

    Full guide
  • spec.strategy.rollingUpdate.maxSurge / maxUnavailable

    How many extra Pods may exist and how many may be missing during a rollout.

    maxUnavailable: 0 with maxSurge: 1 is the safest and slowest. Both zero is rejected: nothing could ever change.

    Full guide
  • spec.progressDeadlineSeconds

    After this, Progressing flips to False with reason ProgressDeadlineExceeded. Default 600.

    The only signal that distinguishes a stalled rollout from a slow one. Available=True can be true throughout a broken deploy.

    Full guide
  • spec.revisionHistoryLimit

    How many old ReplicaSets to keep for rollback. Default 10.

    Full guide
  • spec.serviceName (StatefulSet)

    The headless Service that gives each Pod a stable DNS name.

    Required, and the Service must have clusterIP: None. Without it the per-Pod DNS names do not resolve.

    Full guide
  • spec.volumeClaimTemplates (StatefulSet)

    One PVC per Pod, named <template>-<statefulset>-<ordinal>.

    PVCs are not deleted when the StatefulSet is, deliberately. The names are generated and cannot be edited, which makes a restore awkward.

    Full guide
  • spec.podManagementPolicy (StatefulSet)

    OrderedReady creates Pods one at a time; Parallel creates them together.

    Full guide
  • spec.backoffLimit (Job)

    How many failures before the Job is marked Failed. Default 6.

    Full guide
  • spec.concurrencyPolicy (CronJob)

    Allow, Forbid or Replace when a run is still going at the next scheduled time.

    Allow is the default and the usual cause of runs piling up on top of each other.

    Full guide
  • spec.startingDeadlineSeconds (CronJob)

    How late a missed run may still start. Beyond it the run is skipped.

    Full guide

Service, Ingress, Gateway

  • spec.ports[].targetPort (Service)

    The container port traffic is sent to. `port` is what clients use.

    A mismatch here is a 502 through an Ingress and a connection refused directly. Endpoints exist, so it does not look like a Service problem.

    Full guide
  • spec.clusterIP: None (Service)

    Headless: no virtual IP, DNS returns the Pod addresses.

    Required for a StatefulSet's per-Pod names, and the right shape for a client that does its own balancing.

    Full guide
  • spec.externalTrafficPolicy (Service)

    Cluster forwards to any node and SNATs; Local keeps the client IP and only uses local Pods.

    Local preserves the source IP and makes the address dead on a node with no ready endpoint.

    Full guide
  • spec.ingressClassName (Ingress)

    Which controller handles this Ingress.

    Naming a class nothing implements is accepted silently: an empty ADDRESS and 404 for everything, with no status explaining it.

    Full guide
  • spec.rules[].http.paths[].pathType (Ingress)

    Prefix matches whole path elements; Exact is literal; ImplementationSpecific allows regexes.

    Prefix /blue never matches /bluefish. A rewrite with a capture group needs ImplementationSpecific.

    Full guide
  • nginx.ingress.kubernetes.io/rewrite-target (annotation)

    Rewrite the path before forwarding, using capture groups from the path regex.

    Without it the full path is forwarded, and the 404 you get is the backend's, not the controller's. Read the response body for a server footer.

    Full guide
  • spec.tls[] (Ingress)

    Hosts and the Secret covering them. The Secret must be type kubernetes.io/tls in the same namespace.

    Adding this turns on an implicit HTTPS redirect, so plain HTTP starts returning 308.

    Full guide
  • spec.listeners[].allowedRoutes (Gateway)

    Which namespaces may attach routes: Same, All or Selector.

    The enforcement point for the platform-versus-application split. A refused route says Accepted=False(NotAllowedByListeners).

    Full guide
  • spec.rules[].backendRefs[].weight (HTTPRoute)

    Relative weights across backends. Traffic splitting with no annotations.

    Relative, not percentages: 1 and 3 is a 25/75 split. weight: 0 keeps a backend configured and sends it nothing.

    Full guide
  • spec.podSelector: {} (NetworkPolicy)

    An empty selector matches every Pod in the namespace, not none.

    With policyTypes and no rules, that is a namespace-wide deny. Two characters from something that has no effect.

    Full guide
  • spec.egress[].to[].namespaceSelector (NetworkPolicy)

    Select another namespace. A bare podSelector only ever matches the policy's own namespace.

    Two selectors in one list element are ANDed; separate elements are ORed. One hyphen changes the meaning substantially.

    Full guide

Storage

  • spec.accessModes (PVC)

    ReadWriteOnce is one node, ReadWriteOncePod is one Pod, ReadWriteMany is many nodes.

    ReadWriteOnce is per node, not per Pod: two Pods on the same node can share it. Most block storage cannot do ReadWriteMany at all.

    Full guide
  • spec.storageClassName (PVC)

    Which provisioner handles the claim. Empty string means no dynamic provisioning.

    Naming a class that does not exist leaves the PVC Pending forever, and the visible symptom is an unschedulable Pod.

    Full guide
  • volumeBindingMode (StorageClass)

    Immediate creates the volume at once; WaitForFirstConsumer waits for a Pod so the scheduler picks the node first.

    For topology-constrained storage, WaitForFirstConsumer avoids `volume node affinity conflict`.

    Full guide
  • reclaimPolicy (StorageClass) / persistentVolumeReclaimPolicy (PV)

    Delete removes the backing volume with the PVC; Retain keeps it.

    Retain for anything whose loss matters, and accept that cleanup becomes manual.

    Full guide
  • allowVolumeExpansion (StorageClass)

    Whether a PVC's size may be increased. Default false.

    Only increased. A resize often stops at FileSystemResizePending until the Pod restarts.

    Full guide
  • spec.dataSource (PVC)

    Populate a new volume from a VolumeSnapshot.

    A restore is a new volume, not a rewind. The workload has to be pointed at the new claim by hand.

    Full guide
  • deletionPolicy (VolumeSnapshotClass)

    Delete removes the backend snapshot with the object; Retain keeps it.

    With Delete, deleting the namespace destroys the snapshots in it, backend data included.

    Full guide

Namespace policy and RBAC

  • spec.hard (ResourceQuota)

    Caps totals in a namespace: CPU, memory, object counts.

    A quota on requests.cpu makes a Pod without a request invalid, which surprises people until a LimitRange supplies defaults.

    Full guide
  • spec.limits (LimitRange)

    Default and maximum requests and limits for Pods that do not set their own.

    Full guide
  • rules[].apiGroups / resources / verbs (Role)

    What is permitted. The core group is the empty string.

    A new CRD is not covered by existing roles unless they use wildcards, in which case adding a CRD silently widens them.

    Full guide
  • roleRef (RoleBinding)

    The Role or ClusterRole being granted. Immutable.

    A RoleBinding to a ClusterRole grants it within one namespace only, which is the usual way to reuse the built-in roles safely.

    Full guide
  • automountServiceAccountToken: false

    Stop mounting an API token into Pods that do not call the API.

    Set on the ServiceAccount or the Pod. Most workloads never talk to the API and should not carry a credential.

    Full guide