storageClassName and permissions

What should be the storageClassName in my volumeClaimTemplates?

Looks like it cannot be empty. I tried RBD that failed to provision the PVC because its an unknown type in replicated. I tried “default” now but pods aren’t coming up.

As per replicated doc, it suggested we don’t have to make any changes in our yaml and replicated would set its custom storageClass automatically. But I see its not changed after deployment as “kubectl describe pvc” shows its of type default only.

My pods aren’t coming up because of permission issues as shown below. Our containers run as user 1010 so can you please suggest the appropriate configuration for PVCs in replicated?

Caused by: java.nio.file.AccessDeniedException: /var/data/elasticsearch/nodes

Ok. I found the solution.

I had to add the securityContext under the template.spec of my statefulset definition. And fsGroup was the key addition that needs to match the userID. This sets the permissions on the associated volume without which user 1010 will not have access to the PVs as seen earlier.

  securityContext:

    runAsUser: 1010

    fsGroup: 1010
1 Like