Skip to content

allow the target to be set to http://kubernetes_host_ip:30556#19

Open
mpnally wants to merge 2 commits into
masterfrom
kubernetes-hostIP-target
Open

allow the target to be set to http://kubernetes_host_ip:30556#19
mpnally wants to merge 2 commits into
masterfrom
kubernetes-hostIP-target

Conversation

@mpnally
Copy link
Copy Markdown
Contributor

@mpnally mpnally commented Oct 26, 2016

No description provided.

@mpnally
Copy link
Copy Markdown
Contributor Author

mpnally commented Oct 26, 2016

I added code to access the K8S management API within the cluster to retrieve the hostIP address for the node on which the pod is running.

Before going down this path, I tried 2 other approaches and struck out with each. One was to try to use the feature referenced in this pull request that Jeremy pointed out: kubernetes/kubernetes#27880. Unfortunately, this gives you the host name, not its IP address. Also, it is the hosts external name, as it is known outside the cluster. It is not resolvable within the cluster (its not in DNS, at least)

I also tried Jeremy's suggestion of parsing /proc/net/route. On the machines I looked at, there is nothing useful in that file. I spent some time rummaging around in other files and did not find anything helpful

Comment thread bin/sso-proxy.js Outdated
var token = fs.readFileSync('/var/run/secrets/kubernetes.io/serviceaccount/token').toString()
var cert = fs.readFileSync('/var/run/secrets/kubernetes.io/serviceaccount/ca.crt').toString()
var ns = fs.readFileSync('/var/run/secrets/kubernetes.io/serviceaccount/namespace').toString()
var podName = process.env.POD_NAME
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite the assumption here. We should document how to use this and/or make this a configuration item that can be set in the YAML itself and overridden via an environment variable. Also, we do not do any sort of validation on the value and just assume its set. We should handle this.

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 1, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling a721771 on kubernetes-hostIP-target into 4f30f2f on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants