I got a task, to create a helm-chart and use a kubernetes database operator that creates automatically credentials for the database.
I don't really understand how is this possible.
I found this operator in Operator hub: https://operatorhub.io/operator/postgresql-operator-dev4devs-com
This is an operator for postgreSQL. It is mentioned that :
If someone has experience with kubernetes operators, could I get a hint, which one should I use? (easiest, it doesn't have to be Postgres)
i am not much fan of operators not writing unless required or keeping it as the last option.
To understand it easily consider it like there are different types of operator
Which use the framework to Operator framework
You have to create one Helm-based Operator which keep watch on a secret if removed or does not exist it will create the new one for the Database.
Steps :
operator-sdk new db-operator --api-version=harsh.com/v1alpha1 --kind=DbSecret --type=helm --helm-chart=db-secret --helm-chart-repo=<repo url>
you might have to create the necessary service account, role, and role binding.
Ref document to create the helm operator : https://sdk.operatorframework.io/docs/building-operators/helm/tutorial/