in

Is it possible to load K8S list of services into Helm template variable?


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.



Source: https://stackoverflow.com/questions/70634633/is-it-possible-to-load-k8s-list-of-services-into-helm-template-variable

Quand les relais mixtes font le bonheur des Bleus thumbnail

Quand les relais mixtes font le bonheur des Bleus

Medical Pager Chat App powered by GetStream