Home

PodSpecs

PodSpecs are the specifications that describe the desired state of a pod in Kubernetes. They form the core of a Pod object and define what runs inside the pod, how it is scheduled, and how it interacts with the surrounding environment. PodSpecs are typically embedded in Pod templates used by higher-level controllers to create and manage pods.

A PodSpec specifies the pod’s components and runtime behavior. The containers field defines one or more container

PodSpecs are used by controllers such as Deployments, StatefulSets, DaemonSets, Jobs, and ReplicaSets. The spec in

specifications,
each
including
the
container
image,
name,
ports,
environment
variables,
resource
requests
and
limits,
command
and
arguments,
and
volume
mounts.
Init
containers
can
be
defined
to
run
before
app
containers.
Volumes
describe
data
storage
for
the
pod
and
are
referenced
by
containers
via
volumeMounts.
Pod-level
settings
cover
restartPolicy,
terminationGracePeriodSeconds,
dnsPolicy,
hostNetwork,
hostPID,
and
hostIPC.
Networking
and
identity
options
include
serviceAccountName,
automountServiceAccountToken,
imagePullSecrets,
and
imagePullPolicy.
Scheduling
and
placement
are
controlled
with
nodeSelector,
affinity,
tolerations,
topologySpreadConstraints,
schedulerName,
and
priorityClassName.
Additional
pod-level
controls
include
securityContext,
runtimeClassName,
and
various
probes
and
lifecycle
hooks
inside
containers.
these
controllers’
templates
determines
the
pods
that
will
be
created
and
managed,
and
changes
to
the
PodSpec
can
trigger
rollouts
or
restarts
as
part
of
the
controller’s
reconciliation
process.
Pods
created
from
a
PodSpec
are
instantiated
by
the
API
server,
typically
described
in
YAML
or
JSON
and
applied
via
kubectl
or
client
libraries.