Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Multiple config-map support for fiaas #112

Open
skogie opened this issue Aug 28, 2020 · 2 comments
Open

Proposal: Multiple config-map support for fiaas #112

skogie opened this issue Aug 28, 2020 · 2 comments

Comments

@skogie
Copy link

skogie commented Aug 28, 2020

We are using config-maps in fiaas today but it can be tedious at times updating and keeping track of all our config-maps when making changes. For example for our database config we use a different port in dev and production, and it also requires som difference in the ssl part of the connection-string. I'm wondering if this could have been solved using only a single config-map named i.e database-config and applied this config-map to all our apps via fiaas.yml, something like this:

---
version: 3
admin_access: true
replicas:
  maximum: 1
  minimum: 1
resources:
  requests:
    memory: 128Mi
ports:
  - target_port: 5000
healthchecks:
  liveness:
    http:
      path: /healthz
metrics:
  prometheus:
    path: /internal-backstage/prometheus
config_maps:
    - team-db-config
    - team-kafka-config

The default can stay the same that a config-map with the same name as an application would be applied by default. And a default for the config-maps in fiaas.yml could be something like:
config_maps: []

As far as I'm aware multiple config-maps can be applied to a pod like this:

spec:
  containers:
    - name: example-pod
      envFrom:
      - configMapRef:
          name: config-1
      - configMapRef:
          name: config-2

Let me know what you think, I would love this feature 👍

skogie pushed a commit to skogie/fiaas-deploy-daemon that referenced this issue Aug 28, 2020
@skogie
Copy link
Author

skogie commented Aug 28, 2020

Opened PR #113 as a WIP

@mortenlj
Copy link
Member

The configmap we currently make available is made available in two ways: As environment variables, and mounted on disk at /var/run/config/fiaas/.
If we are adding this feature, I feel it natural that any additional configmaps are also made available in both ways.

There are a couple open questions that probably need to be discussed, and also documented properly:

  1. Configmaps may have the same keys, and when exposing as environment variables, ordering matters. Where should the "default" configmap be in the order? First or last? Which value is kept when multiple configmaps has the same key?
  2. Where should the configmaps be mounted on disk? They probably should be under /var/run/config/. Should it just use the name of the configmap (would that always work?), or does the config need to be a mapping of configmap to path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants