-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
pre-load CNI #331
pre-load CNI #331
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9d72b84
to
e03fb4e
Compare
// we found the default manifest, install that | ||
// the images should already be loaded along with kubernetes | ||
if err := node.Command( | ||
"kubectl", "create", "--kubeconfig=/etc/kubernetes/admin.conf", |
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.
bellow we are using the "/bin/sh", "-c", ...
pattern for kubectl.
this seems better.
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.
we still pass the kubeconfig via the flag? this is the most explicit way to pass kubeconfig, I don't think using bash is better, we just need to easily exactly mimic the command they specify in their docs
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 would've strongly preferred to not invoke bash, but the upstream preferred installation from a non-fixed manifest is:
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
https://www.weave.works/docs/net/latest/kubernetes/kube-addon/#-installation
).Run(); err != nil { | ||
return errors.Wrap(err, "failed to apply overlay network") | ||
} | ||
} 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.
given now the images are preloaded and manifest is written on the node, shouldn't we exit with an error instead of going for the download from web method as a fallback?
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.
the command below does download from the web?
kind gracefully degrades in the presence of older images without this to the behavior expected for those images
this is in line with our principles of:
- graceful degredation
- avoiding breaking changes
- avoiding assumptions
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.
/lgtm
/hold
/hold cancel |
@BenTheElder a howto in the docs would be nice for this - it's not clear what are the exact deps/tools we need to have offline to deploy a cluster. |
@Kargakis noted -- right now you just need to install from HEAD and pull the node image. |
Yeap, I confirm I can create offline clusters now. Thanks! 🎉 🍾 🎉 🍾 |
Awesome! We'll definitely document this and ways to work with it 👍 |
* Bump cluster-operator prerrelease * Update DEPENDENCIES * Update pkg/cluster/internal/create/actions/createworker/provider.go
With this patch a cluster can be created fully offline. Fixes #200
A test image is at:
gcr.io/bentheelder-kind-dev/kindest/node:v1.13.3
How this works:
Along the way I cleaned up the image build slightly, and improved the ergonomics of the
exec.Command
interface to allow method chaining.