Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The container mounted /var/lib/containers cannot read the merged directory of the container started after it #5188

Closed
LinanV opened this issue Aug 11, 2021 · 7 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@LinanV
Copy link

LinanV commented Aug 11, 2021

hi, Team:

this's my env.

Version: 0.1.0
RuntimeName: cri-o
RuntimeVersion: 1.20.3-6.rhaos4.7.git0d0f863.el8
RuntimeApiVersion: v1alpha1

OpenshiftVersion: 4.7

detail:
step 1: start a privileged container mounted /var/lib/containers:/var/lib/containers and named A

step 2: start a normal container named Busybox after A

step 3: use crictl inspect <contianer-id> to search Busybox merged directory
image

step4: into container A, view Busybox merged directory like this:
image
can not view any file or direcotry in Busybox merged directory.

but on the host:
image

Could you help me solve this problem?

@haircommander
Copy link
Member

what is the pod spec for A?

@LinanV
Copy link
Author

LinanV commented Aug 11, 2021

what is the pod spec for A?
A's spec the same as this:
spec:
selector:
matchLabels:
app: ciss
template:
metadata:
creationTimestamp: null
labels:
app: ciss
spec:
restartPolicy: Always
serviceAccountName: ncsp-account
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
securityContext: {}
containers:
- resources:
limits:
memory: 1Gi
terminationMessagePath: /dev/termination-log
name: main
env:
- name: LOG_LEVEL
value: INFO
- name: CONTAINER_SOCKET
value: 'unix:///var/run/crio/crio.sock'
securityContext:
privileged: true
ports:
- hostPort: 38418
containerPort: 38418
protocol: TCP
imagePullPolicy: Always
volumeMounts:
- name: crio-sock
mountPath: /var/run/crio/crio.sock
- name: container-fs
mountPath: /var/lib/containers
terminationMessagePolicy: File
image: 'image-registry.openshift-image-registry.svc:5000/ctnsec/ciss:latest'
serviceAccount: ncsp-account
volumes:
- name: crio-sock
hostPath:
path: /var/run/crio/crio.sock
type: Socket
- name: container-fs
hostPath:
path: /var/lib/containers
type: Directory
dnsPolicy: ClusterFirst
tolerations:
- operator: Exists
effect: NoSchedule
- key: CriticalAddonsOnly
operator: Exists
- operator: Exists
effect: NoExecute
- key: node-role.kubernetes.io/master
effect: NoSchedule
- key: node.kubernetes.io/not-ready
operator: Equal
effect: NoSchedule
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
revisionHistoryLimit: 9

Thanks!

@V1nceZhang
Copy link

Also encountered the same problem, hope to answer

@haircommander
Copy link
Member

could you update to latest 4.7 to see if it fixes the issue? we have had a fix in our container storage library that may help

@LinanV
Copy link
Author

LinanV commented Aug 18, 2021

could you update to latest 4.7 to see if it fixes the issue? we have had a fix in our container storage library that may help

thanks, let me try

@saschagrunert
Copy link
Member

A friendly reminder that this issue had no activity for 30 days.

@saschagrunert saschagrunert added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 28, 2022
@haircommander
Copy link
Member

I believe this issue is still present, and has to do with mount propegation of the home directory for c/storage. Adding the skip_mount_home option to /etc/containers/storage.conf fixes I believe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants