Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StarRocksCluster Configuration Error: Unable to Mount emptyDir Volume at /tmp Path Without Specifying storageSize. #320

Closed
kapilsingh421 opened this issue Nov 23, 2023 · 10 comments · Fixed by #324
Labels
bug Something isn't working

Comments

@kapilsingh421
Copy link
Contributor

Describe the bug

When attempting to mount an emptyDir volume with a mount path of /tmp in a StarRocksCluster environment, the system does not seem to recognize or support this configuration. Instead, it appears to only support Persistent Volumes (PV). The configuration used is as follows:

- name: {{ .Values.starrocksFESpec.storageSpec.name }}-tmp
  mountPath: /tmp

After encountering issues with this setup, I deleted the Custom Resource (CR) and reapplied it, which led to the following error message:

StarRocksCluster.starrocks.com "kube-starrocks" is invalid: spec.starRocksFeSpec.storageVolumes[2].storageSize: Required value

This error suggests that a storageSize must be provided, indicating a reliance on Persistent Volumes. However, the requirement is to use emptyDir for the /tmp path.

To Reproduce

  1. Define a volume mount in the StarRocksCluster configuration to use an emptyDir with a mount path of /tmp.
  2. Apply the configuration to the cluster.
  3. Observe that the system either does not recognize the configuration or throws an error requiring a storageSize to be specified, which is indicative of Persistent Volume usage, not emptyDir.**

Expected behavior

The expected behavior is for the StarRocksCluster to successfully mount an emptyDir volume at the /tmp path without requiring the specification of a storageSize. This would allow for temporary file storage that is not persistent across pod restarts.

Version

  • Operator Version: [ latest]
  • Chart Name: [kube-starrocks]
@kapilsingh421 kapilsingh421 added the bug Something isn't working label Nov 23, 2023
@kevincai
Copy link
Collaborator

thanks! will take a look how to support this ability.

@yandongxiao
Copy link
Collaborator

storageVolumes:
    - name: fedata-main
      storageSize: 15Gi
      mountPath: /opt/starrocks/fe
    - name: fedata-meta
      storageSize: 15Gi
      mountPath: /opt/starrocks/fe/meta
    - name: tmp-data
      mountPath: /tmp

Due to the limitation of StorageSize, it is indeed not supported to configure in this way (for tmp-data). Moreover, from the above semantics, it should create a PVC using the Default storage class, not an EmptyDir.

The implementation logic of the Operator is: for each configured item, a corresponding persistent volume will be created. If not configured, meta, log, an emptyDir will be configured under statefulset.spec.template.volumes.

@yandongxiao
Copy link
Collaborator

In Kubernetes, PersistentVolumeClaim (PVC) and emptyDir are two different types of volumes, and they cannot be used interchangeably. PVC is used to request storage resources and mount them into a Pod, while emptyDir is a temporary directory created after a Pod is assigned to a node.

@yandongxiao
Copy link
Collaborator

Based on the scenario you described, I think emptyDir is still the best choice. We can consider supporting emptyDir and hostPath.

@kapilsingh421
Copy link
Contributor Author

Hello @yandongxiao

I've encountered an issue where our /tmp directory is currently not writable. I'm considering the use of a Persistent Volume (PV) for the frontend /tmp directory to resolve this.

Could you please advise if utilizing a PV for this purpose is a suitable solution? Additionally, if this approach is recommended, what would be the ideal storage size for the PV in this context?

or

Alternatively, is there an option to define a custom location for the temporary directory, such as /opt/starrocks/fe/tmp?"

@kapilsingh421
Copy link
Contributor Author

ok that's great but do you have an ETA for supporting emptyDir ?

@yandongxiao
Copy link
Collaborator

Maybe Pull Request (PR) can be able to be merged this week. You may need to build the container image from the main branch yourself, but it's very simple.

@kapilsingh421
Copy link
Contributor Author

yeah that's great no Problem I will build this image

@yandongxiao
Copy link
Collaborator

#324
You can try to use this PR

@kapilsingh421
Copy link
Contributor Author

Thanks working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants