I was looking for a solution but I couldn't find any.
I have a bash script which executes something like this:
kubectl get services -o=json | \
jq '.items[].metadata.annotations | '\
'select (."my-ingress/enabled" == "true") | '\
'{"my-ingress/path", "my-ingress/service-name", "my-ingress/service-port"}'
Which means it can take list of the services, filter and take only with annotations my-ingress/enabled == true
Based on that result it creates dynamically YAML for Ingress and loads it.
Everywhere I was looking, Helm is using templates and other fancy approaches but nowhere I could find any information how to ask K8S about some resources and based on that info build YAML.
Is this possible at all?
Note: calling Bash to prepare some kind values.yaml is not an option in my case.