I used kitura create
to scaffold a new project so it came with CloudEnvironment which I bumped to version (7.1).
I am deploying Kitura (2.3) as Docker image to IBM Kubernetes.
The question I have is: how do I get Kubernetes external ip address inside Kitura?
The part I have issue with is cloudEnv.url + "/callback"
which is localhost:8080/callback
when deployed to Kubernetes, but I need it to be the real ip:port.
I have come so far that I have figured out how to write Kubernetes config to pass some values to the Docker container, but CloudEnvironment doesn't pick them up, and I can't find any relevant documentation for CloudEnvironment.
https://github.com/IBM-Swift/CloudEnvironment
You specify lookup keys and search patterns in a file named mappings.json. This file must exist in a config folder under the root folder of your Swift project. You will use that file, so the app can pick up the environment variables.
Here's a starter kit using a Swift Kitura server and clicking the Deploy to Cloud button will set up an example of everything on Kube automatically.