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

MountVolume.SetUp failed for volume "podlogs" of a deployment in vCluster #1745

Open
akusingh-tibco opened this issue May 7, 2024 · 1 comment

Comments

@akusingh-tibco
Copy link

What happened?

I created a new vCluster and deployed a deployment but the pod goes in container creating state with the below error:
Warning FailedMount 22s (x11 over 6m34s) kubelet MountVolume.SetUp failed for volume "plogs" : hostPath type check failed: /tmp/vcluster/v-cluster-only-ic-sync/testt/log/pods is not a directory

I tried changing the type of volume to DirectoryOrCreate, the pod came up in running state but in the fluentbit container no logs are visible, following are the error logs of fluentbit-container:
[2024/05/06 12:51:09] [error] [input:tail:tail.0] read error, check permissions: /var/log/pods/dgdr-6868bbb7-hrxlz_fb217ac7-d1ff-47f7-9af7-abb76a8c707f/*.log [2024/05/06 12:51:09] [ warn] [input:tail:tail.0] error scanning path: /var/log/pods/dgdr-6868bbb7-hrxlz_fb217ac7-d1ff-47f7-9af7-abb76a8c707f/*.log

What did you expect to happen?

Ideally the deployment should create the pod and i should see the logs in the fluent bit container, Also i wanted to know how this path is getting created "/tmp/vcluster/v-cluster-only-ic-sync/testt/log/pods" in vCluster as in my deployment volume is as below
volumes: - name: podlogs hostPath: path: /var/log/pods type: Directory

How can we reproduce it (as minimally and precisely as possible)?

Deploy a K8s Deployment with fluentbit as a side car container which has volumeMounts
volumeMounts: - name: podlogs mountPath: /var/log/pods
and deployment has the volume
volumes: - name: podlogs hostPath: path: /var/log/pods type: Directory
Ideally this deployment should get deployed and we should be able to see logs in the fluentbit side car container

Anything else we need to know?

No response

Host cluster Kubernetes version

$ kubectl version
Client Version: v1.28.8-eks-ae9a62a
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.4

Host cluster Kubernetes distribution

Client Version: v1.28.8-eks-ae9a62a
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.4

vlcuster version

$ vcluster --version
vcluster version 0.20.0-beta.1

Vcluster Kubernetes distribution(k3s(default)), k8s, k0s)

k3s

OS and Arch

OS: Mac
Arch: Intel AMD
@akusingh-tibco akusingh-tibco changed the title MountVolume.SetUp failed for volume "plogs" of a deployment in vCluster MountVolume.SetUp failed for volume "podlogs" of a deployment in vCluster May 7, 2024
@deniseschannon deniseschannon added the bug label May 8, 2024 — with Linear
@deniseschannon deniseschannon assigned rmweir and zerbitx and unassigned rmweir and zerbitx Sep 5, 2024
@vardhaman-surana
Copy link

vardhaman-surana commented Dec 17, 2024

hostpathmapper needs to be enabled to use fluent-bit logging in vcluster.
ref: https://www.vcluster.com/docs/vcluster/configure/vcluster-yaml/control-plane/components/host-path-mapper
create a vcluster using the below config. (vcluster version v0.20.1)

controlPlane:
  hostPathMapper:
    enabled: true
  1. install the vcluster hostpath mapper helm chart https://github.com/loft-sh/vcluster-hostpath-mapper
  2. create the deployment with correct fluent-bit config and check the logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants