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

Cifs plugin doesn't work if i use it in deployment #15

Open
Gizmos777 opened this issue Feb 25, 2020 · 3 comments
Open

Cifs plugin doesn't work if i use it in deployment #15

Gizmos777 opened this issue Feb 25, 2020 · 3 comments

Comments

@Gizmos777
Copy link

Gizmos777 commented Feb 25, 2020

Hello. I use cifs plugin and it work if i use as pod. I have decided as deployment, but it doesn't work

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: services
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80
        imagePullPolicy: IfNotPresent
        volumeMounts:
        - name: cifs-share
          mountPath: /data
        resources:
          limits:
            cpu: 300m
            memory: 128Mi
          requests:
            cpu: "200m"
            memory: 128Mi
      volumes:
      - name: cifs-share
        flexVolume:
          driver: fstab/cifs
          fsType: cifs
          options:
            mountOptions: dir_mode=0755,file_mode=0644,noperm
            networkPath: //server/data
          secretRef:
            name: cifs-secret

Status pod:

nginx-deployment-5864c58f6f-rbssq 0/1 ContainerCreating 0 8m4s

Describe pod:
Unable to mount volumes for pod "nginx-deployment-5864c58f6f-rbssq_ccqc-services(074e8f98-b98d-408c-9070-46864d460cf7)": timeout expired waiting for volumes to attach or mount for pod "ccqc-services"/"nginx-deployment-5864c58f6f-rbssq". list of unmounted volumes=[cifs-share]. list of unattached volumes=[cifs-share default-token-24bkz]

@aptdamia
Copy link

While mostly a workaround, could you try using volume claims?
https://stackoverflow.com/questions/46906068/is-there-any-way-to-have-a-flex-volume-inside-a-persistent-volume-claim

@CaptainMcCurry
Copy link

To add to this, I have been using this module from PV/PVC within a deployment, unfortunately it only works as ReadOnly when deployed this way. If I attempt to mount it as ReadWrite the pods will fail to launch.

@kfehrenbach
Copy link

kfehrenbach commented May 6, 2020

For me this is working within a deployment. Here is my YAML, so you can compare:

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  labels:
    app: elasticdump
  name: elasticdump
spec:
  replicas: 1
  selector:
    matchLabels:
      app: elasticdump
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        co.elastic.logs/enabled: "true"
      labels:
        app: elasticdump
    spec:
      containers:
      - name: elasticdump
        image: 10.173.8.16:5000/taskrabbit/elasticsearch-dump:v6.28.0
        args:
        - elasticdump
        - --input=http://elastic/test_index
        - --output=/mnt/test_index.json
        - --type=data
        imagePullPolicy: IfNotPresent
        volumeMounts:
        - name: backup
          mountPath: /mnt
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      volumes:
      - name: backup
        flexVolume:
          driver: "fstab/cifs"
          fsType: "cifs"
          secretRef:
            name: "cifs-secret"
          options:
            networkPath: "\\\\t1ref-hv1\\Share_ES"
            mountOptions: "dir_mode=0755,file_mode=0644,noperm"

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

No branches or pull requests

4 participants