kcl-lang / krm-kcl

Kubernetes Resource Model KCL Specification and Integrations including Kubectl, Kustomize, Helm, Helmfile, Crossplane, KPT, etc.
Apache License 2.0
20 stars 13 forks source link

[Enhancement] Consider adding resource matching rules to the KRM-KCL Spec #13

Closed Peefy closed 6 months ago

Peefy commented 1 year ago

Background

In the current version of the KRM KCL specification, users need to repeatedly write and filter certain types of resource codes such as service and deployments, and consider adding resource filtering declarations to further reduce the required code volume, such as the following form.

resourceRules:
 - apiGroups:   ["apps"]
   apiVersions: ["v1"]
   resources:   ["deployments"]

Reference

satyazzz123 commented 10 months ago

Hello @peefy can I work on this issue?

satyazzz123 commented 10 months ago

Hello @Peefy I had a question

In the current version of the KRM KCL specification, users need to repeatedly write and filter certain types of resource codes such as service and deployments

How do we currently write deployments and services inside KCL , can I see some examples of where there is a typical usage of resource code for deployments and services

Peefy commented 10 months ago

Hello @Peefy I had a question

In the current version of the KRM KCL specification, users need to repeatedly write and filter certain types of resource codes such as service and deployments

How do we currently write deployments and services inside KCL , can I see some examples of where there is a typical usage of resource code for deployments and services

Here's documents https://kcl-lang.io/docs/user_docs/guides/working-with-k8s/overview

In fact, what this issue wants to do is to filter these fields through configuration when there is a series of resource inputs on the resource transformer. https://github.com/kcl-lang/krm-kcl/blob/main/pkg/edit/transformer.go#L38

Expanding it based on existing transformer interfaces is a better way.

shruti2522 commented 6 months ago

Would be happy to take this one, @Peefy

Peefy commented 6 months ago

Thank you! @shruti2522