Description of problem: Create a StorageClass for gluster provisioner, setting its gidMin to 0, gidMax to 1. When creating a PVC, the PV could not be provisioned. An error logged 'Failed to provision volume with StorageClass "sc1": StorageClass for provisioner "kubernetes.io/glusterfs" must have gidMax value >= gidMin'. Version-Release number of selected component (if applicable): openshift v3.4.0.33+71c05b2 kubernetes v1.4.0+776c994 etcd 3.1.0-rc.0 How reproducible: Always Steps to Reproduce: 1. Create a StorageClass, setting its gidMin to 0, gidMax to 1. apiVersion: storage.k8s.io/v1beta1 kind: StorageClass metadata: name: sc1 provisioner: kubernetes.io/glusterfs parameters: resturl: "<hidden>" restuser: "xxx" restuserkey: "xxx" gidMin: "0" gidMax: "1" provisioner: kubernetes.io/glusterfs 2. Create a PVC that uses this StorageClass to provision volumes. { "kind": "PersistentVolumeClaim", "apiVersion": "v1", "metadata": { "name": "c1", "annotations": { "volume.beta.kubernetes.io/storage-class": "sc1" } }, "spec": { "accessModes": [ "ReadWriteOnce" ], "resources": { "requests": { "storage": "10Gi" } } } } 3. oc describe pvc c1 Actual results: After step 3: oc describe pvc c1 Name: c1 Namespace: jhou StorageClass: sc1 Status: Pending Volume: Labels: <none> Capacity: Access Modes: Events: FirstSeen LastSeen Count From SubobjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- 5m 1s 25 {persistentvolume-controller } Warning ProvisioningFailed Failed to provision volume with StorageClass "sc1": StorageClass for provisioner "kubernetes.io/glusterfs" must have gidMax value >= gidMin Expected results: Error description should be instructive, the gidMax is already greater than gidMin. Additional info:
When gidMin is 0, it is set to defaultGidMin https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/glusterfs/glusterfs.go#L914. This explains the issue, but even if it is set to defaultGidMin, the value is not reflected when retrieving the StorageClass. # oc get storageclass sc1 -o yaml apiVersion: storage.k8s.io/v1beta1 kind: StorageClass metadata: creationTimestamp: 2016-12-07T07:37:58Z name: sc1 resourceVersion: "6251" selfLink: /apis/storage.k8s.io/v1beta1/storageclasses/sc1 uid: 135676bf-bc50-11e6-be56-0ede06b6a4a4 parameters: gidMax: "1" gidMin: "0" resturl: <hidden> restuser: xxx restuserkey: xxx provisioner: kubernetes.io/glusterfs
do we have the ability to differentiate 0 vs unset? should we?
Kube PR # https://github.com/kubernetes/kubernetes/pull/38358
(In reply to Eric Paris from comment #2) > do we have the ability to differentiate 0 vs unset? should we? exactly the PR i had been working on... hang on a sec
This is the alternative approach I had in the queue. Unfortunately I was not able to post it earlier: https://github.com/kubernetes/kubernetes/pull/38378 The approach is: Instead of silently adapting the explicit configuration from the SC, fail with error if an out-of-range value is provided.
This is fixed and available in current builds. I am changing the status to ON_QA.
Verified