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

env var valueFrom.secretKeyRef not expanded in other env var or args #677

Open
cforce opened this issue Feb 19, 2019 · 7 comments
Open

env var valueFrom.secretKeyRef not expanded in other env var or args #677

cforce opened this issue Feb 19, 2019 · 7 comments

Comments

@cforce
Copy link

cforce commented Feb 19, 2019

Is there and hint how to use the created secrets of the binding towards applications running in pods.?
All for me known ways seems not work on AKS- please give advice.
Azure/AKS#836

@zhongyi-zhang
Copy link
Contributor

The AKS quick-start guidance has an example for installing WordPress by Helm chart: https://github.com/Azure/open-service-broker-azure/blob/master/docs/quickstart-aks.md
Here are more Helm chart examples: https://github.com/Azure/helm-charts.

Is it what you look for?

@cforce
Copy link
Author

cforce commented Feb 20, 2019

Not exatcly. I still cant find a way how i pass the generated secret key value into an java enviroment variable or arg param . I can't use the same value as used in the param "URI" of the secret value, but need to prefix "jdbc:" before i pass it in.
I would be able to change the URI=jdbdc:$URI value already when creating the binding or add a new param to the binding like URL=jdbdc:$URI that work also,
Currently i amusing
svcat bind ups-instance --name ups-binding to create the binding.

@zhongyi-zhang
Copy link
Contributor

- name: DATABASE_URI
          valueFrom:
            secretKeyRef:
              name: my-app-mysql-secret
              key: uri
- name: DATABASE_JDBC
          value: "jdbc:$(DATABASE_URI)"

Does something like this work? I found https://stackoverflow.com/questions/40889743/string-operation-on-env-variables-on-kubernetes, it seems string operator is doable.

@cforce
Copy link
Author

cforce commented Feb 20, 2019

No it actually does not, as i reported on Azure/AKS#836

@zhongyi-zhang
Copy link
Contributor

Oh, sorry for missing the thread. Then, AFAIK we don't have a good solution for this right now :(.
Hi @carolynvs, do you have any idea about the issue?

@fredgate
Copy link

fredgate commented Mar 9, 2020

I have the same problem. The generated secret containing credentials for provisioned Mysql database does not contain a key with the JDBC url. There is just keys host, port, username, password, database, url but not jdbcUrl as it is the case for MSSQL databases.
So I can not connect to the database from a container with a Java Spring application.

@kinihun
Copy link

kinihun commented Nov 20, 2020

This is Nov 2020 and this basic Kubernetes functionality still does not work in AKS

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

No branches or pull requests

4 participants