kapp-controller icon indicating copy to clipboard operation
kapp-controller copied to clipboard

Support ytt's ---data-value-file equivalent functionality

Open making opened this issue 3 years ago • 2 comments

Describe the problem/challenge you have

It may be expected to set the contents of the config file as a variable in a ytt template file that is applied via App resource.

For example

#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")

#@overlay/match by=overlay.subset({"kind": "ConfigMap", "metadata": {"name": "demo-config"}})
---
data:
  config.yml: #@ data.values.demo.config_yml

I'd like to keep the configuration file separated because it sometime has a large contents and don't want to include it with other data values.

With local ytt + kapp, it is possible to use ---data-value-file as follows

kapp -a demo -f <(ytt -f manifest.yml -f overlay.yml ---data-value-file demo.config_yml=config.yml)

but not with kapp-controller

Describe the solution you'd like

Support ytt's ---data-value-file equivalent functionality in App spec

Anything else you would like to add:

I met this limitation when I configure Prometheus provided by TKG extension https://docs.vmware.com/en/VMware-Tanzu-Kubernetes-Grid/1.2/vmware-tanzu-kubernetes-grid-12/GUID-extensions-prometheus.html#customize-your-prometheus-deployment-3 for example monitoring.prometheus_server.config.alerting_rules_yaml

making avatar Feb 25 '21 13:02 making

Thanks for opening this @making. I think the use case here makes sense.

Not sure at this point when this will be prioritized, but I think we would be open to any submissions on this.

danielhelfand avatar Mar 25 '21 19:03 danielhelfand

Would it be enough to use data.read() to load the value file? https://carvel.dev/ytt/#gist:https://gist.github.com/benmoss/1eca4105a86871e69eb52564220b72a1

benmoss avatar Mar 29 '22 14:03 benmoss

AppCR has the ability now:

  template:
     - ytt:
        ...
        # provide values via ytt's --data-values-file (optional; v0.19.0-alpha.9)
        valuesFrom:

neil-hickey avatar Feb 22 '23 20:02 neil-hickey