vshn / appcat-service-postgresql

AppCat Service Provider for PostgreSQL
https://vshn.github.io/appcat-service-postgresql/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Consider installing Helm charts without Crossplane #62

Open ccremer opened 2 years ago

ccremer commented 2 years ago

Summary

As a developer\ I want to install charts without Crossplane's provider-helm\ So that I can reduce complexity and external dependency

Context

In #27 we introduced deployments with Helm by outsourcing the Helm installation process to an external operator, provider-helm. The way this operator works is that it wants a cluster-scoped resource Release that describes the Helm release and their values. In addition, it requires a cluster-scoped resource called ProviderConfig, in which the target cluster is specified ("same cluster").

We should investigate and ask ourselves:

When looking at the code of the most essential business logic, we see that a lot of code is lifecycle management required by Crossplane: https://github.com/crossplane-contrib/provider-helm/blob/176aa6812860e95712ea7aecd541a564bc839b14/pkg/controller/release/release.go

There is also additional logic for pulling charts: https://github.com/crossplane-contrib/provider-helm/blob/176aa6812860e95712ea7aecd541a564bc839b14/pkg/clients/helm/client.go

When looking at the code required to deploy Helm releases, one might think it's quite a bit to integrate provider-helm's code base into this project using Helm's Go library. However, I believe that integrating the Helm binary and executing it might reduce a lot of boilerplate code (e.g. the chart pulling code). We might loose a few things that provider-helm can do, but it's likely that we don't need the advanced features.

Advantages:

Disadvantages:

Out of Scope

Further links

Acceptance Criteria

No response

Implementation Ideas

I could imagine something like this:

  1. Operator writes a temporary YAML file with the Helm values
  2. Operator invokes helm upgrade my-release postgres --install --repo https://charts.bitnami.com/bitnami --version '11.1.23' --wait --namespace sv-postgresql-s-... --skip-crds --values /tmp/values/<uuid> --dependency-update
  3. Delete the temporary YAML file
  4. Based on the outcome of helm upgrade, set the status conditions in the instance spec.