-
Notifications
You must be signed in to change notification settings - Fork 669
Implement system and user provisioning scripts #38
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
Conversation
I think I made the
Please let me know if I should implement any/all of these suggestions, either by amending this PR or by creating another one on top of it! |
Thanks a lot for working on this.
SGTM
I'd rather prefer to have
SGTM, but I guess we should make sure that we can have multiple "readiness" scripts. Probably we want to support "liveness" probes as well. e.g. probes:
- mode: readiness
script: ...
- mode: readiness
script: ...
- mode: liveness
script: ...
Either is fine to amend this PR or create another PR. |
Signed-off-by: Jan Dubois <[email protected]>
@AkihiroSuda I believe I have implemented everything you suggested. However, I was not sure how you would like to deploy the system-level I've not implemented liveness probes, mainly because I'm not sure what they are supposed to do when they fail. Oh, and I kept essential and optional requirements separate, contrary to what I wrote earlier: I think it is better to mount directories after |
Thanks! 👍
Yes, but that can be separate PR. |
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.
Thanks, I'll merge after some testing
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.
=== RUN TestTemplate
template_test.go:23: assertion failed: error is not nil: template: :87: unexpected "/" in command
--- FAIL: TestTemplate (0.00s)
FAIL
FAIL github.com/AkihiroSuda/lima/pkg/cidata 0.011s
BTW, when you have multiple user-provisioning scripts, then each one will be preceded by the wait logic:
This is redundant, but should be very fast. I found that extending the template to only generate it for the first script just makes the template less readable for very little gain. |
Signed-off-by: Jan Dubois <[email protected]>
Signed-off-by: Jan Dubois <[email protected]>
Just for the record, here is my images:
- location: "~/Downloads/hirsute-server-cloudimg-amd64.img"
arch: "x86_64"
mounts: []
ssh:
localPort: 60022
containerd:
system: false
user: false
provision:
- mode: system
script: |
#!/bin/sh
curl -sfL https://get.k3s.io | sh -
probes:
- script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 30s bash -c "until test -f /etc/rancher/k3s/k3s.yaml; do sleep 3; done"; then
echo >&2 "k3s is not running yet"
exit 1
fi
hint: |
The k3s kubeconfig file has not yet been created.
Run "lima bash sudo journalctl -u k3s" to check the log.
If that is still empty, check the bottom of the log at "/var/log/cloud-init-output.log". |
Thanks, can we have |
Sure, do you want me to add it to this PR? Just the plain file, or does it need additional documentation beyond just a comment at the top? |
Either is fine to me.
An additional documentation would be appreciated, but can be just a single or a few lines. |
Signed-off-by: Jan Dubois <[email protected]>
Follow-up to "Implement system and user provisioning scripts" (#38)
Fixes #33
In addition this PR implements a
bare-vm
setting that disables installation of optional requirements (containerd
andnerdctl
), and also skips installation ofsshfs
if there are no directories to mount.Example use to provision kubernetes via
k3s
(although not in rootless mode):And in a second shell: