Helm / k8s modified static files using the same container image

11/2/2019

I use helm to deploy a micro-service stack. The frontend that is being deployed can be modified using some configuration files and static resources (for example some logo and so on).

I would like to create several helm-charts where I use the same frontend chart as dependency (in requirements.yaml) but just feed it some slightly different static files. The frontend is built so that it uses default configs/resources if none are placed in its "/usr/share/nginx/htlm/static" folder.

I've done this earlier using docker compose, where it would just be something like:

  version: "3.3"

  configs:
    app-config:
      file: ./static/ui/app-config.js
    bg:
      file: ./static/ui/bg.jpg

  services:
    ui:
      ...
      configs:
        - source: app-config
          target: ./usr/share/nginx/html/static/app-config.js
        - source: bg
          target: ./usr/share/nginx/html/static/bg.jpg
      ...

We are now moving to k8s / helm and I'd like to know how can I achieve something similar.

I only need to supply the configuration files when deploying, there's no need for altering them between deployment times.

Appreciate any input / suggestions on how to do this. :)

-- dargolith
kubernetes
kubernetes-helm

0 Answers