Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cluster-kind.mk with setup for k8s api server oidc configured with test CA #1270

Merged
merged 3 commits into from
Nov 6, 2019

Conversation

absoludity
Copy link
Contributor

This diff:

  • Adds a cluster-kind.mk which enables a cluster-kind target that starts a local k8s environment with OIDC support, configured to trust a test CA,
  • Extracts the cert generation to a script and updates to create certs which can can be used for multiple hostnames (internally k8s will request dex.dex using tls, but we'll be port-forwarding to localhost, and the previous certs used CN=localhost).

I assume there's a way I can check locally that this doesn't impact e2e tests (it shouldn't, but I'd like to check tomorrow).

Q: Is there a reason to store these certs in the repo at all? I could have them as make targets which just get generated if not present etc.?

Ref: #1269

@absoludity absoludity requested a review from andresmgot November 5, 2019 06:00
@absoludity absoludity self-assigned this Nov 5, 2019
Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

I assume there's a way I can check locally that this doesn't impact e2e tests (it shouldn't, but I'd like to check tomorrow).

The e2e test are being executed in this PR so no problem.

Q: Is there a reason to store these certs in the repo at all? I could have them as make targets which just get generated if not present etc.?

I think I added them to the repo to save a bit of time.

--config=./devel/local-dev-apiserver-config.json \
--retain

cluster-kind: ${CLUSTER_CONFIG}
Copy link
Contributor

Choose a reason for hiding this comment

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

you also need a target to load the kubeconfig-path, no? export KUBECONFIG=$(kind get kubeconfig-path --name=kind)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makefiles don't let you change the external environment, each command is run in a subshell, which is a good thing... so what I want to do is separate the cluster creation helpers (like this one) from the kubeapps deployment configuration helper (which I'll add next). This is because deploying a configured oidc kubeapps example will be the same whether it's on a local kind or minishift or non-local env. So it'll be:

  1. Create your configured cluster (ie. with the oidc endpoint)
  2. Deploy the example kubeapps (which will configured for oidc)

Copy link
Contributor

Choose a reason for hiding this comment

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

true, I forgot that

I am not a enthusiast of Makefiles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, I forgot that

I am not a enthusiast of Makefiles

That's right - you mentioned and I wanted to hear more... next standup topic? :) (FWIW, I'm happy to use something else - I just don't see anything that fits the bill. Bash scripts need a lot of extra work to get the same benefits, imo, but I don't care that much).

@absoludity absoludity merged commit 72994ea into master Nov 6, 2019
@absoludity absoludity deleted the local-oauth-dev branch November 6, 2019 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants