RocketChat / helm-charts

Repository for RocketChat helm charts
37 stars 68 forks source link

Support extra pv mounts #40

Closed snowball77 closed 2 years ago

snowball77 commented 2 years ago

Many helm charts support these days extra volume mounts in order to mount things like custom certificates, TZ files, etc. It would be great to copy such a solution from another chart to this chart for the RC deployment manifest.

prppedro commented 2 years ago

Probably same issue as #8.

We'll have a look into that. Depends a bit on how are the Docker images packed.

prppedro commented 2 years ago

@snowball77, can you give us an example?

snowball77 commented 2 years ago

Sure. At the moment I am using a post-renderer kustomizer to achieve what I want. This should provide an example:

  postRenderers:
    # Instruct helm-controller to use built-in "kustomize" post renderer.
    - kustomize:
        # Array of inline strategic merge patch definitions as YAML object.
        # Note, this is a YAML object and not a string, to avoid syntax
        # indention errors.
        patchesStrategicMerge:
          - kind: Deployment
            apiVersion: apps/v1
            metadata:
              name: rocketchat-rocketchat
            spec:
              template:
                spec:
                  containers:
                    - name: rocketchat
                      env:
                        - name: NODE_EXTRA_CA_CERTS
                          value: '/etc/ssl/certs/cloud-init-ca-certs.pem'
                      volumeMounts:
                      - mountPath: /etc/ssl/certs
                        name: etc-certs   
                        readOnly: true     
                      - mountPath: /usr/share/ca-certificates
                        name: usr-certs   
                        readOnly: true 
                  volumes:
                    - name: etc-certs
                      hostPath:
                        path: /etc/ssl/certs
                        type: Directory
                    - name: usr-certs
                      hostPath:
                        path: /usr/share/ca-certificates
                        type: Directory
snowball77 commented 2 years ago

An example of a Helm chart that supports this feature is the Bitnami MediaWiki chart (https://github.com/bitnami/charts/tree/master/bitnami/mediawiki/). Here I use values like these:

    extraVolumes:
    - name: etc-certs
      hostPath:
        path: /etc/ssl/certs
        type: Directory
    - name: usr-certs
      hostPath:
        path: /usr/share/ca-certificates
        type: Directory
    extraVolumeMounts:
    - mountPath: /etc/ssl/certs
      name: etc-certs   
      readOnly: true     
    - mountPath: /usr/share/ca-certificates
      name: usr-certs   
      readOnly: true 
prppedro commented 2 years ago

Alright, @snowball77, thanks for pinging us back. I ran into some issues while trying to add support for extra volumes on our current templates. But I'll try and adapt the Mediawiki solution, which is mostly interesting.

prppedro commented 2 years ago

@snowball77, I've just rolled out some changes to a development branch -- extravolume-devel.

I'll test it a little bit before merging into master. If you can clone that branch and test it as well to see if it suits your use case, it would be cool.

Thanks!