Kubernetes Knowledge Patch
Use this skill before changing Kubernetes manifests, cluster configuration,
controllers, scheduler plugins, node setup, client integrations, or operational
tooling. Start with the upgrade hazards, then open the reference matching the
task; details that differ by patch release remain attributed in the references.
Reference index
| Reference |
Topics |
| API extensibility and clients |
CRDs, aggregated APIs, client-go, protobuf, serializers, streaming APIs |
| Control plane and observability |
API server, watches, APF, feature gates, metrics, diagnostics, mixed-version proxy |
| Dynamic Resource Allocation |
ResourceClaims, ResourceSlices, DRA drivers, sharing, health, binding, quotas |
| Kubectl and kubeadm |
kuberc, KYAML, command changes, kubeadm endpoints, probes, arguments |
| Networking and Gateway API |
Services, EndpointSlices, kube-proxy, Gateway API, Ingress migration |
| Nodes, runtimes, and kubelet |
cgroup v2, runtime discovery, kubelet configuration, node capabilities, pressure |
| Security, identity, and admission |
authentication, authorization, ServiceAccounts, Pod identity, admission, audit |
| Storage |
PVs, CSI, snapshots, VolumeAttributesClass, image volumes, migration |
| Workloads and scheduling |
Pods, containers, Jobs, controllers, HPA, resize, scheduling, workload APIs |
Breaking changes and deprecations
Clear node startup blockers
- Linux kubelets require cgroup v2. Treat
failCgroupV1: false plus an ignored
kubeadm preflight error only as an explicit compatibility override.
- Remove kubelet
--pod-infra-container-image; leaving it configured prevents
startup. Remove --cloud-config and --register-schedulable too.
- Let kubelet discover the cgroup driver from CRI. Manual
cgroupDriver and
--cgroup-driver selection are deprecated.
- Upgrade old runtimes before using image volumes, strict supplemental groups,
user namespaces, or other runtime-dependent features.
Migrate APIs and extension contracts
- Use
resource.k8s.io/v1 for core DRA objects. Delete or recreate incompatible
alpha DRA objects and partitionable-device data as the DRA reference directs.
- Use
storage.k8s.io/v1 for VolumeAttributesClass and v1beta1 for
StorageVersionMigration; delete unsupported alpha objects before upgrade.
- Use
admissionregistration.k8s.io/v1 for MutatingAdmissionPolicy; beta-era
storage may still require migration.
- Kubectl no longer accepts legacy beta CSR, EndpointSlice, Ingress, or
PodDisruptionBudget objects.
- Kubernetes API Go types and extension protocols use standard protobuf. Remove
gogo registry and
ProtoMessage() assumptions.
- Scheduler extensions import framework types from
k8s.io/kube-scheduler/framework and must implement current preflight result
and workload-state contracts.
Remove obsolete configuration
- Delete feature-gate names after graduation or removal. Components reject an
enabled feature when a required dependency is disabled.
- Remove kube-apiserver cloud-provider flags and configure external cloud
integration separately.
- Move leader-election locks from
configmapsleases or endpointsleases to
leases.
- Update renamed metrics and labels before upgrading dashboards and alerts;
several API-server metrics now separate API groups from resource labels.
- Configure
--peer-ca-file before depending on mixed-version API-server
proxying.
- When request-header and ordinary client CA bundles overlap, set
--requestheader-allowed-names.
Replace deprecated networking and volumes
- Read Services through every labeled EndpointSlice, not the deprecated
Endpoints object.
- Prefer kube-proxy
nftables; IPVS is deprecated.
- Replace
trafficDistribution: PreferClose with PreferSameZone or
PreferSameNode.
- Plan alternatives to
Service.spec.externalIPs with LoadBalancer, NodePort,
or Gateway API exposure.
- Migrate Ingress NGINX deployments to Gateway API and inspect every warning or
approximate ingress2gateway conversion.
- Replace
gitRepo volumes with an init container or git-sync. The feature-gate
escape hatch is gone.
- Migrate removed in-tree and flex-volume integrations to CSI before upgrading.
Update command and access assumptions
- Write
kubectl exec POD -- COMMAND; the separator is required.
- Expect
kubectl debug to use the general profile unless selected otherwise.
- Add
--show-events when describing multiple objects and events are needed.
- Grant
create on pods/exec, pods/attach, and pods/portforward;
WebSocket access no longer succeeds with only get.
- Do not interpret
PodReadyToStartContainers=True as proof that image pulling
has completed.
Workload quick reference
Resize running Pods through the subresource
spec.containers[*].resources is desired state; container status reports actual
resources. Submit CPU and memory changes through the resize subresource and
inspect PodResizePending or PodResizeInProgress conditions.
kubectl edit pod <pod-name> --subresource resize
Memory reductions, swap, static CPU or Memory Manager policies, native sidecars,
init containers, and Pod-level resources have distinct restrictions. Read the
workload reference before automating resize.
Use Pod-level resource budgets deliberately
Pod-wide CPU, memory, and huge-page requests and limits can simplify scheduling
and HPA calculations. They are unsupported on Windows, and topology-aware
manager integration depends on the active behavior. A missing container limit
in resourceFieldRef can fall back to the Pod-level limit.
spec:
resources:
requests:
cpu: "2"
memory: 4Gi
limits:
cpu: "4"
memory: 8Gi
Distinguish sidecars and restart rules
- A native sidecar is an
initContainers entry with container-level
restartPolicy: Always; it preserves init ordering, runs with the app, stops
in reverse order, and does not block Job completion.
- Regular and init containers can have per-container policies and exit-code
rules. Restart-all rules can restart every container when a selected source
exits.
lifecycle.stopSignal can override the image or runtime signal when the Pod
declares its OS.
Choose Job semantics explicitly
- Indexed Jobs support per-index retry limits, failed-index caps,
FailIndex,
and success policies.
- Set
podReplacementPolicy: Failed to avoid overlapping a terminating Pod and
its replacement.
- Suspended Jobs can accept resource and scheduling edits under the applicable
feature behavior; active Pods remain immutable.
managedBy delegates reconciliation but does not carry controller parameters.
- PodGroups provide all-or-nothing scheduling; use the current
scheduling.k8s.io API and conditions.
Dynamic Resource Allocation essentials
Select claim lifecycle correctly
- A direct
ResourceClaim is namespaced, reusable by multiple Pods, and
manually managed.
- A
ResourceClaimTemplate creates one claim per Pod and deletes it with the
Pod.
- Do not set
spec.nodeName on DRA Pods. Use an exact hostname node selector so
scheduling still allocates and reserves devices.
- Quota can charge device-class and mapped extended-resource keys.
Account for advanced allocation
- Prioritized alternatives, taints and tolerations, shared counters, consumable
capacity, binding conditions, and extended-resource mapping affect eligibility
and timing.
- Drivers report device status and health;
Unknown and Unhealthy allocations
appear in Pod status.
- Binding can wait for external preparation and time out under scheduler
configuration.
- Status writers need granular binding and driver subresource permissions.
- Drivers and ResourceSlice implementations must honor the stable kubelet
plugin protocol and release-specific migrations.
Security and identity essentials
Prefer bounded workload credentials
- Bound ServiceAccount tokens carry JTI and node identity and can be restricted
to a designated node.
- Kubelet image credential providers can request short-lived, audience-bound
ServiceAccount tokens.
- Cached private images can require fresh credential verification according to
imagePullCredentialsVerificationPolicy.
- Pod certificates let kubelet generate, request, rotate, and project X.509
credentials; verify feature and API enablement.
- CSI ServiceAccount tokens belong in the secrets channel rather than routinely
logged volume context.
Harden authorization and admission
- Selector-aware authorization can require field or label selectors for list,
watch, and delete-collection requests.
- Restrict anonymous authentication to explicit health paths.
- Constrained impersonation adds operation-specific checks while retaining
compatibility with existing
impersonate rules.
- Mutating admission policies require bindings and use CEL apply configurations
or JSON Patch; escape
/ and ~ in JSON Patch keys.
- Restricted Pod security rejects probes and lifecycle handlers with a remote
host.
supplementalGroupsPolicy: Strict prevents image /etc/group memberships
from being merged.
Networking, storage, and client essentials
- Use supported
trafficDistribution values and validate canonical IP/CIDR
forms while accounting for relaxed Service-name validation.
- Treat Gateway features by channel. Experimental kinds use
gateway.networking.x-k8s.io and X prefixes and must be recreated if they
graduate to stable identities.
- Stable
VolumeAttributesClass supports CSI ModifyVolume; PV finalizers make
Delete reclaim reliable; CSI allocatable counts can refresh dynamically.
- Image volumes require compatible runtimes. Volume group snapshots provide one
crash-consistent recovery point across PVCs. SELinux mount labeling can fail
on shared-label conflicts.
- Informers process events in order and atomic list updates expose one resource
version. Large LISTs consume APF seats by memory size.
- Use
/flagz and /statusz for authorized structured diagnostics; enable
enableSystemLogQuery for node logs. Kubelet PSI metrics require cgroup v2.
- Keep kubectl preferences in
.kuberc; use its credential-plugin policy and
allowlist. Use kubectl -o kyaml for Kubernetes-oriented YAML output.
1---2name: kubernetes-knowledge-patch3description: Kubernetes4license: MIT5---678# Kubernetes Knowledge Patch910Use this skill before changing Kubernetes manifests, cluster configuration,11controllers, scheduler plugins, node setup, client integrations, or operational12tooling. Start with the upgrade hazards, then open the reference matching the13task; details that differ by patch release remain attributed in the references.1415## Reference index1617| Reference | Topics |18| --- | --- |19| [API extensibility and clients](references/api-extensibility-and-clients.md) | CRDs, aggregated APIs, client-go, protobuf, serializers, streaming APIs |20| [Control plane and observability](references/control-plane-and-observability.md) | API server, watches, APF, feature gates, metrics, diagnostics, mixed-version proxy |21| [Dynamic Resource Allocation](references/dynamic-resource-allocation.md) | ResourceClaims, ResourceSlices, DRA drivers, sharing, health, binding, quotas |22| [Kubectl and kubeadm](references/kubectl-and-kubeadm.md) | kuberc, KYAML, command changes, kubeadm endpoints, probes, arguments |23| [Networking and Gateway API](references/networking-and-gateway-api.md) | Services, EndpointSlices, kube-proxy, Gateway API, Ingress migration |24| [Nodes, runtimes, and kubelet](references/nodes-runtimes-and-kubelet.md) | cgroup v2, runtime discovery, kubelet configuration, node capabilities, pressure |25| [Security, identity, and admission](references/security-identity-and-admission.md) | authentication, authorization, ServiceAccounts, Pod identity, admission, audit |26| [Storage](references/storage.md) | PVs, CSI, snapshots, VolumeAttributesClass, image volumes, migration |27| [Workloads and scheduling](references/workloads-and-scheduling.md) | Pods, containers, Jobs, controllers, HPA, resize, scheduling, workload APIs |2829## Breaking changes and deprecations3031### Clear node startup blockers3233- Linux kubelets require cgroup v2. Treat `failCgroupV1: false` plus an ignored34 kubeadm preflight error only as an explicit compatibility override.35- Remove kubelet `--pod-infra-container-image`; leaving it configured prevents36 startup. Remove `--cloud-config` and `--register-schedulable` too.37- Let kubelet discover the cgroup driver from CRI. Manual `cgroupDriver` and38 `--cgroup-driver` selection are deprecated.39- Upgrade old runtimes before using image volumes, strict supplemental groups,40 user namespaces, or other runtime-dependent features.4142### Migrate APIs and extension contracts4344- Use `resource.k8s.io/v1` for core DRA objects. Delete or recreate incompatible45 alpha DRA objects and partitionable-device data as the DRA reference directs.46- Use `storage.k8s.io/v1` for `VolumeAttributesClass` and `v1beta1` for47 `StorageVersionMigration`; delete unsupported alpha objects before upgrade.48- Use `admissionregistration.k8s.io/v1` for `MutatingAdmissionPolicy`; beta-era49 storage may still require migration.50- Kubectl no longer accepts legacy beta CSR, EndpointSlice, Ingress, or51 PodDisruptionBudget objects.52- Kubernetes API Go types and extension protocols use standard protobuf. Remove53 gogo registry and `ProtoMessage()` assumptions.54- Scheduler extensions import framework types from55 `k8s.io/kube-scheduler/framework` and must implement current preflight result56 and workload-state contracts.5758### Remove obsolete configuration5960- Delete feature-gate names after graduation or removal. Components reject an61 enabled feature when a required dependency is disabled.62- Remove kube-apiserver cloud-provider flags and configure external cloud63 integration separately.64- Move leader-election locks from `configmapsleases` or `endpointsleases` to65 `leases`.66- Update renamed metrics and labels before upgrading dashboards and alerts;67 several API-server metrics now separate API groups from resource labels.68- Configure `--peer-ca-file` before depending on mixed-version API-server69 proxying.70- When request-header and ordinary client CA bundles overlap, set71 `--requestheader-allowed-names`.7273### Replace deprecated networking and volumes7475- Read Services through every labeled EndpointSlice, not the deprecated76 Endpoints object.77- Prefer kube-proxy `nftables`; IPVS is deprecated.78- Replace `trafficDistribution: PreferClose` with `PreferSameZone` or79 `PreferSameNode`.80- Plan alternatives to `Service.spec.externalIPs` with LoadBalancer, NodePort,81 or Gateway API exposure.82- Migrate Ingress NGINX deployments to Gateway API and inspect every warning or83 approximate ingress2gateway conversion.84- Replace `gitRepo` volumes with an init container or git-sync. The feature-gate85 escape hatch is gone.86- Migrate removed in-tree and flex-volume integrations to CSI before upgrading.8788### Update command and access assumptions8990- Write `kubectl exec POD -- COMMAND`; the separator is required.91- Expect `kubectl debug` to use the `general` profile unless selected otherwise.92- Add `--show-events` when describing multiple objects and events are needed.93- Grant `create` on `pods/exec`, `pods/attach`, and `pods/portforward`;94 WebSocket access no longer succeeds with only `get`.95- Do not interpret `PodReadyToStartContainers=True` as proof that image pulling96 has completed.9798## Workload quick reference99100### Resize running Pods through the subresource101102`spec.containers[*].resources` is desired state; container status reports actual103resources. Submit CPU and memory changes through the `resize` subresource and104inspect `PodResizePending` or `PodResizeInProgress` conditions.105106```console107kubectl edit pod <pod-name> --subresource resize108```109110Memory reductions, swap, static CPU or Memory Manager policies, native sidecars,111init containers, and Pod-level resources have distinct restrictions. Read the112workload reference before automating resize.113114### Use Pod-level resource budgets deliberately115116Pod-wide CPU, memory, and huge-page requests and limits can simplify scheduling117and HPA calculations. They are unsupported on Windows, and topology-aware118manager integration depends on the active behavior. A missing container limit119in `resourceFieldRef` can fall back to the Pod-level limit.120121```yaml122spec:123 resources:124 requests:125 cpu: "2"126 memory: 4Gi127 limits:128 cpu: "4"129 memory: 8Gi130```131132### Distinguish sidecars and restart rules133134- A native sidecar is an `initContainers` entry with container-level135 `restartPolicy: Always`; it preserves init ordering, runs with the app, stops136 in reverse order, and does not block Job completion.137- Regular and init containers can have per-container policies and exit-code138 rules. Restart-all rules can restart every container when a selected source139 exits.140- `lifecycle.stopSignal` can override the image or runtime signal when the Pod141 declares its OS.142143### Choose Job semantics explicitly144145- Indexed Jobs support per-index retry limits, failed-index caps, `FailIndex`,146 and success policies.147- Set `podReplacementPolicy: Failed` to avoid overlapping a terminating Pod and148 its replacement.149- Suspended Jobs can accept resource and scheduling edits under the applicable150 feature behavior; active Pods remain immutable.151- `managedBy` delegates reconciliation but does not carry controller parameters.152- PodGroups provide all-or-nothing scheduling; use the current153 `scheduling.k8s.io` API and conditions.154155## Dynamic Resource Allocation essentials156157### Select claim lifecycle correctly158159- A direct `ResourceClaim` is namespaced, reusable by multiple Pods, and160 manually managed.161- A `ResourceClaimTemplate` creates one claim per Pod and deletes it with the162 Pod.163- Do not set `spec.nodeName` on DRA Pods. Use an exact hostname node selector so164 scheduling still allocates and reserves devices.165- Quota can charge device-class and mapped extended-resource keys.166167### Account for advanced allocation168169- Prioritized alternatives, taints and tolerations, shared counters, consumable170 capacity, binding conditions, and extended-resource mapping affect eligibility171 and timing.172- Drivers report device status and health; `Unknown` and `Unhealthy` allocations173 appear in Pod status.174- Binding can wait for external preparation and time out under scheduler175 configuration.176- Status writers need granular binding and driver subresource permissions.177- Drivers and ResourceSlice implementations must honor the stable kubelet178 plugin protocol and release-specific migrations.179180## Security and identity essentials181182### Prefer bounded workload credentials183184- Bound ServiceAccount tokens carry JTI and node identity and can be restricted185 to a designated node.186- Kubelet image credential providers can request short-lived, audience-bound187 ServiceAccount tokens.188- Cached private images can require fresh credential verification according to189 `imagePullCredentialsVerificationPolicy`.190- Pod certificates let kubelet generate, request, rotate, and project X.509191 credentials; verify feature and API enablement.192- CSI ServiceAccount tokens belong in the secrets channel rather than routinely193 logged volume context.194195### Harden authorization and admission196197- Selector-aware authorization can require field or label selectors for list,198 watch, and delete-collection requests.199- Restrict anonymous authentication to explicit health paths.200- Constrained impersonation adds operation-specific checks while retaining201 compatibility with existing `impersonate` rules.202- Mutating admission policies require bindings and use CEL apply configurations203 or JSON Patch; escape `/` and `~` in JSON Patch keys.204- Restricted Pod security rejects probes and lifecycle handlers with a remote205 `host`.206- `supplementalGroupsPolicy: Strict` prevents image `/etc/group` memberships207 from being merged.208209## Networking, storage, and client essentials210211- Use supported `trafficDistribution` values and validate canonical IP/CIDR212 forms while accounting for relaxed Service-name validation.213- Treat Gateway features by channel. Experimental kinds use214 `gateway.networking.x-k8s.io` and `X` prefixes and must be recreated if they215 graduate to stable identities.216- Stable `VolumeAttributesClass` supports CSI `ModifyVolume`; PV finalizers make217 `Delete` reclaim reliable; CSI allocatable counts can refresh dynamically.218- Image volumes require compatible runtimes. Volume group snapshots provide one219 crash-consistent recovery point across PVCs. SELinux mount labeling can fail220 on shared-label conflicts.221- Informers process events in order and atomic list updates expose one resource222 version. Large LISTs consume APF seats by memory size.223- Use `/flagz` and `/statusz` for authorized structured diagnostics; enable224 `enableSystemLogQuery` for node logs. Kubelet PSI metrics require cgroup v2.225- Keep kubectl preferences in `.kuberc`; use its credential-plugin policy and226 allowlist. Use `kubectl -o kyaml` for Kubernetes-oriented YAML output.