helmwave/helmwave

tags vs. depends_on

antonvigo opened this issue · 1 comments

We've faced with the problem of preventing optional dependencies to be deployed. So we have several products described in helmwave.yml and some of them are dependent from some infrastructure services like redis, postgresql etc. And in some cases these dependencies are acutal for all environments. But sometimes prod deployment is quite "independent". There is no any common pattern. That's why it's very important to have flexible built-in mechanism for such situations. From my point of view it would be great to prevent installation of optional dependencies with tag feature. Actually I've expected that because it seems to be quite obvious. But as it was mentioned in the TG-channel, unfortunately tags don't have influence on the installation of servant services specified in depends_on block. Even if they are optional. For example applying this piece of code with helmwave build -t app_only will install both mentioned services:

  - name: app
    chart:
      name: oci://host/path/to/app
    depends_on:
      - name: redis
        optional: true
    tags:
      - app_only
    values:
      - ...

  - name: redis
    chart:
      name: bitnami/redis
    tags:
      - redis
      - infrastructure
    values:
      - ...

So it would be awesome for tags to have precedence over depends_on section. But taking into account possible unexpected issue it is also convenient to have current behavior as default and some special (boolean) environment variable like HELMWAVE_TAGS_ARE_BOSS to let tags be "the Boss".

All existing workarounds make me suffer and don't let me sleep well. 😄 So I hope this feature will be added.
Thank you!

It is still beneficial to use Helmwave tags along with dependencies to have the possibility to deploy a set of desired components with all dependent charts, especially in greenfield deployments.
But during component updates, it could be great to have the possibility of skipping optional dependencies for deployment speed's sake.
I propose to use the CLI flag and environment variable for this:
--skip-dependencies
env HELMWAVE_SKIP_DEPENDENCIES