What is the best way to manage cr.yaml?

Hi !

First of all, I would like to thank Percona for the fantastic Kubernetes Operator for PSMDB !

What is the best way to manage cr.yaml ?
I’d like to use some tool or method (Kustomize ?) that allows to:

  • have one base config for all my clusters
  • include extra for some clusters (monitoring, backups)
  • have different number of shards

If this can be done with Kustomize then is there any examples how to do it ?

1 Like

We use kustomize and sops and split the mongodb cluster>s< in namespaces. So you have an operator and a cluster per namespace. For ex. dev-psmdb01, dev-psmdb02 etc and they all get accessed from dev.

base layer
cr.yaml and all the other yamls
stuff (patches to overwrite cpu, memory, disk size) you want to inject for each namespace
encryption key !!!

Unfort. the new 1.13 crd is a show stopper unless you update your installation at the same speed as percona releases (which is a no go)

1 Like


We also have cluster and operator per namespace and that’s fine for us, but having 10+ clusters with 10+ shards leads to crazy amount of .yaml and duplication.

I’m sorry, I’m new to Kustomize. As far as I understand then Kustomize needs a crd OpenAPI schema in .json format. Should I extract the right version of openAPIV3Schema from crd.yaml and convert it into json ? Or is there a json version of crd available somewhere to download ?

And please could you provide some examples of kustomization.yaml file ?

1 Like

I’m new to Kustomize

This forum is not to educate someone in kustomize …

1 Like

Thank you very much! Now I know :wink:

1 Like

for ex. → Kustomize Tutorial With Instructions & Examples | Densify

If you understand it, then it’s straight forward how to organize the Percona yaml’s

=> important to understand is, how >patching< works (means how you adjust the values of the “leaves” of the yaml)

Hey folks.

my 2 cents - use whatever you are comfortable with.
I saw the following that worked pretty well.

  1. Custom helm charts (now they are adding OLM to simplify the management)
  2. Various Infra-as-a-code tools. The most seen - Terraform + Ansible/Chef.
  3. Gitops through yaml
  4. Kustomize

Obviously there is no best way of doing things :slight_smile:

1 Like

Thank you !

A few days ago I decided to go Ansible way. I think it is good enough for starting.

1 Like

We use ytt to wrangle yaml.

1 Like