Open Gizmos777 opened 4 years ago
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
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.
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"
Hello. I use cifs plugin and it work if i use as pod. I have decided as deployment, but it doesn't work
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]