Skip to content

Incorrect kubectl attach commands in image volume documentation #53623

@yanhuan0802

Description

@yanhuan0802

Description

The image volume documentation contains incorrect kubectl attach commands that will not work as intended.

Problem

The documentation currently uses kubectl attach -it image-volume bash, which:

  1. Includes an invalid bash argument (kubectl attach doesn't accept command arguments)
  2. Cannot provide interactive shell access when the container's main process is sleep infinity
  3. Will result in "Unable to use a TTY" errors for users

Expected Behavior

The documentation should use kubectl exec -it image-volume -- bash to correctly:

  • Start a new bash process inside the container
  • Provide proper interactive terminal access
  • Follow Kubernetes best practices for container interaction

Affected Files

English documentation:

  • content/en/docs/tasks/configure-pod-container/image-volumes.md (2 occurrences)
  • content/en/blog/_posts/2025-04-29-image-volume-beta/index.md (1 occurrence)

Chinese documentation:

  • content/zh-cn/docs/tasks/configure-pod-container/image-volumes.md (2 occurrences)
  • content/zh-cn/blog/_posts/2025-04-29-image-volume-beta/index.md (1 occurrence)

Proposed Solution

Replace all instances of:

kubectl attach -it image-volume bash

With:

kubectl exec -it image-volume -- bash

Additional Context

/sig docs
/language en
/language zh

Metadata

Metadata

Assignees

Labels

language/enIssues or PRs related to English languagelanguage/zhIssues or PRs related to Chinese languageneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.sig/docsCategorizes an issue or PR as relevant to SIG Docs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions