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

Add support for adding volumeClaimTemplates to the StatefulSet #817

Open
gallolp opened this issue Feb 7, 2025 · 0 comments · May be fixed by #818
Open

Add support for adding volumeClaimTemplates to the StatefulSet #817

gallolp opened this issue Feb 7, 2025 · 0 comments · May be fixed by #818

Comments

@gallolp
Copy link

gallolp commented Feb 7, 2025

Hi, I was wondering if you would be willing to consider the following feature proposal.

The chart currently supports adding extra volumes and volumeMounts to the Keycloak pods and it works great.
However, some users may be interested in using PersistentVolumes with a storageClass of their preference.
For example, a use case would be to deploy Keycloak to Amazon EKS using volumes with a storageClass that uses the EFS CSI driver.

The StatefulSet spec provides volumeClaimTemplates to achieve this.

The idea is to add a volumeClaimTemplates value much in the same way as extraVolumes. Then they can be used in extraVolumeMounts by name just like volumes.

An example illustrating both:

# Add additional volumes, e. g. for custom themes
extraVolumes: |
  - name: {{ include "keycloak.fullname" . }}-static-vol
    emptyDir:
      sizeLimit: 512Mi

# Add volume claim templates to the StatefulSet, e. g. for dynamic provisioning
volumeClaimTemplates: |
  - metadata:
      name: {{ include "keycloak.fullname" . }}-themes
    spec:
      accessModes: [ "ReadWriteOncePod" ]
      storageClassName: "efs-sc"
      resources:
        requests:
          storage: 2Gi

# Add additional volumes mounts, e. g. for custom themes
extraVolumeMounts: |
  - name: {{ include "keycloak.fullname" . }}-static-vol
    mountPath: /opt/keycloak/static
  - name: {{ include "keycloak.fullname" . }}-themes
    mountPath: /opt/keycloak/themes

I will submit a PR with the chart additions I am currently using for my case.

Thanks for such a great chart!

@gallolp gallolp linked a pull request Feb 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant