Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Config file compatible with Kustomize #937

Closed
erikgb opened this issue Jan 26, 2022 · 3 comments · Fixed by #945
Closed

[FEATURE] Config file compatible with Kustomize #937

erikgb opened this issue Jan 26, 2022 · 3 comments · Fixed by #945
Labels
enhancement New feature or request
Milestone

Comments

@erikgb
Copy link
Contributor

erikgb commented Jan 26, 2022

Is your feature request related to a problem or a Pull Request

No

Scope of your request

We use kustomize for kustomizing K8s resources, but also for other related declarative configuration that is K8s'ish, like kuttl TestSuite. I tried to do the same with our k3d config files without success.

There is an old Kustomize issue, that actually got worse in later versions of Kustomize, requiring all Kustomize resources to have a metadata.name property, and there seems to be no workaround at present. Trying to add metadata.name to the k3d config-file results in the following error: FATA[0000] Schema Validation failed for config file k3d-config.yml: - (root): Additional property metadata is not allowed , which makes a lot of sense.

To mend this, I would like to "please" kustomize and somehow allow metadata.name to be included in k3d config-files.

Describe the solution you'd like

What I suggest, is to move the existing name property to metadata.name in the k3d-config file format. It will definitely be a breaking change, but since the configuration is already versioned K8s'ish with apiVersion , this could work out.

So:

apiVersion: k3d.io/v1alpha4
kind: Simple
metadata:
  name: mycluster

instead of

apiVersion: k3d.io/v1alpha3
kind: Simple
name: mycluster

Describe alternatives you've considered

@erikgb erikgb added the enhancement New feature or request label Jan 26, 2022
@iwilltry42
Copy link
Member

Hi @erikgb , thanks for opening this issue!
As discussed via Slack, I introduced v1alpha4 now (see #944).
For adding this change yourself, you need to touch (at least) the following files:

Let me know if you need any help :)

@erikgb
Copy link
Contributor Author

erikgb commented Jan 29, 2022

Thanks a lot for the excellent directions @iwilltry42! 😍 Made this quite easy to do. Please have a look at the PR when you have time!

@gbonnefille
Copy link
Contributor

Hi @erikgb

I'm really curious about the way you use the config file with kustomize. Is it with the template command to dump a file, or is there any other tooling around it to automatically create a local cluster?

Thanks in advance for any advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants