Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Find a better convention referencing env vars in container spec #16

Closed
concaf opened this issue Jun 14, 2017 · 12 comments
Closed

Find a better convention referencing env vars in container spec #16

concaf opened this issue Jun 14, 2017 · 12 comments

Comments

@concaf
Copy link
Collaborator

concaf commented Jun 14, 2017

The current way of referencing other sources for environment variables is like the following -

name: web
replicas: 1
containers:
- image: wordpress:4
  env:
  - name: WORDPRESS_DB_PASSWORD
    valueFrom:
      secretKeyRef:
        name: wordpress
        key: DB_PASSWD
  - name: WORDPRESS_DB_NAME
    valueFrom:
      configMapKeyRef:
        key: MYSQL_DATABASE
        name: database

We can establish a convention and replace this with -

name: web
replicas: 1
containers:
- image: wordpress:4
  env:
  - name: WORDPRESS_DB_PASSWORD
    secretRef: wordpress/DB_PASSWD
  - name: WORDPRESS_DB_NAME
    configMapRef: MYSQL_DATABASE/database

To include all data from a given secret/configMap -

name: web
replicas: 1containers:
- image: wordpress:4
  env:
  - name: WORDPRESS_DB_PASSWORD
    secretRef: wordpress/DB_PASSWD
  - name: WORDPRESS_DB_NAME
    configMapRef: MYSQL_DATABASE/database
  - secretRef: secret-certs
@pradeepto
Copy link
Member

Do we want to induce string magic?

@concaf
Copy link
Collaborator Author

concaf commented Jun 14, 2017

Do we want to induce string magic?

We didn't disagree to this.

@pradeepto
Copy link
Member

I am sure we have always said that string magic is bad many times in the past. And if this syntax is Docker Compose influenced, then we should stay away from it, if possible.

@kadel
Copy link
Member

kadel commented Jun 14, 2017

It is not influenced by docker compose.

The question is to find a balance between string magic and adding more levels to yaml file.

@concaf
Copy link
Collaborator Author

concaf commented Jun 14, 2017

@pradeepto -

I am sure we have always said that string magic is bad many times in the past.

Not sure about this, we agreed this with secretRef in OpenCompose, and the way we define ports in OpenCompose (80:8080), is also string magic which is not vanilla Kubernetes spec.

And if this syntax is Docker Compose influenced, then we should stay away from it, if possible.

It's not

@concaf
Copy link
Collaborator Author

concaf commented Jun 19, 2017

ping @surajssd, PTAL

@surajssd
Copy link
Member

It was decided that we will add support for envFrom and come back to this later.

@surajssd
Copy link
Member

Issue tracking progress of envFrom #43

@pradeepto
Copy link
Member

@surajssd @containscafeine Can we close this since we have made a decision?

@concaf
Copy link
Collaborator Author

concaf commented Jul 11, 2017

I think we can keep this open with low or no priority, since we "might" do this sometime if feature requests for this ever drop in. Once we move applications to kedge, if this seems necessary, we might do it then.

@surajssd
Copy link
Member

surajssd commented Aug 7, 2017

I think we can close this now since this has been taken care of with the field

envFrom

WDYT? @containscafeine

@surajssd
Copy link
Member

surajssd commented Aug 9, 2017

closing it, since I think the motive of this issue is solved!

@surajssd surajssd closed this as completed Aug 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants