kubekutr icon indicating copy to clipboard operation
kubekutr copied to clipboard

Feature Request: Allow custom templates and overrides

Open nabadger opened this issue 4 years ago • 0 comments

It would be nice to make kubekutr flexible to allow users to drop-in their own templates.

We have numerous 'shared' components such as mysqld-exporters, mariadb, which applications can reference as a base and patch/overlay as required.

It would be avoid the following:

  • forking this repo to allow for custom templates (since this could happen regularly and will often be user specific)
  • having to re-compile to pick up new templates

Not too sure in terms of code how this could work - but perhaps something like the following:

Specify directory containing additional templates

kubekutr -p /tmp/my-custom-templates`

Example directory layout

/tmp/my-custom-templates
├── mariadb
│   └── templates
│       └── deployment.tmpl
└── mysqld-exporter
    └── templates
        ├── deployment.tmpl
        └── ingress.tmpl
        └── a-custom-resource.tmpl
_

Example config updates

mariadb:
  deployment:
    - name: app
      replicas: 1
mysqld-exporter:
  deployment:
  - name: app
    replicas: 1
  a-custom-resource:
  - name: app

The key here could be used as part of the path-lookup into the right directory.

nabadger avatar Jan 02 '20 13:01 nabadger