Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 7 additions & 20 deletions content/en/docs/tasks/configure-pod-container/image-volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,21 @@ to a valid reference and consuming it in the `volumeMounts` of the container. Fo
kubectl apply -f https://k8s.io/examples/pods/image-volumes.yaml
```

1. Attach to the container:

```shell
kubectl attach -it image-volume bash
```

1. Check the content of a file in the volume:

```shell
cat /volume/dir/file
```

The output is similar to:

```none
1
```

You can also check another file in a different path:

```shell
cat /volume/file
kubectl exec image-volume -- cat /volume/etc/os-release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With new updates in content/en/examples/pods/image-volumes.yaml

The correct command here would be following

bash-3.2$ kubectl exec image-volume -- cat /volume/etc/os-release
cat: /volume/etc/os-release: No such file or directory
command terminated with exit code 1
bash-3.2$ kubectl exec image-volume -- sh -c "cat /etc/os-release"
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
bash-3.2$

```

The output is similar to:

```none
2
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.21.3
PRETTY_NAME="Alpine Linux v3.21"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
```

## Further reading
Expand Down
2 changes: 1 addition & 1 deletion content/en/examples/pods/image-volumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ spec:
volumes:
- name: volume
image:
reference: quay.io/crio/artifact:v1
reference: alpine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
reference: alpine
reference: docker.io/library/alpine:3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main branch has already been updated with

  reference: quay.io/crio/artifact:v2

pullPolicy: IfNotPresent