kubegres icon indicating copy to clipboard operation
kubegres copied to clipboard

Create helm chart

Open anthr76 opened this issue 4 years ago • 9 comments

It would be great to have a helm chart! At the very least breakout the CRDs or create kustomize. This helps greatly in a GitOps model.

anthr76 avatar May 03 '21 18:05 anthr76

Hello,

Thank you so much for your feedback.

Kubeges was developed with the operator SDK framework Kubebuilder version 3.

The following YAML was generated by Kubebuilder and allows to install Kubegres: https://github.com/reactive-tech/kubegres/blob/main/kubegres.yaml

In that YAML most of the CRDs are about creating permissions and there is one deployment resource for deploying a container image of Kubegres.

It is currently possible to store that YAML in GIT for GitOps purpose. It is what we do in most companies where Kubegres is deployed.

I would be grateful if you could you provide more details about how an HELM chart or Kustomize would improve the process compared to now?

Thank you.

alex-arica avatar May 04 '21 17:05 alex-arica

Hi Alex,

Thanks. for reaching back out. Firstly the built manifests work well for the time being but having a helm chart to template values would greatly be appreciated. For example hard coding on app per namespace is not really desirable. With a helm chart for example I can have renovate bot monitor new app releases while also relying on helm templating engine to change kubegres operator to my desired namespace.

anthr76 avatar May 04 '21 17:05 anthr76

Secondly, I found a little quirk with the current CRDs. PGDATA seems hardcoded in the operator and on openebs since it's zfs backed the volumes it creates contain a lost+found (https://github.com/docker-library/postgres/pull/72) this causes you to tip toe around the existing env variable in place. Let me know if you'd like another issue open for this.

anthr76 avatar May 04 '21 17:05 anthr76

Thank you for your prompt reply. Much appreciated.

What you are saying is, an Helm chart would allow you to set the namespace of your choice. And moreover, it would allow to template additional values. Is my understanding correct?

Just as a note, the namespace was set as "kubegres-system" by Kubebuilder.

In regards to PGDATA, it is configurable in the Kubegres resource yaml when creating a PostgreSql cluster. Please see the "spec.database.volumeMount" in this page: https://www.kubegres.io/doc/properties-explained.html

If a value for "spec.database.volumeMount" is not explicitly set in the Kubegres resource YAML, the operator uses the default value of PGDATA. The ticket that you reported seems to be closed in 2015 (docker-library/postgres#72). Is this still an issue with the Postgres containers created after 2015?

alex-arica avatar May 04 '21 17:05 alex-arica

Is this still an issue with the Postgres containers created after 2015?

It indeed is specifically with openebs :)

Thanks I'll try and create a fresh database and see if it reconciles alright. As for the chart your assumptions are correct. The renovate bot in a gitops workflow works great with charts and helps stay up to date!

anthr76 avatar May 04 '21 17:05 anthr76

Thank you. I set this ticket as enhancement. I will check the renovate bot in gitops workflow, as you recommended.

alex-arica avatar May 04 '21 17:05 alex-arica

For what it's worth you can see how I have to deploy kubegres vs a redis operator provided by a helm chart here

https://github.com/anthr76/infra/blob/main/gitops/core/base/deployments/kubegres/default/deploy.yaml

vs

https://github.com/anthr76/infra/blob/main/gitops/namespaces/base/database/redis-operator/redis-operator.yaml

The renovate comment in the helmrelease causes a PR to be opened on my repo. Along with of course taking upstream manifests and selecting namespace.

Thank you for the project! It's been great so far.

anthr76 avatar May 04 '21 17:05 anthr76

Thank you for your kind feedback about the project.

I like the simplicity of the Redis operator with the Helm chart. It is actually great.

Thanks to you, I see the benefit of having the option to install Kubegres with Helm chart. It is in the active backlog.

alex-arica avatar May 04 '21 18:05 alex-arica

I'll add interest in a Helm chart and also having it posted to artifacthub.io to help folks find it.

jcpunk avatar Oct 20 '22 20:10 jcpunk