question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StorageClassName not working

See original GitHub issue

Chart version: elastic/elasticsearch: 7.7.1

Kubernetes version: 13.2

Kubernetes provider: None

Helm Version: v3.2.1

I am working with elasticsearch on kubernetes. I followed the README instructions to install elasticsearch.

Describe the bug:

Even when I change the storageClassName in volumeClaimTemplate. Every time new pod always shows: Volumes ClaimName: elasticsearch-master-elasticsearch-master-0, and pod has unbound immediate PersistentVolumeClaims (repeated 4 times).

Steps to reproduce:

  1. helm install release-name ./helm-charts/elasticsearch --set imageTag=7.7.1

Expected behavior: Three pods are pending. When you type kubectl describe pod elasticsearch-master-0, it will show pod has unbound immediate PersistentVolumeClaims (repeated 4 times).

Provide logs and/or server output (if relevant):

Volumes:
  elasticsearch-master:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  elasticsearch-master-elasticsearch-master-0
    ReadOnly:   false
  default-token-lhrgq:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-lhrgq
    Optional:    false
QoS Class:       Guaranteed
Node-Selectors:  <none>
Tolerations:     <none>
Events:
  Type     Reason            Age                    From               Message
  ----     ------            ----                   ----               -------
  Warning  FailedScheduling  7m40s (x2 over 7m40s)  default-scheduler  pod has unbound immediate PersistentVolumeClaims (repeated 4 times)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
Wykikicommented, Aug 26, 2020

Hello, I encountered a similar problem, and it looks like the statefulSet does not declare / use :

  • persistence.storageClass
  • persistence.size

It should be put somewhere in the statefulset volumeClaimTemplate : https://github.com/elastic/helm-charts/blob/7.9/elasticsearch/templates/statefulset.yaml#L26

One (of the many) way of doing it : https://github.com/goharbor/harbor-helm/blob/master/templates/database/database-ss.yaml#L105

Manually provisioning a volume works, but having the possibility to also manually configure the volume name with a property like persistence.volumeName would be nice !

Thanks !

3reactions
jmlrtcommented, Nov 12, 2020

Can I just add the storageClassName to the values file as follows: volumeClaimTemplate: accessModes: [ “ReadWriteOnce” ] storageClassName: “local-path” resources: requests: storage: 30Gi

Hi, @beckyjmcdabq,

Yes you can add storageClassName directly in volumeClaimTemplate value like in this example: https://github.com/elastic/helm-charts/blob/58bdd96312a08cf3e933ffa9afb3c7988c27dd80/elasticsearch/examples/kubernetes-kind/values.yaml#L18-L23

why there wasn’t a placeholder in the volumeClaimTemplate for storageClassName.

Well I don’t know why we forgot to add a commented value for it in the default value file https://github.com/elastic/helm-charts/blob/58bdd96312a08cf3e933ffa9afb3c7988c27dd80/elasticsearch/values.yaml#L93-L97

That’s something that could be fixed with a single line PR (adding #storageClassName: "standard" to the default values file).

Would you be interested to create this PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

kubernetes helm changes storageClassName if provided ...
Helm chart is perfectly working when i apply it for the first time as i have mentioned. It only doesn't work when i...
Read more >
1907950 – "storageClassName: manual" does not exist
Specifying storageclassname "manual" in both PVC and PV, and there is no need to have storageclass "manual" present. If there is no storageclassname...
Read more >
Persistent Volumes
Managing storage is a distinct problem from managing compute instances. The PersistentVolume subsystem provides an API for users and ...
Read more >
Using Storage Classes for Dynamic Provisioning
Now create another claim identical to the generic-pvc.yaml PVC definition but change the name and do not set a storage class name. Example...
Read more >
Troubleshooting Cluster Operator
RabbitMQ Cluster Fails to Deploy · Run kubectl describe pod POD-NAME to see if there are any warnings (eg. · Correct the imagePullSecrets...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found