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 example for Fedora CoreOS, running ignition not cloud-init #1653

Closed
wants to merge 5 commits into from

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Jul 3, 2023

The default image comes with podman and docker and containerd installed.

It is read-only (for the most part), so the regular scripts wouldn't work anyway.

Apparently the uid conflicts, and setting the home directory doesn't work.

But otherwise it seems to be working - as long you have installed butane.


https://docs.fedoraproject.org/en-US/fedora-coreos/provisioning-qemu/

https://docs.fedoraproject.org/en-US/fedora-coreos/producing-ign/

@afbjorklund
Copy link
Member Author

Now with nerdctl installer, at least DIY prepared:

$ export LIMA_INSTANCE=fedora-coreos
$ nerdctl.lima version
FATA[0000] rootless containerd not running? (hint: use `containerd-rootless-setuptool.sh install` to start rootless containerd): stat /run/user/1001/containerd-rootless: no such file or directory 
$ lima containerd-rootless-setuptool.sh install
[INFO] Checking RootlessKit functionality
[INFO] Checking cgroup v2
[INFO] Checking overlayfs
[INFO] Requirements are satisfied
[INFO] Creating "/var/home/anders/.config/systemd/user/containerd.service"
[INFO] Starting systemd unit "containerd.service"
...
[INFO] Installed "containerd.service" successfully.
[INFO] To control "containerd.service", run: `systemctl --user (start|stop|restart) containerd.service`
[INFO] To run "containerd.service" on system startup automatically, run: `sudo loginctl enable-linger anders`
[INFO] ------------------------------------------------------------------------------------------
[INFO] Use `nerdctl` to connect to the rootless containerd.
[INFO] You do NOT need to specify $CONTAINERD_ADDRESS explicitly.
$ nerdctl.lima version
Client:
 Version:	v1.4.0
 OS/Arch:	linux/amd64
 Git commit:	7e8114a82da342cdbec9a518c5c6a1cce58105e9
 buildctl:
  Version:	v0.11.6
  GitCommit:	2951a28cd7085eb18979b1f710678623d94ed578

Server:
 containerd:
  Version:	v1.7.1
  GitCommit:	1677a17964311325ed1c31e2c0a3589ce6d5c30d
 runc:
  Version:	1.1.7
  GitCommit:	v1.1.7-0-g860f061b

examples/README.md Outdated Show resolved Hide resolved
arch: "aarch64"
digest: "sha256:0410362c212df040096933738607e56027005deb1c4a3eae417079180aaadc65"

# The guest home directory can not be changed with CoreOS currently.
Copy link
Member

Choose a reason for hiding this comment

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

The host home directory can be still mounted?

Copy link
Member Author

@afbjorklund afbjorklund Jul 9, 2023

Choose a reason for hiding this comment

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

My problem was they both use /home/anders... but there is a "homeDir" field in ignition - just that it looks unimplemented at the moment, and gives errors.

Another issue was that the "core" user now claims UID 1000, previously it used 500

Copy link
Member

Choose a reason for hiding this comment

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

Can we test this in CI?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what the test flow is for "Tier 2", but I don't see why not

Copy link
Member Author

Choose a reason for hiding this comment

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

@afbjorklund afbjorklund marked this pull request as ready for review July 23, 2023 16:57
@afbjorklund afbjorklund marked this pull request as draft July 24, 2023 08:40
@afbjorklund

This comment was marked as outdated.

@fwilhe2
Copy link
Contributor

fwilhe2 commented Sep 20, 2023

Very cool, seems to work as expected for me.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
CoreOS doesn't use cloud-init like the rest of the world,
but a custom system called ignition that requires compiling.

A host program called "butane" converts the cidata yaml,
to a host config file called config.ign (which is in json).

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
This doesn't actually start any services, but waiting for the
nerdctl user to run `containerd-rootless-setuptool.sh install`.

Alternatively to start up the installed system containerd.service,
replacing the one from docker, and run `sudo nerdctl` with it.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
It is only possible to lint the executed template, not the raw "yaml".

But it is syntax-checked by butane --strict anyway, so is not needed.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@afbjorklund afbjorklund marked this pull request as ready for review October 5, 2023 14:14
@afbjorklund afbjorklund closed this Jan 2, 2024
@afbjorklund
Copy link
Member Author

afbjorklund commented Jan 15, 2024

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.

3 participants