quantum-fusion / springboot_swagger_example-master-cassandra

0 stars 0 forks source link

Kubernetes secrets need to be read from JAVA client #32

Open quantum-fusion opened 6 years ago

quantum-fusion commented 6 years ago

I could store a kubernetes secret, with a key, value pattern, however it needs a java client to read the secret into JAVA. https://stackoverflow.com/questions/50611117/how-to-get-kubernetes-secret-data-from-java

See reference issue with use of redhat fabric8: https://github.com/redhat-developer-demos/spring-boot-configmaps-demo/issues/2#issuecomment-402621769

Let’s save the API key as a Secret:

kubectl create secret generic apikey --from-literal=API_KEY=123–456

And the language as a ConfigMap: kubectl create configmap language --from-literal=LANGUAGE=English

You can check that these are created with the following commands: kubectl get secret

And kubectl get configmap