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
Generalize createKindClusters.sh to create multiple clusters #131
Conversation
When given no args, it creates a us-east1 and us-west1 cluster as before. When given args, it creates clusters with those names. KinD configs, kubeconfigs and Cluster CRD YAMLs are generated and gitignored to avoid churn and potentially leaking sensitive information.
Codecov Report
@@ Coverage Diff @@
## main #131 +/- ##
=======================================
Coverage 20.75% 20.75%
=======================================
Files 5 5
Lines 318 318
=======================================
Hits 66 66
Misses 237 237
Partials 15 15 Continue to review full report at Codecov.
|
apiVersion: kind.x-k8s.io/v1alpha4 | ||
name: ${name} | ||
networking: | ||
apiServerAddress: "127.0.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, what's the reason for apiServerAddress 127.0.0.1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question (unrelated to this patch), but looks good to me.
@imjasonh @davidfestal can we merge this? I wanted to build a PR on top of it and it looks good to me. |
I'm OK with it, apart from the fact that, in the default case for the west cluster this PR removes the overriden k8s version (1.15.x) which is necessary for the apiNegociation test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the default case for the west cluster this PR removes the overriden k8s version (1.15.x) which is necessary for the apiNegociation test.
@imjasonh was it on purpose ?
Oh right, I guess it's accidental I guess we could have an array with the versions ? |
@imjasonh Do you agree this would be a good simple way to make this PR fully compatible with the previous behavior (especially for the |
How about The default would still be to create two clusters with the latest k8s version, but apiNegotiation would still be able to request an older version for one cluster. |
@imjasonh I assume I'm OK with this approach as well. |
ping @imjasonh @davidfestal |
Hey sorry, I realized I can make my work independent of this, please ignore my comments, no urge in merging. |
kind create cluster --config ${DEMO_ROOT}/clusters/kind/us-east1.config --kubeconfig ${DEMO_ROOT}/clusters/kind/us-east1.kubeconfig | ||
sed -e 's/^/ /' ${DEMO_ROOT}/clusters/kind/us-east1.kubeconfig | cat ${DEMO_ROOT}/clusters/us-east1.yaml - > ${DEMO_ROOT}/clusters/kind/us-east1.yaml | ||
kind delete cluster --name=${name} || true | ||
kind create cluster --config ${TMPDIR}/${name}.config --kubeconfig ${TMPDIR}/${name}.kubeconfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind create cluster --config ${TMPDIR}/${name}.config --kubeconfig ${TMPDIR}/${name}.kubeconfig | |
kind create cluster --config ${TMPDIR}/${name}.config --kubeconfig ${DEMO_ROOT}/clusters/kind/${name}.kubeconfig |
Could we keep it like this?
And then add those .kubeconfigs to .gitignore ?
Otherwise for some work I'm doing later it's not possible to fund the kubeconfigs and use them
You can always rely on kind get kubeconfig --name $cluster
but, if you have other kind cluster in the system we can't know if they belong to this demo or something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the kubeconfig comments.
kubeconfig: | | ||
EOF | ||
sed -e 's/^/ /' ${TMPDIR}/${name}.kubeconfig >> ${DEMO_ROOT}/clusters/${name}.yaml | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I say this, because this kubeconfig .yaml "Cluster" kind is something I can't consume later down the road (I could strip it out again dynamically though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely agree
Going through old-ish PRs - @imjasonh do you want to revive this & get it in? Want someone to take it over? Close it? Thanks! |
I wrote Go code to do the |
SGTM. Would like to hear from Jason before closing, though. |
@imjasonh based on yesterday's community meeting discussion about not wanting to maintain the demo framework, is it ok to close this? |
When given no args, it creates a us-east1 and us-west1 cluster as
before. When given args, it creates clusters with those names. KinD
configs, kubeconfigs and Cluster CRD YAMLs are generated and gitignored
to avoid churn and potentially leaking sensitive information.