-
Hi! I have been keeping an eye on Bottlerocket for a couple of years now for use as a secure base, and with the recent introduction of kits, it seems very doable to build our own out-of-tree variants.
For now I copied over the three packages (settings-defaults, settings-migrations and settings-plugins) verbatim, including the entire sources/ folder into my Twoliter workspace and I got something that seems like a working image, is this the right path given the current state of things or did I miss something major? I understand if you do not want to provide support for OOTB with twoliter yet, but Bottlerocket is one of few (if not the only) distro that is closely compatible with the security posture we are looking to maintain, so we will probably keep tilting at the windmills either way. :) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Follow me on the journey of trying to package etcd! My first attempt was to just naively follow how fedora packages it - I found the spec file through downloading the src.rpm file from rpmfind, but alas they seem to just woefully download the go dependencies over the network in the build step. Something Bottlerocket prevents rather forcefully in their rpmbuild step here: https://github.com/bottlerocket-os/twoliter/blob/77bf67e44c472159e8ff9356ebeba688a2eca0ce/twoliter/embedded/build.Dockerfile#L116 I started trying to understand how external package dependencies are assembled (such as for Go software) - but it seems that the external go projects you have (containerd and kubernetes) have vendored their dependencies, either in your own tar archive that you manage in your cache or by good practice. After looking a bit more I also found host-ctr which has its sources in the sources/ folder of bottlerocket-core-kit and I found The issue seems to be a combination of the assumption of the Bottlerocket packaging system, that firstly, there is only one go.mod file in the root of the archive/source folder, and the go module layout that etcd has chosen (pre-workspace), where the target I want to build lives in etcd/server/ (the go.mod file) but, there are go.mod files in many places for the different binaries and libraries that etcd produces, and they all create a web of dependencies. I have done a few experiments, such as adding each go.mod file in their own folder in my sources/ folder and including them under Next stop was to just copy in the entire repository of etcd into the sources folder - this did not work either, as for some reason that I do not quite understand, I get this error:
I tried running the same command on my local toolchain ( Now I am at an impasse of tinkering with the default build of twoliter however and I am not sure what to try next wrt getting etcd to build. I think I may disable the no networking during the build phase? As that is really the only thing I can think of that would resolve this problem on the short term. Perhaps there is some valuable information here for a maintainer to extract to an actual action that would result in etcd being packaged without significantly worsening the security posture of Bottlerocket. |
Beta Was this translation helpful? Give feedback.
-
You may find the soci-snapshotter package useful, both the metadata for its multiple I've opened an issue in Twoliter to better support projects with multiple |
Beta Was this translation helpful? Give feedback.
-
That's the right path. Note that
The long-term plan is still to replace the above with settings extensions which will move OOTBs the rest of the way toward a model where they are composed primarily through packages you define locally or install via kit dependencies. Settings extensions will be just another package you install, and the API server will find them and use them automatically.
I've shared a project with you that might be a better reference point for getting started with an OOTB, since it dispenses with a lot of the legacy concerns. Eventually there will be something like a |
Beta Was this translation helpful? Give feedback.
-
I am not sure which one I should mark as an answer, as they were both super helpful! I got etcd building with soci-snapshotter strategy. |
Beta Was this translation helpful? Give feedback.
That's the right path. Note that
settings-migrations
can be made into basically a no-op which removes a bunch of the other crates (schnauzer
, etc) and makes it less of a rote copy/paste exercise overall.settings-plugins
defines the plugin (cdylib loaded at runtime byapiserver
) that backs the settings API, so you can reuse (copy) one of the existing plugins unless or until …