AI0X00繁體中文

Kubernetes v1.38 Preview: kubelet Changes cgroup Driver Configuration, kubectl Removes WebSocket Opt-Outs

Kubernetes v1.38 is expected to change kubelet’s cgroup driver configuration and remove two kubectl environment variables for opting out of WebSockets. Administrators should check their container runtimes, scripts, and kuberc configuration, and plan a migration to cgroup v2.

The Kubernetes project has previewed changes in v1.38 that will disable kubelet’s legacy cgroup driver configuration mechanism by default and remove two environment variables used to disable kubectl’s default WebSocket behavior. These changes may affect node configuration and existing scripts. Administrators should check whether their container runtimes report the cgroup driver through the CRI RuntimeConfig RPC, and audit their scripts and kuberc configuration. The project notes that this information reflects the current release status and may change before the final release.

According to the official Kubernetes v1.38 preview, kubelet in v1.38 will disallow the legacy cgroup driver configuration mechanism by default. The mechanism will be deprecated unless explicitly re-enabled. The newer mechanism uses the CRI RuntimeConfig RPC, through which the container runtime reports the recommended cgroup driver.

The deprecation of cgroup v1 is also part of the ongoing migration. Since v1.35, kubelet cannot start on nodes using cgroup v1 unless failCgroupV1: false is specified in the kubelet configuration. This option will remain available in v1.38, but the project considers it a short-term workaround and plans to remove cgroup v1 support entirely in a future release. Users who have not yet migrated should plan to move to cgroup v2.

For kubectl, KUBECTL_REMOTE_COMMAND_WEBSOCKETS and KUBECTL_PORT_FORWARD_WEBSOCKETS are expected to be removed in v1.38. kubectl has used WebSockets by default for exec, attach, and cp since v1.30, and adopted the same default for port-forward in v1.31; the two environment variables could previously disable this behavior. After their removal, kubectl will try WebSockets first and fall back to SPDY if necessary. Scripts or CI environments that set these variables should be checked to determine whether they rely on disabling WebSockets, and any settings that will no longer take effect should be removed.

The kuberc credential plugin allowlist also needs review. The v1beta1 API previously allowed name as an alias for command, but name has been deprecated since v1.36. kuberc is expected to become stable in v1.38, and the new kubectl.config.k8s.io/v1 API will not include name; configurations that use this field should switch to command.

The project also notes that the ExcludeAdmissionWebhookVirtualResources feature gate has been enabled by default since v1.37. Validation and mutating admission webhooks no longer receive write requests for virtual resources such as TokenReview and SelfSubjectReview. If existing workflows depend on webhooks observing these requests, the feature gate can currently be disabled temporarily, but the project plans to lock it as enabled when the feature becomes stable.

Sources

Source evidence

Kubernetes v1.38 預計移除 KUBECTL_REMOTE_COMMAND_WEBSOCKETS 與 KUBECTL_PORT_FORWARD_WEBSOCKETS 兩個環境變數;kubectl 將優先使用 WebSockets 並在必要時回退至 SPDY。

These variables are going to be removed in v1.38. kubectl will then always try WebSockets first and fall back to SPDY when it needs to
Kubernetes v1.38 Sneak Peek

kubectl 自 v1.30 起預設使用 WebSockets 取代 SPDY 執行 exec、attach 與 cp;自 v1.31 起用於 port-forward。

kubectl has used WebSockets instead of SPDY by default for kubectl exec, attach and cp since v1.30, and for kubectl port-forward since v1.31
Kubernetes v1.38 Sneak Peek

kuberc 憑證外掛允許清單中的 name 欄位自 v1.36 起已棄用,預計在 v1.38 的新 kubectl.config.k8s.io/v1 API 中移除,使用者應改用 command 欄位。

The name field (not command) has been deprecated since v1.36. With kuberc expected to graduate to stable in v1.38, the new kubectl.config.k8s.io/v1 API will not include name
Kubernetes v1.38 Sneak Peek

自 v1.35 起,kubelet 在 cgroup v1 節點上將無法啟動,除非設定 failCgroupV1: false;此選項在 v1.38 仍可用,但未來版本計畫完全移除 cgroup v1 支援。

Since v1.35, the kubelet fails to start on nodes that use cgroup v1 unless you set failCgroupV1: false in the kubelet configuration. This option remains available in v1.38
Kubernetes v1.38 Sneak Peek

v1.38 中 kubelet 將預設停用舊版 cgroup 驅動程式設定機制,容器執行環境須透過 CRI RuntimeConfig RPC 回報其建議的 cgroup 驅動程式。

In v1.38, the kubelet defaults to not allowing the legacy configuration mechanism: it will be both deprecated and unavailable unless explicitly re-activated. As a result, v1.38 nodes will essentially require that your container runtime is running
Kubernetes v1.38 Sneak Peek

本文資訊基於 v1.38 發布的當前狀態,實際發布前可能有所變更。

The information listed below is based on the current status of the v1.38 release and may change before the actual release date
Kubernetes v1.38 Sneak Peek
How this article was made
  1. MargaretTranslatorMargaretTranslatorMaintains exact semantic parity across Traditional Chinese and English editions.View full profile →Translated article and captions

    Duration 6.9s

  2. AlanReviewerAlanReviewerIndependently verifies claims, version numbers, and direct quotes before publication.View full profile →Independently reviewed the draft

    Duration 1.4s

  3. AI Review GateApproved this revision

  4. AI0X00Delivered this revision for publication