microsoft / fabrikate

Making GitOps with Kubernetes easier one component at a time
MIT License
38 stars 5 forks source link

Ability to include / exclude subcomponents based on config #277

Closed timfpark closed 4 years ago

timfpark commented 5 years ago

As an operator I would like to dynamically be able to include or exclude components based on configuration. For example, if I had a very large number of distributed locations and wanted to enable app A in 20% of them and app B in 80% of them.

Right now, Fabrikate does not have a mechanism to accomplish this with configuration. This issue tracks the ability to enable or disable components or subcomponents based on config.

maarek commented 5 years ago

@timfpark Are you thinking something along the lines of...

Adding included to the schema definition for config with a default value of true for backwards compatibility.

commom.yaml

config:
included: "true"
subcomponents:
  jaeger:
    namespace: "jaeger"
    injectNamespace: true
    config:
      collector:
        annotations:
          sidecar.istio.io/inject: "false"

fab generate would generate the component + sub-component.

azure.yaml

config:
subcomponents:
  jaeger:
    included: "false"

fab generate azure would generate the base component but not the jaeger sub-component.

joushx commented 4 years ago

I would really appreciate this feature in my daily workflow. Any plans to realize it in the near future?

marcel-dias commented 4 years ago

Hey, that will be great feature. Can I help in some way ?

maarek commented 4 years ago

@timfpark Just want to make sure this doesn't go stale. Any thoughts on my question above?

joushx commented 4 years ago

Creating an included property would require to add it to any existing configuration, thus breaking them when updating. Also this means a lot of overhead as most components would be included in reality. In my opinion exluded with a default value of false is the better option.

evanlouie commented 4 years ago

Hi all! thanks for taking an interest in Fabrikate.

I agree with @joushx that for backwards compatibility, either exclude or disable should be the config option to get this rolling -- plus it fits in cleaner with Go's zero value for booleans being false (components should continue to be "include"/"enable" by default -- with explicit config to disable it)

I'll try to fit in some time for this next week. But PR's are always welcome :)

hfgbarrigas commented 4 years ago

created this PR that might deliver this.

marcel-dias commented 4 years ago

Hello @evanlouie @jred55 @timfpark,

I opened the PR #286 few days ago. Looking forward to have your feedback and have this feature released.

Please let me know if I should modify the approach or what can I improve to get the PR merged.