[WIP] OAuth configuration for hostAliases when running on local.ndslabs.org #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
EDGE CASE: When running on
www.local.ndslabs.org
, everything under*.local.ndslabs.org
will resolve tolocalhost
. This presents a problem on the off-chance that they attempt to access the domain directly from within a Pod.Note that
minikube
will likely not encounter the same problem, because it runs on its own IP and does not rely onlocalhost
resolving properly.For example, when the API receives a request to register/authenticate a user via OAuth, it needs to reach out to the
oauth2-proxy
Pod to verify the authenticity of the token. In doing so, it sends a request towww.local.ndslabs.org/oauth/userinfo
. This ultimately resolves tolocalhost/oauth/userinfo
which does not exist within the container, causing the request to fail.Approach
Include an optional snippet in the
deployment.yaml
to resolve to the Ingress controller instead, so that our request can be properlyHow to Test
minikube
should not encounter the same problemoauth-configuration
branch to use OAuth and to run onlocal.ndslabs.org
localhost
local.ndslabs.org
kubectl logs -f deploy/workbench -c apiserver
apiserver
logs from attempting to validate the OAuth tokenkubectl get deploy workbench -o yaml
hostAliases
configuration within the Workbench Deploymentapiserver
logs for this actionTODOs
hostAliases
segment conditional, only present if.Values.workbench.domain == "local.ndslabs.org"