kapicorp / kapitan

Generic templated configuration management for Kubernetes, Terraform and other things
https://kapitan.dev
Apache License 2.0
1.8k stars 197 forks source link

Implement some sort of self reference to inventory #706

Open bsda opened 3 years ago

bsda commented 3 years ago

Describe the bug/feature It would save us a lot of duplication if we could have some sort of ${self} reference to the inventory

To Reproduce For example: I need to add this configmap to multiple components:

config_maps:
  monitoring-registry:
    mount: /opt/spinnaker-monitoring/registry
    data:
      igor.yml:
        value: "metrics_url: http://localhost:8088/spectator/metrics"

The port is the only thing that changes per component

Having the capacity of using something like this would be helpful:

value:  "metrics_url: http://localhost:${self:ports:http:service_port}/spectator/metrics"

The value in this case would reference to

parameters:
  components:
    spin-igor:
       ...
      ports:
        http:
          service_port: 8088

Additional context I'm guessing this is one for the reclass package but I couldn't create issues there

MatteoVoges commented 1 year ago

Im currently working on a feature in reclass, that supports relative paths. I think this is exactly what you want to do. It should be merged with the next minor release ...

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 1 year with no activity. Remove the stale label or comment if this issue is still relevant for you. If not, please close it yourself.