-
Notifications
You must be signed in to change notification settings - Fork 1.6k
The container local-volume-provisioner run well, but it doesn't autocreate pv. #713
Comments
You should use /mnt/disks as the discovery directory, not the full volume path. The provisioner will detect all the mountpoints under the discovery directory |
@msau42 I have used /mnt/disks as the discovery directory, but the result is not well. It still doesn't autocreate pvs. The container error log is as below: Error creating PV "local-pv-59de7908" for volume at "/mnt/disks/vol3": PersistentVolume "local-pv-59de7908" is invalid: [metadata.annotations: Forbidden: Storage node affinity is disabled by feature-gate, spec.local: Forbidden: Local volumes are disabled by feature-gate |
@SFHfeihong You need enable Local volume feature ( |
@wenlxie Thanks. The problem has been solved. |
/close |
I am still facing similar problem. Everything seems good in my case. POD is up & running. Mount directories are also created on nodes, but PVs were not created automatically. As per provisioner:v2.1.0 pod logs: This issue is closed, but I want to reopen it. |
Can you list the paths of your mount points and also show your daemonset spec? |
One more information, I am running Kubernetes v1.11.3 in Rancher 2.0. local-storage-provisioner.yaml local-storage-rbac.yaml |
@AmreeshTyagi the configuration looks correct to me. Where are you creating the mount points? Can you show the mount points on your host system? |
Not sure, if you are asking for showmount or fstab on worker nodes.
I also executed following commands to check mount bind created by provisioner on worker host machine.
|
The purpose of the local static provisioner is to detect local precreated mount points, expose them as PVs, and manage their lifecycle. However, it does not dynamically create volumes. If you're looking for a simple dynamic provisioner that can create directories out of a shared volume, then you may want to take a look at this: https://github.com/rancher/local-path-provisioner |
Kubernetes version: 1.9.3
Docker version: 17.03.2-ce
Local-volume-provisioner version: v2.0.0
The config files are as follow:
configmap file:
apiVersion: v1
kind: ConfigMap
metadata:
name: local-provisioner-config
namespace: default
data:
storageClassMap: |
local-storage:
hostDir: /mnt/disks/vol1
mountDir: /mnt/disks/vol1
local-volume-provisioner-create.yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: local-volume-provisioner
namespace: default
labels:
app: local-volume-provisioner
spec:
selector:
matchLabels:
app: local-volume-provisioner
template:
metadata:
labels:
app: local-volume-provisioner
spec:
serviceAccountName: local-storage-admin
containers:
- image: "quay.io/external_storage/local-volume-provisioner:v2.0.0"
imagePullPolicy: "IfNotPresent"
name: provisioner
securityContext:
privileged: true
env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /etc/provisioner/config
name: provisioner-config
readOnly: true
- mountPath: /mnt/disks/vol1
name: local-fast
volumes:
- name: provisioner-config
configMap:
name: local-provisioner-config
- name: local-fast
hostPath:
path: /mnt/disks/vol1
The serviceaccount, storageclass, clusterroles and clusterRoleBinding have been created.
The status of containers is running.
NAME READY STATUS RESTARTS AGE
local-volume-provisioner-6r95m 1/1 Running 0 23m
local-volume-provisioner-rq5gs 1/1 Running 0 23m
The mount dir on each node:
Filesystem Size Used Avail Use% Mounted on
vol1 924M 0 924M 0% /mnt/disks/vol1
But when i get pv, there is no resources. I don't know what's wrong. Is there error in config file?
The text was updated successfully, but these errors were encountered: