Kubernetes Knowledge Patch
Use this skill before changing Kubernetes manifests, cluster configuration,
controllers, scheduler plugins, node setup, clients, or operational tooling.
Start with the upgrade hazards, then open the topic reference that matches the
task. Prefer the cluster's manifests, code, tests, and observed behavior when
they disagree with guidance.
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, audit, 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 a temporary compatibility override.
- Remove kubelet
--pod-infra-container-image; leaving it configured prevents
startup.
- Remove kubelet
--cloud-config and --register-schedulable.
StreamingConnectionIdleTimeout is deprecated.
- Let kubelet discover the cgroup driver from CRI. Manual
cgroupDriver and
--cgroup-driver selection are deprecated; remaining configuration-flag
fallback is scheduled for removal in 1.38.
- Upgrade old runtimes before relying on image volumes, strict supplemental
groups, user namespaces, or newer kubelet integrations.
Migrate removed APIs and extension contracts
- Use
resource.k8s.io/v1 for core DRA objects. Remove or recreate incompatible
alpha DRA data before crossing the documented upgrade boundaries.
- Use
storage.k8s.io/v1 for VolumeAttributesClass and the v1beta1
StorageVersionMigration API; delete unsupported alpha objects first.
- Use
admissionregistration.k8s.io/v1 for MutatingAdmissionPolicy and
migrate older stored objects before removing their served versions.
- Use
scheduling.k8s.io/v1alpha2 for Workload and PodGroup objects. The
v1alpha1 Workload API is removed.
- 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 return
types and parallelism contracts.
Remove obsolete configuration
- Delete removed feature-gate names. Components reject enabled features whose
dependencies are disabled.
- Remove kube-apiserver cloud-provider flags and configure external cloud
integration separately.
- Move leader-election locks from
configmapsleases or endpointsleases to
leases.
- Update metric names and API-group labels before upgrading dashboards and
alerts.
- Configure
--peer-ca-file before relying 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 all labeled EndpointSlices, 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.
- Migrate Ingress NGINX deployments to Gateway API and review every approximate
ingress2gateway conversion.
- Replace
gitRepo volumes with an init container or git-sync. The old
feature-gate escape hatch is gone.
- Migrate removed in-tree and flex-volume integrations to CSI before control
plane upgrades.
Update command and access assumptions
- Write
kubectl exec POD -- COMMAND; the separator is required.
- Expect
kubectl debug to use the general profile unless another profile is
selected.
- Add
--show-events when describing multiple objects and related events are
required.
- Grant
create on pods/exec, pods/attach, and pods/portforward;
WebSocket access no longer succeeds with only get.
- Do not treat
PodReadyToStartContainers=True as proof that image pulling is
complete.
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 changes, swap, static CPU or Memory Manager policies, 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 simplify shared
budgets and HPA calculations. They are unsupported on Windows, and topology
manager integration depends on the active behavior.
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 restart policies and
exit-code rules. Restart-all rules can restart every container when a
selected source container exits.
lifecycle.stopSignal can override the image or runtime signal when the Pod
declares its OS.
Choose Job semantics explicitly
- Indexed Jobs can use
backoffLimitPerIndex, maxFailedIndexes, FailIndex,
and successPolicy.
- Set
podReplacementPolicy: Failed to avoid overlapping a terminating Pod
with its replacement.
- Suspended Jobs can accept resource and scheduling edits under the applicable
feature behavior; active Pods remain immutable.
managedBy delegates Job reconciliation but does not encode controller
parameters.
- PodGroups provide all-or-nothing scheduling through the current
scheduling.k8s.io API and condition semantics.
Dynamic Resource Allocation quick reference
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 keys and mapped extended-resource keys.
Account for advanced allocation
Prioritized alternatives, device taints and tolerations, shared counters,
consumable capacity, binding conditions, and extended-resource mapping affect
eligibility and timing. Drivers can report device status and health, and DRA
status writers need granular binding and driver subresource permissions.
Security and identity quick reference
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 through
imagePullCredentialsVerificationPolicy.
- Pod certificates let kubelet generate, request, rotate, and project X.509
credentials; verify feature and API enablement before depending on them.
- Put CSI ServiceAccount tokens 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 use CEL apply configurations or JSON Patch and
require bindings; escape
/ and ~ in JSON Patch keys.
- Restricted Pod security rejects probes and lifecycle handlers with an
explicit remote
host.
supplementalGroupsPolicy: Strict prevents image /etc/group memberships
from being merged.
Operations quick reference
- Use
trafficDistribution for Service locality and validate strict IP and
CIDR forms while accounting for relaxed Service-name rules.
- Treat Gateway API Standard and Experimental channels as distinct identities;
experimental
X resources must be recreated if they graduate.
- Informers process events in order, and atomic list/relist updates let handlers
observe one resource version.
- Large LIST operations consume APF seats according to memory size; WatchList
changes initial-list behavior.
- Use
/flagz and /statusz structured output for authorized diagnostics;
node log queries also require enableSystemLogQuery: true.
- Keep personal kubectl behavior in
.kuberc; use its credential-plugin policy
and allowlist when command overrides are shared.
- Use
kubectl -o kyaml for Kubernetes-oriented output when a less ambiguous
YAML representation is useful.
1---2name: kubernetes-knowledge-patch-23description: Kubernetes4license: MIT5---678# Kubernetes Knowledge Patch910Use this skill before changing Kubernetes manifests, cluster configuration,11controllers, scheduler plugins, node setup, clients, or operational tooling.12Start with the upgrade hazards, then open the topic reference that matches the13task. Prefer the cluster's manifests, code, tests, and observed behavior when14they disagree with guidance.1516## Reference index1718| Reference | Topics |19| --- | --- |20| [API extensibility and clients](references/api-extensibility-and-clients.md) | CRDs, aggregated APIs, client-go, protobuf, serializers, streaming APIs |21| [Control plane and observability](references/control-plane-and-observability.md) | API server, watches, APF, feature gates, metrics, diagnostics, audit, mixed-version proxy |22| [Dynamic Resource Allocation](references/dynamic-resource-allocation.md) | ResourceClaims, ResourceSlices, DRA drivers, sharing, health, binding, quotas |23| [Kubectl and kubeadm](references/kubectl-and-kubeadm.md) | kuberc, KYAML, command changes, kubeadm endpoints, probes, arguments |24| [Networking and Gateway API](references/networking-and-gateway-api.md) | Services, EndpointSlices, kube-proxy, Gateway API, Ingress migration |25| [Nodes, runtimes, and kubelet](references/nodes-runtimes-and-kubelet.md) | cgroup v2, runtime discovery, kubelet configuration, node capabilities, pressure |26| [Security, identity, and admission](references/security-identity-and-admission.md) | authentication, authorization, ServiceAccounts, Pod identity, admission, audit |27| [Storage](references/storage.md) | PVs, CSI, snapshots, VolumeAttributesClass, image volumes, migration |28| [Workloads and scheduling](references/workloads-and-scheduling.md) | Pods, containers, Jobs, controllers, HPA, resize, scheduling, workload APIs |2930## Breaking changes and deprecations3132### Clear node startup blockers3334- Linux kubelets require cgroup v2. Treat `failCgroupV1: false` plus an35 ignored kubeadm preflight error only as a temporary compatibility override.36- Remove kubelet `--pod-infra-container-image`; leaving it configured prevents37 startup.38- Remove kubelet `--cloud-config` and `--register-schedulable`.39 `StreamingConnectionIdleTimeout` is deprecated.40- Let kubelet discover the cgroup driver from CRI. Manual `cgroupDriver` and41 `--cgroup-driver` selection are deprecated; remaining configuration-flag42 fallback is scheduled for removal in 1.38.43- Upgrade old runtimes before relying on image volumes, strict supplemental44 groups, user namespaces, or newer kubelet integrations.4546### Migrate removed APIs and extension contracts4748- Use `resource.k8s.io/v1` for core DRA objects. Remove or recreate incompatible49 alpha DRA data before crossing the documented upgrade boundaries.50- Use `storage.k8s.io/v1` for `VolumeAttributesClass` and the `v1beta1`51 `StorageVersionMigration` API; delete unsupported alpha objects first.52- Use `admissionregistration.k8s.io/v1` for `MutatingAdmissionPolicy` and53 migrate older stored objects before removing their served versions.54- Use `scheduling.k8s.io/v1alpha2` for Workload and PodGroup objects. The55 `v1alpha1` Workload API is removed.56- Kubectl no longer accepts legacy beta CSR, EndpointSlice, Ingress, or57 PodDisruptionBudget objects.58- Kubernetes API Go types and extension protocols use standard protobuf.59 Remove gogo registry and `ProtoMessage()` assumptions.60- Scheduler extensions import framework types from61 `k8s.io/kube-scheduler/framework` and must implement current preflight return62 types and parallelism contracts.6364### Remove obsolete configuration6566- Delete removed feature-gate names. Components reject enabled features whose67 dependencies are disabled.68- Remove kube-apiserver cloud-provider flags and configure external cloud69 integration separately.70- Move leader-election locks from `configmapsleases` or `endpointsleases` to71 `leases`.72- Update metric names and API-group labels before upgrading dashboards and73 alerts.74- Configure `--peer-ca-file` before relying on mixed-version API-server75 proxying.76- When request-header and ordinary client CA bundles overlap, set77 `--requestheader-allowed-names`.7879### Replace deprecated networking and volumes8081- Read Services through all labeled EndpointSlices, not the deprecated82 Endpoints object.83- Prefer kube-proxy `nftables`; IPVS is deprecated.84- Replace `trafficDistribution: PreferClose` with `PreferSameZone` or85 `PreferSameNode`.86- Plan alternatives to `Service.spec.externalIPs` with LoadBalancer, NodePort,87 or Gateway API.88- Migrate Ingress NGINX deployments to Gateway API and review every approximate89 ingress2gateway conversion.90- Replace `gitRepo` volumes with an init container or git-sync. The old91 feature-gate escape hatch is gone.92- Migrate removed in-tree and flex-volume integrations to CSI before control93 plane upgrades.9495### Update command and access assumptions9697- Write `kubectl exec POD -- COMMAND`; the separator is required.98- Expect `kubectl debug` to use the `general` profile unless another profile is99 selected.100- Add `--show-events` when describing multiple objects and related events are101 required.102- Grant `create` on `pods/exec`, `pods/attach`, and `pods/portforward`;103 WebSocket access no longer succeeds with only `get`.104- Do not treat `PodReadyToStartContainers=True` as proof that image pulling is105 complete.106107## Workload quick reference108109### Resize running Pods through the subresource110111`spec.containers[*].resources` is desired state; container status reports112actual resources. Submit CPU and memory changes through the `resize`113subresource and inspect `PodResizePending` or `PodResizeInProgress` conditions.114115```console116kubectl edit pod <pod-name> --subresource resize117```118119Memory changes, swap, static CPU or Memory Manager policies, sidecars, init120containers, and Pod-level resources have distinct restrictions. Read the121workload reference before automating resize.122123### Use Pod-level resource budgets deliberately124125Pod-wide CPU, memory, and huge-page requests and limits simplify shared126budgets and HPA calculations. They are unsupported on Windows, and topology127manager integration depends on the active behavior.128129```yaml130spec:131 resources:132 requests:133 cpu: "2"134 memory: 4Gi135 limits:136 cpu: "4"137 memory: 8Gi138```139140### Distinguish sidecars and restart rules141142- A native sidecar is an `initContainers` entry with container-level143 `restartPolicy: Always`; it preserves init ordering, runs with the app, stops144 in reverse order, and does not block Job completion.145- Regular and init containers can have per-container restart policies and146 exit-code rules. Restart-all rules can restart every container when a147 selected source container exits.148- `lifecycle.stopSignal` can override the image or runtime signal when the Pod149 declares its OS.150151### Choose Job semantics explicitly152153- Indexed Jobs can use `backoffLimitPerIndex`, `maxFailedIndexes`, `FailIndex`,154 and `successPolicy`.155- Set `podReplacementPolicy: Failed` to avoid overlapping a terminating Pod156 with its replacement.157- Suspended Jobs can accept resource and scheduling edits under the applicable158 feature behavior; active Pods remain immutable.159- `managedBy` delegates Job reconciliation but does not encode controller160 parameters.161- PodGroups provide all-or-nothing scheduling through the current162 `scheduling.k8s.io` API and condition semantics.163164## Dynamic Resource Allocation quick reference165166### Select claim lifecycle correctly167168- A direct `ResourceClaim` is namespaced, reusable by multiple Pods, and169 manually managed.170- A `ResourceClaimTemplate` creates one claim per Pod and deletes it with the171 Pod.172- Do not set `spec.nodeName` on DRA Pods. Use an exact hostname node selector173 so scheduling still allocates and reserves devices.174- Quota can charge device-class keys and mapped extended-resource keys.175176### Account for advanced allocation177178Prioritized alternatives, device taints and tolerations, shared counters,179consumable capacity, binding conditions, and extended-resource mapping affect180eligibility and timing. Drivers can report device status and health, and DRA181status writers need granular binding and driver subresource permissions.182183## Security and identity quick reference184185### Prefer bounded workload credentials186187- Bound ServiceAccount tokens carry JTI and node identity and can be restricted188 to a designated node.189- Kubelet image credential providers can request short-lived, audience-bound190 ServiceAccount tokens.191- Cached private images can require fresh credential verification through192 `imagePullCredentialsVerificationPolicy`.193- Pod certificates let kubelet generate, request, rotate, and project X.509194 credentials; verify feature and API enablement before depending on them.195- Put CSI ServiceAccount tokens in the secrets channel rather than routinely196 logged volume context.197198### Harden authorization and admission199200- Selector-aware authorization can require field or label selectors for list,201 watch, and delete-collection requests.202- Restrict anonymous authentication to explicit health paths.203- Constrained impersonation adds operation-specific checks while retaining204 compatibility with existing `impersonate` rules.205- Mutating admission policies use CEL apply configurations or JSON Patch and206 require bindings; escape `/` and `~` in JSON Patch keys.207- Restricted Pod security rejects probes and lifecycle handlers with an208 explicit remote `host`.209- `supplementalGroupsPolicy: Strict` prevents image `/etc/group` memberships210 from being merged.211212## Operations quick reference213214- Use `trafficDistribution` for Service locality and validate strict IP and215 CIDR forms while accounting for relaxed Service-name rules.216- Treat Gateway API Standard and Experimental channels as distinct identities;217 experimental `X` resources must be recreated if they graduate.218- Informers process events in order, and atomic list/relist updates let handlers219 observe one resource version.220- Large LIST operations consume APF seats according to memory size; WatchList221 changes initial-list behavior.222- Use `/flagz` and `/statusz` structured output for authorized diagnostics;223 node log queries also require `enableSystemLogQuery: true`.224- Keep personal kubectl behavior in `.kuberc`; use its credential-plugin policy225 and allowlist when command overrides are shared.226- Use `kubectl -o kyaml` for Kubernetes-oriented output when a less ambiguous227 YAML representation is useful.