├── .github └── workflows │ └── build-iso.yaml ├── .gitignore ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md └── baseline ├── airootfs ├── etc │ ├── containers │ │ ├── containers.conf │ │ ├── registries.conf │ │ └── storage.conf │ ├── crio │ │ └── crio.conf │ ├── kubeadm │ │ └── kubeadm.conf.yaml.template │ ├── locale.conf │ ├── localtime │ ├── mkinitcpio.conf │ ├── mkinitcpio.d │ │ └── linux.preset.template │ ├── ntp.conf │ ├── resolv.conf │ ├── shadow │ └── systemd │ │ ├── system-generators │ │ └── systemd-gpt-auto-generator │ │ └── system │ │ ├── dbus-org.freedesktop.nm-dispatcher.service │ │ └── NetworkManager-dispatcher.service │ │ ├── getty@tty1.service.d │ │ └── autologin.conf │ │ ├── multi-user.target.wants │ │ ├── NetworkManager.service │ │ ├── hv_fcopy_daemon.service │ │ ├── hv_kvp_daemon.service │ │ ├── hv_vss_daemon.service │ │ ├── ntpd.service │ │ ├── run-at-startup.service │ │ ├── vboxservice.service │ │ ├── vmtoolsd.service │ │ └── vmware-vmblock-fuse.service │ │ └── network-online.target.wants │ │ └── NetworkManager-wait-online.service ├── root │ ├── .ssh │ │ └── authorized_keys │ └── init.sh.template └── usr │ └── lib │ └── systemd │ └── system │ └── run-at-startup.service ├── bootstrap_packages.x86_64 ├── efiboot └── loader │ ├── entries │ ├── 01-archiso-x86_64-linux.conf.template │ └── 02-archiso-x86_64-ram-linux.conf.template │ └── loader.conf ├── grub └── grub.cfg.template ├── packages.x86_64.template ├── pacman.conf.template ├── profiledef.sh └── syslinux ├── splash.png ├── syslinux-linux.cfg.template └── syslinux.cfg /.github/workflows/build-iso.yaml: -------------------------------------------------------------------------------- 1 | name: Build and Release ISO 2 | 3 | on: 4 | push: 5 | schedule: 6 | - cron: '0 0 * * *' # Runs daily at midnight UTC 7 | workflow_dispatch: 8 | inputs: 9 | enable_nvidia: 10 | description: 'Include NVIDIA packages (1 to enable, 0 to disable)' 11 | required: false 12 | default: '0' 13 | enable_amd: 14 | description: 'Include AMD packages (1 to enable, 0 to disable)' 15 | required: false 16 | default: '0' 17 | 18 | jobs: 19 | get-k8s-version: 20 | runs-on: ubuntu-latest 21 | outputs: 22 | K8S_VERSION: ${{ steps.get-version.outputs.version }} 23 | TAG_NAME: ${{ steps.set-tag-name.outputs.tag_name }} 24 | steps: 25 | - name: Get Latest Kubernetes Version 26 | id: get-version 27 | run: | 28 | version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt | tr -d 'v') 29 | echo "::set-output name=version::$version" 30 | 31 | - name: Determine Tag Name 32 | id: set-tag-name 33 | run: | 34 | if [ "${{ github.event_name }}" == "schedule" ]; then 35 | tag_name="nightly-$(date +%Y%m%d)" 36 | elif [ "${{ github.event_name }}" == "push" ]; then 37 | tag_name="v${{ steps.get-version.outputs.version }}-${{ github.sha }}" 38 | else 39 | tag_name="v${{ steps.get-version.outputs.version }}" 40 | fi 41 | echo "::set-output name=tag_name::$tag_name" 42 | 43 | - name: Set Unique Build ID 44 | id: set-build-id 45 | run: | 46 | BUILD_ID=$(uuidgen) 47 | echo "build_id=$BUILD_ID" >> $GITHUB_OUTPUT 48 | 49 | 50 | build-and-push-docker-image: 51 | runs-on: ubuntu-latest 52 | needs: get-k8s-version 53 | steps: 54 | - name: Checkout repository 55 | uses: actions/checkout@v3 56 | with: 57 | fetch-depth: 0 # Needed for full git history 58 | 59 | - name: Set up Docker Buildx 60 | uses: docker/setup-buildx-action@v2 61 | 62 | - name: Log in to GHCR 63 | uses: docker/login-action@v3 64 | with: 65 | registry: ghcr.io 66 | username: ${{ github.actor }} 67 | password: ${{ secrets.GITHUB_TOKEN }} 68 | 69 | - name: Build and Push Docker Image 70 | run: | 71 | docker build -t ghcr.io/mcserverhosting-net/os:latest . 72 | docker push ghcr.io/mcserverhosting-net/os:latest 73 | 74 | build-iso-x86-64-v2: 75 | runs-on: ubuntu-latest 76 | needs: [get-k8s-version, build-and-push-docker-image] 77 | steps: 78 | - name: Checkout repository 79 | uses: actions/checkout@v3 80 | with: 81 | fetch-depth: 0 82 | - name: Build ISO for x86-64-v2 83 | env: 84 | K8S_VERSION: ${{ needs.get-k8s-version.outputs.K8S_VERSION }} 85 | FEATURE_LEVELS: x86-64-v2 86 | ENABLE_NVIDIA: ${{ github.event.inputs.enable_nvidia || '0' }} 87 | ENABLE_AMD: ${{ github.event.inputs.enable_amd || '0' }} 88 | BUILD_ID: ${{ needs.get-k8s-version.outputs.BUILD_ID }} 89 | run: | 90 | docker run --privileged \ 91 | -e K8S_VERSION=$K8S_VERSION \ 92 | -e FEATURE_LEVELS=$FEATURE_LEVELS \ 93 | -e ENABLE_NVIDIA=$ENABLE_NVIDIA \ 94 | -e ENABLE_AMD=$ENABLE_AMD \ 95 | -v ${{ github.workspace }}:/workspace \ 96 | --entrypoint /bin/bash \ 97 | ghcr.io/mcserverhosting-net/os:latest \ 98 | -c "cd /workspace && make clean && make K8S_VERSION=$K8S_VERSION FEATURE_LEVELS=$FEATURE_LEVELS ENABLE_NVIDIA=$ENABLE_NVIDIA ENABLE_AMD=$ENABLE_AMD BUILD_ID=$BUILD_ID" 99 | 100 | - name: List generated ISOs 101 | run: ls -lh baseline/out/*.iso 102 | 103 | - name: Upload ISO Artifact 104 | uses: actions/upload-artifact@v3 105 | with: 106 | name: custom-archiso-${{ env.FEATURE_LEVELS }} 107 | path: baseline/out/*.iso 108 | 109 | build-iso-x86-64-v3: 110 | runs-on: ubuntu-latest 111 | needs: [get-k8s-version, build-and-push-docker-image] 112 | steps: 113 | - name: Checkout repository 114 | uses: actions/checkout@v3 115 | with: 116 | fetch-depth: 0 117 | - name: Build ISO for x86-64-v3 118 | env: 119 | K8S_VERSION: ${{ needs.get-k8s-version.outputs.K8S_VERSION }} 120 | FEATURE_LEVELS: x86-64-v3 121 | ENABLE_NVIDIA: ${{ github.event.inputs.enable_nvidia || '0' }} 122 | ENABLE_AMD: ${{ github.event.inputs.enable_amd || '0' }} 123 | BUILD_ID: ${{ needs.get-k8s-version.outputs.BUILD_ID }} 124 | run: | 125 | docker run --privileged \ 126 | -e K8S_VERSION=$K8S_VERSION \ 127 | -e FEATURE_LEVELS=$FEATURE_LEVELS \ 128 | -e ENABLE_NVIDIA=$ENABLE_NVIDIA \ 129 | -e ENABLE_AMD=$ENABLE_AMD \ 130 | -v ${{ github.workspace }}:/workspace \ 131 | --entrypoint /bin/bash \ 132 | ghcr.io/mcserverhosting-net/os:latest \ 133 | -c "cd /workspace && make clean && make K8S_VERSION=$K8S_VERSION FEATURE_LEVELS=$FEATURE_LEVELS ENABLE_NVIDIA=$ENABLE_NVIDIA ENABLE_AMD=$ENABLE_AMD BUILD_ID=$BUILD_ID" 134 | 135 | - name: List generated ISOs 136 | run: ls -lh baseline/out/*.iso 137 | 138 | - name: Upload ISO Artifact 139 | uses: actions/upload-artifact@v3 140 | with: 141 | name: custom-archiso-${{ env.FEATURE_LEVELS }} 142 | path: baseline/out/*.iso 143 | 144 | create-release: 145 | runs-on: ubuntu-latest 146 | needs: [build-iso-x86-64-v2, build-iso-x86-64-v3] 147 | steps: 148 | - name: Download Artifacts 149 | uses: actions/download-artifact@v3 150 | with: 151 | path: ./artifacts 152 | 153 | - name: Create GitHub Release 154 | uses: softprops/action-gh-release@v2 155 | with: 156 | files: artifacts/**/*.iso 157 | prerelease: ${{ github.event_name == 'schedule' || github.event_name == 'push' }} 158 | env: 159 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 160 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | baseline/out 2 | test -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM archlinux 2 | 3 | # Update and install necessary packages 4 | RUN pacman -Syu --noconfirm archiso base-devel git sudo wget grub edk2-shell gettext 5 | 6 | # Create a non-root user to use yay (AUR helper does not allow root) 7 | RUN useradd -m user \ 8 | && echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user 9 | 10 | USER user 11 | WORKDIR /home/user 12 | 13 | # Install yay 14 | RUN git clone https://aur.archlinux.org/yay.git \ 15 | && cd yay \ 16 | && makepkg -si --noconfirm 17 | 18 | # Install AUR packages 19 | RUN yay -S --noconfirm alhp-keyring alhp-mirrorlist 20 | 21 | USER root 22 | 23 | RUN gpg --recv-keys 0D4D2FDAF45468F3DDF59BEDE3D0D2CD3952E298 24 | RUN rm -r /etc/pacman.d/gnupg/ && pacman-key --init && pacman-key --populate 25 | 26 | # Set the entrypoint (optional) 27 | ENTRYPOINT ["mkarchiso"] 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Variables 2 | ENDPOINT ?= 3 | API_ADDRESS ?= $(ENDPOINT) 4 | TOKEN ?= 5 | CERTHASH ?= 6 | NODE_LABELS ?= net.mcserverhosting.node/ephemeral=true,kubernetes.io/os=MCSH 7 | 8 | NTP_SERVER_IP = 192.168.67.1 9 | 10 | # Kernel version to use 11 | LINUX ?= linux 12 | 13 | # Feature levels 14 | FEATURE_LEVELS = x86-64-v3 15 | 16 | # Kubernetes version 17 | K8S_VERSION ?= $(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt | tr -d 'v') 18 | 19 | # Packages 20 | NVIDIA_PACKAGES_LIST = nvidia-dkms nvidia-container-toolkit 21 | AMD_PACKAGES_LIST = amdgpu-pro-installer-debug rocm-hip-sdk rocm-opencl-sdk radeontop 22 | UNIX_TOOLS_LIST = openssh nano vim vi curl wget htop bpytop btop 23 | 24 | 25 | ENABLE_NVIDIA ?= 0 26 | ENABLE_AMD ?= 0 27 | 28 | # Kernel modules to load 29 | KERNEL_MODULES = br_netfilter ip6_tables ip_tables ip6table_mangle ip6table_raw ip6table_filter xt_socket erofs 30 | 31 | # Paths 32 | OUTPUT_DIR = baseline/airootfs/usr/local/bin 33 | 34 | INCLUDE_OPENSSH = $(shell grep -w 'openssh' baseline/packages.x86_64 >/dev/null && echo 1 || echo 0) 35 | 36 | all: template-linux template-kubeadm ssh-keys package-list init-script ntp-conf $(addprefix build-iso-,$(FEATURE_LEVELS)) 37 | 38 | 39 | # Process kubeadm.conf.yaml.template 40 | template-kubeadm: 41 | @echo "Templating kubeadm.conf.yaml with provided variables." 42 | @cp baseline/airootfs/etc/kubeadm/kubeadm.conf.yaml.template baseline/airootfs/etc/kubeadm/kubeadm.conf.yaml 43 | @if [ -n "$(API_ADDRESS)" ]; then \ 44 | sed -i 's|{{API_ADDRESS}}|$(API_ADDRESS)|g' baseline/airootfs/etc/kubeadm/kubeadm.conf.yaml; \ 45 | else \ 46 | echo "No API_ADDRESS provided; leaving placeholder for runtime substitution."; \ 47 | fi 48 | @if [ -n "$(TOKEN)" ]; then \ 49 | sed -i 's|{{TOKEN}}|$(TOKEN)|g' baseline/airootfs/etc/kubeadm/kubeadm.conf.yaml; \ 50 | else \ 51 | echo "No TOKEN provided; leaving placeholder for runtime substitution."; \ 52 | fi 53 | @if [ -n "$(CERTHASH)" ]; then \ 54 | sed -i 's|{{CERT_HASH}}|$(CERTHASH)|g' baseline/airootfs/etc/kubeadm/kubeadm.conf.yaml; \ 55 | else \ 56 | echo "No CERTHASH provided; leaving placeholder for runtime substitution."; \ 57 | fi 58 | @sed -i 's|{{NODE_LABELS}}|$(NODE_LABELS)|g' baseline/airootfs/etc/kubeadm/kubeadm.conf.yaml 59 | 60 | # Generate package list based on enabled features 61 | package-list: 62 | @echo "Generating package list..." 63 | @( \ 64 | export LINUX="$(LINUX)"; \ 65 | if [ "$(ENABLE_NVIDIA)" -eq "1" ]; then \ 66 | NVIDIA_PACKAGES="$$(printf '%s\n' $(NVIDIA_PACKAGES_LIST))"; \ 67 | else \ 68 | NVIDIA_PACKAGES=""; \ 69 | fi; \ 70 | if [ "$(ENABLE_AMD)" -eq "1" ]; then \ 71 | AMD_PACKAGES="$$(printf '%s\n' $(AMD_PACKAGES_LIST))"; \ 72 | else \ 73 | AMD_PACKAGES=""; \ 74 | fi; \ 75 | UNIX_TOOLS="$$(printf '%s\n' $(UNIX_TOOLS_LIST))"; \ 76 | export NVIDIA_PACKAGES; \ 77 | export AMD_PACKAGES; \ 78 | export UNIX_TOOLS; \ 79 | envsubst < baseline/packages.x86_64.template > baseline/packages.x86_64; \ 80 | ) 81 | 82 | # Ensure SSH keys have correct permissions 83 | ssh-keys: 84 | @if [ -d baseline/airootfs/root/.ssh ]; then \ 85 | chmod 700 baseline/airootfs/root/.ssh; \ 86 | if [ -f baseline/airootfs/root/.ssh/authorized_keys ]; then \ 87 | chmod 600 baseline/airootfs/root/.ssh/authorized_keys; \ 88 | fi; \ 89 | fi 90 | 91 | # Generate init.sh with modprobe commands and conditional SSH 92 | init-script: 93 | @echo "Generating init.sh with modprobe commands and SSH configuration..." 94 | @cp baseline/airootfs/root/init.sh.template baseline/airootfs/root/init.sh 95 | @sed -i '/# Load Kernel modules/a \ 96 | $(foreach module,$(KERNEL_MODULES),modprobe $(module);)' baseline/airootfs/root/init.sh 97 | @if [ "$(INCLUDE_OPENSSH)" -eq "1" ]; then \ 98 | echo "Enabling SSH in init script..."; \ 99 | sed -i 's|#ENABLE_SSH||' baseline/airootfs/root/init.sh; \ 100 | else \ 101 | echo "SSH will not be enabled as openssh is not included."; \ 102 | sed -i '/#ENABLE_SSH/d' baseline/airootfs/root/init.sh; \ 103 | fi 104 | @chmod +x baseline/airootfs/root/init.sh 105 | 106 | # Update ntp.conf with the specified NTP server IP 107 | ntp-conf: 108 | @echo "Configuring ntp.conf..." 109 | @sed -i 's|^server .*|server $(NTP_SERVER_IP)|' baseline/airootfs/etc/ntp.conf 110 | 111 | # Process all .template files 112 | template-linux: 113 | @echo "Templating files with LINUX=$(LINUX) and FEATURE_LEVEL=$(FEATURE_LEVEL)" 114 | @find baseline -type f -name "*.template" | while read template; do \ 115 | target="$${template%.template}"; \ 116 | echo "Processing $$template -> $$target"; \ 117 | sed 's|{{LINUX}}|$(LINUX)|g; s|{{FEATURE_LEVEL}}|$(FEATURE_LEVEL)|g' "$$template" > "$$target"; \ 118 | done 119 | 120 | # Process pacman.conf.template to generate pacman.conf 121 | pacman-conf: 122 | @echo "Templating pacman.conf with FEATURE_LEVEL=$(FEATURE_LEVEL)" 123 | @sed 's|{{FEATURE_LEVEL}}|$(FEATURE_LEVEL)|g' baseline/pacman.conf.template > baseline/pacman.conf 124 | 125 | # Build ISO for each feature level 126 | $(addprefix build-iso-,$(FEATURE_LEVELS)): 127 | @echo "Building ISO for feature level: $(@:build-iso-%=%)" 128 | @$(MAKE) build-iso FEATURE_LEVEL=$(@:build-iso-%=%) 129 | 130 | # Build the ISO using Docker 131 | build-iso: pacman-conf 132 | @echo "Building ISO for FEATURE_LEVEL=$(FEATURE_LEVEL)" 133 | @mkdir -p baseline/out/tmp 134 | @mkarchiso -v -w /tmp/mkarchiso -o baseline/out/tmp baseline -quiet=y 135 | @mv baseline/out/tmp/*.iso baseline/out/MCSHOS-$(K8S_VERSION)-$(FEATURE_LEVEL).iso 136 | @rm -rf /tmp/mkarchiso/* 137 | @rm -rf /var/cache/pacman 138 | 139 | # Clean target 140 | clean: 141 | rm -rf baseline/out/*.iso 142 | 143 | # Phony targets 144 | .PHONY: all clean build-iso $(addprefix build-iso-,$(FEATURE_LEVELS)) 145 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MCSH-OS 2 | 3 | ![Splash Image](https://github.com/mcserverhosting-net/OS/blob/main/baseline/syslinux/splash.png?raw=true) 4 | 5 | Welcome to the MCSH-OS project! This ISO provides a ready-to-use, ephemeral Arch Linux-based system designed to automatically join a Kubernetes cluster on boot. It simplifies scaling your Kubernetes cluster with minimal effort and customization. 6 | 7 | ## Table of Contents 8 | 9 | - [MCSH-OS](#mcsh-os) 10 | - [Table of Contents](#table-of-contents) 11 | - [Overview](#overview) 12 | - [Features](#features) 13 | - [Usage](#usage) 14 | - [Quick Start](#quick-start) 15 | - [DHCP Options for Auto-Join](#dhcp-options-for-auto-join) 16 | - [Example ISC DHCP Server Configuration](#example-isc-dhcp-server-configuration) 17 | - [Customization](#customization) 18 | - [Building from Prebuilt Docker Image](#building-from-prebuilt-docker-image) 19 | - [Enabling NVIDIA or AMD Packages](#enabling-nvidia-or-amd-packages) 20 | - [Customizing Packages](#customizing-packages) 21 | - [Kernel Modules](#kernel-modules) 22 | - [NTP Configuration](#ntp-configuration) 23 | - [Feature Levels](#feature-levels) 24 | - [Contributing](#contributing) 25 | - [License](#license) 26 | - [Original Reddit Post](#original-reddit-post) 27 | 28 | ## Overview 29 | 30 | This project provides a lightweight, customizable ISO for quickly adding worker nodes to a Kubernetes cluster. By booting from this ISO, nodes can automatically join a cluster using predefined values from an HTTP server, eliminating the need for manual configuration. 31 | 32 | Originally developed by our hosting service to manage nodes at scale, this ISO is ideal for environments where ephemeral worker nodes are beneficial, such as test clusters, CI/CD pipelines, or dynamic scaling scenarios. 33 | 34 | ## Features 35 | 36 | - **Automatic Kubernetes Cluster Join**: Nodes booting from the ISO automatically join your Kubernetes cluster using DHCP-provided configurations. 37 | 38 | - **Ephemeral Nodes**: Designed for stateless, ephemeral nodes that can be easily restarted or replaced. 39 | 40 | - **Multiple x86-64 Feature Levels**: Optimized for `x86-64-v2`, `x86-64-v3`, and `x86-64-v4` architectures for improved performance. 41 | 42 | - **Optional NVIDIA and AMD Support**: Include NVIDIA or AMD packages to support GPU workloads. 43 | 44 | - **Customizable**: Build your own ISO using the provided Docker image and Makefile for full customization. 45 | 46 | - **Lightweight**: The default ISO is approximately 800MB; with NVIDIA packages, it is around 1.4GB. 47 | 48 | ## Usage 49 | 50 | ### Quick Start 51 | 52 | You don't need to build the ISO yourself unless you want to customize it. You can download the latest prebuilt ISO from the [Releases](https://github.com/mcserverhosting-net/OS/releases) page. (We currently cannot build v4, you'll have to do that yourself) 53 | 54 | 1. **Download the ISO**: 55 | 56 |    Visit the [Releases](https://github.com/mcserverhosting-net/OS/releases) page and download the latest ISO artifact. 57 | 58 | 2. **Set Up HTTP Options**: 59 | 60 |    Configure an HTTP server to provide the necessary options for the nodes to auto-join your Kubernetes cluster. See [HTTP Options for Auto-Join](#http-options-for-auto-join) below. 61 | 62 | 3. **Boot the Node**: 63 | 64 |    Boot your machine using the downloaded ISO (via USB, PXE, or virtual machine). The node will automatically format the first available disk, load necessary kernel modules, and join your Kubernetes cluster. 65 | 66 | ### HTTP Options for Auto-Join 67 | 68 | To enable nodes to automatically join your Kubernetes cluster, configure your HTTP server to have the following files: 69 | 70 | | Path | Name                        | Description                                                | 71 | |-------------|-----------------------------|------------------------------------------------------------| 72 | | /token       | Token                | The token for kubeadm join.                                   | 73 | | /apiServerEndpoint      | API Server Endpoint                     | The API Address and port for your kubernetes cluster.                             | 74 | | /certHash       | CA Cert Hash        | The CA Cert Hash for your cluster.                                         | 75 | ## Customization 76 | 77 | ### Building from Prebuilt Docker Image 78 | 79 | If you wish to customize the ISO, you can build it yourself using the prebuilt Docker image provided. 80 | 81 | 1. **Clone the Repository**: 82 | 83 | ```bash 84 | git clone https://github.com/mcserverhosting-net/OS.git 85 | cd OS 86 | ``` 87 | 88 | 2. **Build the ISO**: 89 | 90 | ```bash 91 | docker run --privileged 92 | -v $(pwd):/workspace 93 | ghcr.io/mcserverhosting-net/os:latest 94 | make clean && make 95 | ``` 96 |    This command uses the prebuilt Docker image `ghcr.io/mcserverhosting-net/os:latest` to build the ISO inside a container. 97 | 98 | 3. **Find Your ISO**: 99 | 100 |    The generated ISO files will be located in the `baseline/out/` directory. 101 | 102 | ### Enabling NVIDIA or AMD Packages 103 | 104 | To include NVIDIA or AMD packages in your custom ISO, set the `ENABLE_NVIDIA` or `ENABLE_AMD` environment variable when running `make`. 105 | 106 | - **Enable NVIDIA Packages**: 107 | 108 | ```bash 109 | make ENABLE_NVIDIA=1 110 | ``` 111 | 112 | - **Enable AMD Packages**: 113 | 114 | ```bash 115 | make ENABLE_AMD=1 116 | ``` 117 | 118 | ### Customizing Packages 119 | 120 | Edit the `packages.x86_64.template` file in the `baseline/` directory to add or remove packages according to your needs. 121 | 122 | - **Add Packages**: Add package names to the list in `packages.x86_64.template`. 123 | 124 | - **Remove Packages**: Comment out or delete package names from the list. 125 | 126 | ### Kernel Modules 127 | 128 | Specify the kernel modules to load during boot by modifying the `KERNEL_MODULES_LIST` variable in the `Makefile`. 129 | 130 | ```makefile 131 | KERNEL_MODULES_LIST = br_netfilter ip6_tables ip_tables ip6table_mangle ip6table_raw ip6table_filter xt_socket erofs 132 | ``` 133 | 134 | ### NTP Configuration 135 | 136 | Set your NTP server IP address in the `Makefile`: 137 | 138 | ```makefile 139 | NTP_SERVER_IP = your.ntp.server.ip 140 | ``` 141 | 142 | ## Feature Levels 143 | 144 | This project references [ALHP.GO](https://somegit.dev/ALHP/ALHP.GO), which provides Arch Linux packages optimized with different x86-64 feature levels, `-O3` optimizations, and LTO (Link Time Optimization). You can build ISOs optimized for different CPU architectures: 145 | 146 | - **x86-64-v2**: For CPUs supporting SSE3 and other basic extensions. 147 | - **x86-64-v3**: For CPUs with AVX, AVX2, and FMA3 instructions. 148 | - **x86-64-v4**: For the latest CPUs supporting AVX512 instructions. 149 | 150 | To build an ISO for a specific feature level, set the `FEATURE_LEVEL` variable: 151 | 152 | ```bash 153 | make FEATURE_LEVEL=x86-64-v4 154 | ``` 155 | 156 | ## Contributing 157 | 158 | Contributions are welcome! If you have improvements or bug fixes, please open an issue or submit a pull request. 159 | 160 | ## License 161 | 162 | This project is licensed under the GNU GENERAL PUBLIC LICENSE. See the [LICENSE](LICENSE) file for details. 163 | 164 | ## Original Reddit Post 165 | 166 | For historical context, this project was announced on [Reddit](https://www.reddit.com/r/kubernetes/comments/zjk605/releasing_our_kubeadmbased_os_to_the_public/) 167 | 168 | In loving memory of Bradley Joseph Root and his dog, [Elli](https://kubernetes.io/blog/2024/08/13/kubernetes-v1-31-release/) 169 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/containers/containers.conf: -------------------------------------------------------------------------------- 1 | # The containers configuration file specifies all of the available configuration 2 | # command-line options/flags for container engine tools like Podman & Buildah, 3 | # but in a TOML format that can be easily modified and versioned. 4 | 5 | # Please refer to containers.conf(5) for details of all configuration options. 6 | # Not all container engines implement all of the options. 7 | # All of the options have hard coded defaults and these options will override 8 | # the built in defaults. Users can then override these options via the command 9 | # line. Container engines will read containers.conf files in up to three 10 | # locations in the following order: 11 | # 1. /usr/share/containers/containers.conf 12 | # 2. /etc/containers/containers.conf 13 | # 3. $HOME/.config/containers/containers.conf (Rootless containers ONLY) 14 | # Items specified in the latter containers.conf, if they exist, override the 15 | # previous containers.conf settings, or the default settings. 16 | 17 | [containers] 18 | 19 | # List of devices. Specified as 20 | # "::", for example: 21 | # "/dev/sdc:/dev/xvdc:rwm". 22 | # If it is empty or commented out, only the default devices will be used 23 | # 24 | # devices = [] 25 | 26 | # List of volumes. Specified as 27 | # "::", for example: 28 | # "/db:/var/lib/db:ro". 29 | # If it is empty or commented out, no volumes will be added 30 | # 31 | # volumes = [] 32 | 33 | # Used to change the name of the default AppArmor profile of container engine. 34 | # 35 | # apparmor_profile = "container-default" 36 | 37 | # List of annotation. Specified as 38 | # "key=value" 39 | # If it is empty or commented out, no annotations will be added 40 | # 41 | # annotations = [] 42 | 43 | # Default way to to create a cgroup namespace for the container 44 | # Options are: 45 | # `private` Create private Cgroup Namespace for the container. 46 | # `host` Share host Cgroup Namespace with the container. 47 | # 48 | # cgroupns = "private" 49 | 50 | # Control container cgroup configuration 51 | # Determines whether the container will create CGroups. 52 | # Options are: 53 | # `enabled` Enable cgroup support within container 54 | # `disabled` Disable cgroup support, will inherit cgroups from parent 55 | # `no-conmon` Do not create a cgroup dedicated to conmon. 56 | # 57 | # cgroups = "enabled" 58 | 59 | # List of default capabilities for containers. If it is empty or commented out, 60 | # the default capabilities defined in the container engine will be added. 61 | # 62 | default_capabilities = [ 63 | "CHOWN", 64 | "DAC_OVERRIDE", 65 | "FOWNER", 66 | "FSETID", 67 | "KILL", 68 | "NET_BIND_SERVICE", 69 | "SETFCAP", 70 | "SETGID", 71 | "SETPCAP", 72 | "SETUID", 73 | "SYS_CHROOT" 74 | ] 75 | 76 | # A list of sysctls to be set in containers by default, 77 | # specified as "name=value", 78 | # for example:"net.ipv4.ping_group_range = 0 0". 79 | # 80 | default_sysctls = [ 81 | "net.ipv4.ping_group_range=0 0", 82 | ] 83 | 84 | # A list of ulimits to be set in containers by default, specified as 85 | # "=:", for example: 86 | # "nofile=1024:2048" 87 | # See setrlimit(2) for a list of resource names. 88 | # Any limit not specified here will be inherited from the process launching the 89 | # container engine. 90 | # Ulimits has limits for non privileged container engines. 91 | # 92 | # default_ulimits = [ 93 | # "nofile=1280:2560", 94 | # ] 95 | 96 | # List of default DNS options to be added to /etc/resolv.conf inside of the container. 97 | # 98 | # dns_options = [] 99 | 100 | # List of default DNS search domains to be added to /etc/resolv.conf inside of the container. 101 | # 102 | # dns_searches = [] 103 | 104 | # Set default DNS servers. 105 | # This option can be used to override the DNS configuration passed to the 106 | # container. The special value "none" can be specified to disable creation of 107 | # /etc/resolv.conf in the container. 108 | # The /etc/resolv.conf file in the image will be used without changes. 109 | # 110 | # dns_servers = [] 111 | 112 | # Environment variable list for the conmon process; used for passing necessary 113 | # environment variables to conmon or the runtime. 114 | # 115 | # env = [ 116 | # "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 117 | # "TERM=xterm", 118 | # ] 119 | 120 | # Pass all host environment variables into the container. 121 | # 122 | # env_host = false 123 | 124 | # Default proxy environment variables passed into the container. 125 | # The environment variables passed in include: 126 | # http_proxy, https_proxy, ftp_proxy, no_proxy, and the upper case versions of 127 | # these. This option is needed when host system uses a proxy but container 128 | # should not use proxy. Proxy environment variables specified for the container 129 | # in any other way will override the values passed from the host. 130 | # 131 | # http_proxy = true 132 | 133 | # Run an init inside the container that forwards signals and reaps processes. 134 | # 135 | # init = false 136 | 137 | # Container init binary, if init=true, this is the init binary to be used for containers. 138 | # 139 | # init_path = "/usr/libexec/podman/catatonit" 140 | 141 | # Default way to to create an IPC namespace (POSIX SysV IPC) for the container 142 | # Options are: 143 | # `private` Create private IPC Namespace for the container. 144 | # `host` Share host IPC Namespace with the container. 145 | # 146 | # ipcns = "private" 147 | 148 | # keyring tells the container engine whether to create 149 | # a kernel keyring for use within the container. 150 | # keyring = true 151 | 152 | # label tells the container engine whether to use container separation using 153 | # MAC(SELinux) labeling or not. 154 | # The label flag is ignored on label disabled systems. 155 | # 156 | # label = true 157 | 158 | # Logging driver for the container. Available options: k8s-file and journald. 159 | # 160 | # log_driver = "k8s-file" 161 | 162 | # Maximum size allowed for the container log file. Negative numbers indicate 163 | # that no size limit is imposed. If positive, it must be >= 8192 to match or 164 | # exceed conmon's read buffer. The file is truncated and re-opened so the 165 | # limit is never exceeded. 166 | # 167 | # log_size_max = -1 168 | 169 | # Default way to to create a Network namespace for the container 170 | # Options are: 171 | # `private` Create private Network Namespace for the container. 172 | # `host` Share host Network Namespace with the container. 173 | # `none` Containers do not use the network 174 | # 175 | # netns = "private" 176 | 177 | # Create /etc/hosts for the container. By default, container engine manage 178 | # /etc/hosts, automatically adding the container's own IP address. 179 | # 180 | # no_hosts = false 181 | 182 | # Maximum number of processes allowed in a container. 183 | # 184 | # pids_limit = 2048 185 | 186 | # Default way to to create a PID namespace for the container 187 | # Options are: 188 | # `private` Create private PID Namespace for the container. 189 | # `host` Share host PID Namespace with the container. 190 | # 191 | # pidns = "private" 192 | 193 | # Path to the seccomp.json profile which is used as the default seccomp profile 194 | # for the runtime. 195 | # 196 | # seccomp_profile = "/usr/share/containers/seccomp.json" 197 | 198 | # Size of /dev/shm. Specified as . 199 | # Unit is optional, values: 200 | # b (bytes), k (kilobytes), m (megabytes), or g (gigabytes). 201 | # If the unit is omitted, the system uses bytes. 202 | # 203 | # shm_size = "65536k" 204 | 205 | # Set timezone in container. Takes IANA timezones as well as "local", 206 | # which sets the timezone in the container to match the host machine. 207 | # 208 | # tz = "" 209 | 210 | # Set umask inside the container 211 | # 212 | # umask="0022" 213 | 214 | # Default way to to create a UTS namespace for the container 215 | # Options are: 216 | # `private` Create private UTS Namespace for the container. 217 | # `host` Share host UTS Namespace with the container. 218 | # 219 | # utsns = "private" 220 | 221 | # Default way to to create a User namespace for the container 222 | # Options are: 223 | # `auto` Create unique User Namespace for the container. 224 | # `host` Share host User Namespace with the container. 225 | # 226 | # userns = "host" 227 | 228 | # Number of UIDs to allocate for the automatic container creation. 229 | # UIDs are allocated from the "container" UIDs listed in 230 | # /etc/subuid & /etc/subgid 231 | # 232 | # userns_size=65536 233 | 234 | # The network table contains settings pertaining to the management of 235 | # CNI plugins. 236 | 237 | [network] 238 | 239 | # Path to directory where CNI plugin binaries are located. 240 | # 241 | # cni_plugin_dirs = ["/usr/libexec/cni"] 242 | 243 | # The network name of the default CNI network to attach pods to. 244 | # default_network = "podman" 245 | 246 | # The default subnet for the default CNI network given in default_network. 247 | # If a network with that name does not exist, a new network using that name and 248 | # this subnet will be created. 249 | # Must be a valid IPv4 CIDR prefix. 250 | #default_subnet = "10.88.0.0/16" 251 | 252 | # Path to the directory where CNI configuration files are located. 253 | # 254 | # network_config_dir = "/etc/cni/net.d/" 255 | 256 | [engine] 257 | # Maximum number of image layers to be copied (pulled/pushed) simultaneously. 258 | # Not setting this field, or setting it to zero, will fall back to containers/image defaults. 259 | # image_parallel_copies=0 260 | 261 | # Manifest Type (oci, v2s2, or v2s1) to use when pulling, pushing, building 262 | # container images. By default image pulled and pushed match the format of the 263 | # source image. Building/committing defaults to OCI. 264 | # image_default_format = "" 265 | 266 | # Cgroup management implementation used for the runtime. 267 | # Valid options "systemd" or "cgroupfs" 268 | # 269 | # cgroup_manager = "systemd" 270 | 271 | # Environment variables to pass into conmon 272 | # 273 | # conmon_env_vars = [ 274 | # "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 275 | # ] 276 | 277 | # Paths to look for the conmon container manager binary 278 | # 279 | # conmon_path = [ 280 | # "/usr/libexec/podman/conmon", 281 | # "/usr/local/libexec/podman/conmon", 282 | # "/usr/local/lib/podman/conmon", 283 | # "/usr/bin/conmon", 284 | # "/usr/sbin/conmon", 285 | # "/usr/local/bin/conmon", 286 | # "/usr/local/sbin/conmon" 287 | # ] 288 | 289 | # Specify the keys sequence used to detach a container. 290 | # Format is a single character [a-Z] or a comma separated sequence of 291 | # `ctrl-`, where `` is one of: 292 | # `a-z`, `@`, `^`, `[`, `\`, `]`, `^` or `_` 293 | # 294 | # detach_keys = "ctrl-p,ctrl-q" 295 | 296 | # Determines whether engine will reserve ports on the host when they are 297 | # forwarded to containers. When enabled, when ports are forwarded to containers, 298 | # ports are held open by as long as the container is running, ensuring that 299 | # they cannot be reused by other programs on the host. However, this can cause 300 | # significant memory usage if a container has many ports forwarded to it. 301 | # Disabling this can save memory. 302 | # 303 | # enable_port_reservation = true 304 | 305 | # Environment variables to be used when running the container engine (e.g., Podman, Buildah). 306 | # For example "http_proxy=internal.proxy.company.com". 307 | # Note these environment variables will not be used within the container. 308 | # Set the env section under [containers] table, if you want to set environment variables for the container. 309 | # env = [] 310 | 311 | # Selects which logging mechanism to use for container engine events. 312 | # Valid values are `journald`, `file` and `none`. 313 | # 314 | # events_logger = "journald" 315 | 316 | # Path to OCI hooks directories for automatically executed hooks. 317 | # 318 | # hooks_dir = [ 319 | # "/usr/share/containers/oci/hooks.d", 320 | # ] 321 | 322 | # Default transport method for pulling and pushing for images 323 | # 324 | # image_default_transport = "docker://" 325 | 326 | # Default command to run the infra container 327 | # 328 | # infra_command = "/pause" 329 | 330 | # Infra (pause) container image name for pod infra containers. When running a 331 | # pod, we start a `pause` process in a container to hold open the namespaces 332 | # associated with the pod. This container does nothing other then sleep, 333 | # reserving the pods resources for the lifetime of the pod. 334 | # 335 | # infra_image = "k8s.gcr.io/pause:3.4.1" 336 | 337 | # Specify the locking mechanism to use; valid values are "shm" and "file". 338 | # Change the default only if you are sure of what you are doing, in general 339 | # "file" is useful only on platforms where cgo is not available for using the 340 | # faster "shm" lock type. You may need to run "podman system renumber" after 341 | # you change the lock type. 342 | # 343 | # lock_type** = "shm" 344 | 345 | # Indicates if Podman is running inside a VM via Podman Machine. 346 | # Podman uses this value to do extra setup around networking from the 347 | # container inside the VM to to host. 348 | # machine_enabled=false 349 | 350 | # MultiImageArchive - if true, the container engine allows for storing archives 351 | # (e.g., of the docker-archive transport) with multiple images. By default, 352 | # Podman creates single-image archives. 353 | # 354 | # multi_image_archive = "false" 355 | 356 | # Default engine namespace 357 | # If engine is joined to a namespace, it will see only containers and pods 358 | # that were created in the same namespace, and will create new containers and 359 | # pods in that namespace. 360 | # The default namespace is "", which corresponds to no namespace. When no 361 | # namespace is set, all containers and pods are visible. 362 | # 363 | # namespace = "" 364 | 365 | # Path to the slirp4netns binary 366 | # 367 | # network_cmd_path="" 368 | 369 | # Default options to pass to the slirp4netns binary. 370 | # For example "allow_host_loopback=true" 371 | # 372 | # network_cmd_options=[] 373 | 374 | # Whether to use chroot instead of pivot_root in the runtime 375 | # 376 | # no_pivot_root = false 377 | 378 | # Number of locks available for containers and pods. 379 | # If this is changed, a lock renumber must be performed (e.g. with the 380 | # 'podman system renumber' command). 381 | # 382 | # num_locks = 2048 383 | 384 | # Whether to pull new image before running a container 385 | # pull_policy = "missing" 386 | 387 | # Indicates whether the application should be running in remote mode. This flag modifies the 388 | # --remote option on container engines. Setting the flag to true will default 389 | # `podman --remote=true` for access to the remote Podman service. 390 | # remote = false 391 | 392 | # Directory for persistent engine files (database, etc) 393 | # By default, this will be configured relative to where the containers/storage 394 | # stores containers 395 | # Uncomment to change location from this default 396 | # 397 | # static_dir = "/var/lib/containers/storage/libpod" 398 | 399 | # Directory for temporary files. Must be tmpfs (wiped after reboot) 400 | # 401 | # tmp_dir = "/run/libpod" 402 | 403 | # Directory for libpod named volumes. 404 | # By default, this will be configured relative to where containers/storage 405 | # stores containers. 406 | # Uncomment to change location from this default. 407 | # 408 | # volume_path = "/var/lib/containers/storage/volumes" 409 | 410 | # Default OCI runtime 411 | # 412 | # runtime = "crun" 413 | 414 | # List of the OCI runtimes that support --format=json. When json is supported 415 | # engine will use it for reporting nicer errors. 416 | # 417 | # runtime_supports_json = ["crun", "runc", "kata", "runsc"] 418 | 419 | # List of the OCI runtimes that supports running containers without cgroups. 420 | # 421 | # runtime_supports_nocgroups = ["crun"] 422 | 423 | # List of the OCI runtimes that supports running containers with KVM Separation. 424 | # 425 | # runtime_supports_kvm = ["kata"] 426 | 427 | # Number of seconds to wait for container to exit before sending kill signal. 428 | # stop_timeout = 10 429 | 430 | # Index to the active service 431 | # active_service = production 432 | 433 | # map of service destinations 434 | # [service_destinations] 435 | # [service_destinations.production] 436 | # URI to access the Podman service 437 | # Examples: 438 | # rootless "unix://run/user/$UID/podman/podman.sock" (Default) 439 | # rootfull "unix://run/podman/podman.sock (Default) 440 | # remote rootless ssh://engineering.lab.company.com/run/user/1000/podman/podman.sock 441 | # remote rootfull ssh://root@10.10.1.136:22/run/podman/podman.sock 442 | # uri="ssh://user@production.example.com/run/user/1001/podman/podman.sock" 443 | # Path to file containing ssh identity key 444 | # identity = "~/.ssh/id_rsa" 445 | 446 | # Paths to look for a valid OCI runtime (crun, runc, kata, runsc, etc) 447 | [engine.runtimes] 448 | # crun = [ 449 | # "/usr/bin/crun", 450 | # "/usr/sbin/crun", 451 | # "/usr/local/bin/crun", 452 | # "/usr/local/sbin/crun", 453 | # "/sbin/crun", 454 | # "/bin/crun", 455 | # "/run/current-system/sw/bin/crun", 456 | # ] 457 | 458 | # runc = [ 459 | # "/usr/bin/runc", 460 | # "/usr/sbin/runc", 461 | # "/usr/local/bin/runc", 462 | # "/usr/local/sbin/runc", 463 | # "/sbin/runc", 464 | # "/bin/runc", 465 | # "/usr/lib/cri-o-runc/sbin/runc", 466 | # ] 467 | 468 | # kata = [ 469 | # "/usr/bin/kata-runtime", 470 | # "/usr/sbin/kata-runtime", 471 | # "/usr/local/bin/kata-runtime", 472 | # "/usr/local/sbin/kata-runtime", 473 | # "/sbin/kata-runtime", 474 | # "/bin/kata-runtime", 475 | # "/usr/bin/kata-qemu", 476 | # "/usr/bin/kata-fc", 477 | # ] 478 | 479 | # runsc = [ 480 | # "/usr/bin/runsc", 481 | # "/usr/sbin/runsc", 482 | # "/usr/local/bin/runsc", 483 | # "/usr/local/sbin/runsc", 484 | # "/bin/runsc", 485 | # "/sbin/runsc", 486 | # "/run/current-system/sw/bin/runsc", 487 | # ] 488 | 489 | [engine.volume_plugins] 490 | # testplugin = "/run/podman/plugins/test.sock" 491 | 492 | # The [engine.volume_plugins] table MUST be the last entry in this file. 493 | # (Unless another table is added) 494 | # TOML does not provide a way to end a table other than a further table being 495 | # defined, so every key hereafter will be part of [volume_plugins] and not the 496 | # main config. 497 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/containers/registries.conf: -------------------------------------------------------------------------------- 1 | # For more information on this configuration file, see containers-registries.conf(5). 2 | # 3 | # NOTE: RISK OF USING UNQUALIFIED IMAGE NAMES 4 | # We recommend always using fully qualified image names including the registry 5 | # server (full dns name), namespace, image name, and tag 6 | # (e.g., registry.redhat.io/ubi8/ubi:latest). Pulling by digest (i.e., 7 | # quay.io/repository/name@digest) further eliminates the ambiguity of tags. 8 | # When using short names, there is always an inherent risk that the image being 9 | # pulled could be spoofed. For example, a user wants to pull an image named 10 | # `foobar` from a registry and expects it to come from myregistry.com. If 11 | # myregistry.com is not first in the search list, an attacker could place a 12 | # different `foobar` image at a registry earlier in the search list. The user 13 | # would accidentally pull and run the attacker's image and code rather than the 14 | # intended content. We recommend only adding registries which are completely 15 | # trusted (i.e., registries which don't allow unknown or anonymous users to 16 | # create accounts with arbitrary names). This will prevent an image from being 17 | # spoofed, squatted or otherwise made insecure. If it is necessary to use one 18 | # of these registries, it should be added at the end of the list. 19 | # 20 | # # An array of host[:port] registries to try when pulling an unqualified image, in order. 21 | # unqualified-search-registries = ["example.com"] 22 | # 23 | # [[registry]] 24 | # # The "prefix" field is used to choose the relevant [[registry]] TOML table; 25 | # # (only) the TOML table with the longest match for the input image name 26 | # # (taking into account namespace/repo/tag/digest separators) is used. 27 | # # 28 | # # The prefix can also be of the form: *.example.com for wildcard subdomain 29 | # # matching. 30 | # # 31 | # # If the prefix field is missing, it defaults to be the same as the "location" field. 32 | # prefix = "example.com/foo" 33 | # 34 | # # If true, unencrypted HTTP as well as TLS connections with untrusted 35 | # # certificates are allowed. 36 | # insecure = false 37 | # 38 | # # If true, pulling images with matching names is forbidden. 39 | # blocked = false 40 | # 41 | # # The physical location of the "prefix"-rooted namespace. 42 | # # 43 | # # By default, this is equal to "prefix" (in which case "prefix" can be omitted 44 | # # and the [[registry]] TOML table can only specify "location"). 45 | # # 46 | # # Example: Given 47 | # # prefix = "example.com/foo" 48 | # # location = "internal-registry-for-example.net/bar" 49 | # # requests for the image example.com/foo/myimage:latest will actually work with the 50 | # # internal-registry-for-example.net/bar/myimage:latest image. 51 | # 52 | # # The location can be empty iff prefix is in a 53 | # # wildcarded format: "*.example.com". In this case, the input reference will 54 | # # be used as-is without any rewrite. 55 | # location = internal-registry-for-example.com/bar" 56 | # 57 | # # (Possibly-partial) mirrors for the "prefix"-rooted namespace. 58 | # # 59 | # # The mirrors are attempted in the specified order; the first one that can be 60 | # # contacted and contains the image will be used (and if none of the mirrors contains the image, 61 | # # the primary location specified by the "registry.location" field, or using the unmodified 62 | # # user-specified reference, is tried last). 63 | # # 64 | # # Each TOML table in the "mirror" array can contain the following fields, with the same semantics 65 | # # as if specified in the [[registry]] TOML table directly: 66 | # # - location 67 | # # - insecure 68 | # [[registry.mirror]] 69 | # location = "example-mirror-0.local/mirror-for-foo" 70 | # [[registry.mirror]] 71 | # location = "example-mirror-1.local/mirrors/foo" 72 | # insecure = true 73 | # # Given the above, a pull of example.com/foo/image:latest will try: 74 | # # 1. example-mirror-0.local/mirror-for-foo/image:latest 75 | # # 2. example-mirror-1.local/mirrors/foo/image:latest 76 | # # 3. internal-registry-for-example.net/bar/image:latest 77 | # # in order, and use the first one that exists. 78 | #[[registry.mirror]] 79 | #location = "registry.service.mcserverhosting.net/docker" 80 | unqualified-search-registries = ["docker.io","quay.io","ghcr.io"] 81 | [[registry]] 82 | prefix = "docker.io" 83 | insecure = false 84 | blocked = false 85 | location = "docker.io" 86 | [[registry.mirror]] 87 | location = "registry.mcsh.red/docker" 88 | [[registry]] 89 | prefix = "registry.k8s.io" 90 | insecure = false 91 | blocked = false 92 | location = "registry.k8s.io" 93 | [[registry.mirror]] 94 | location = "registry.mcsh.red/registry-k8s-io" 95 | [[registry]] 96 | prefix = "k8s.gcr.io" 97 | insecure = false 98 | blocked = false 99 | location = "k8s.gcr.io" 100 | [[registry.mirror]] 101 | location = "registry.mcsh.red/k8s-gcr-io" 102 | [[registry]] 103 | prefix = "ghcr.io" 104 | insecure = false 105 | blocked = false 106 | location = "ghcr.io" 107 | [[registry.mirror]] 108 | location = "registry.mcsh.red/ghcr" 109 | [[registry]] 110 | prefix = "quay.io" 111 | insecure = false 112 | blocked = false 113 | location = "quay.io" 114 | [[registry.mirror]] 115 | location = "registry.mcsh.red/quay" 116 | [[registry]] 117 | prefix = "registry.gitlab.com" 118 | insecure = false 119 | blocked = false 120 | location = "registry.gitlab.com" 121 | [[registry.mirror]] 122 | location = "registry.mcsh.red/gitlab" 123 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/containers/storage.conf: -------------------------------------------------------------------------------- 1 | # This file is the configuration file for all tools 2 | # that use the containers/storage library. The storage.conf file 3 | # overrides all other storage.conf files. Container engines using the 4 | # container/storage library do not inherit fields from other storage.conf 5 | # files. 6 | # 7 | # Note: The storage.conf file overrides other storage.conf files based on this precedence: 8 | # /usr/containers/storage.conf 9 | # /etc/containers/storage.conf 10 | # $HOME/.config/containers/storage.conf 11 | # $XDG_CONFIG_HOME/containers/storage.conf (If XDG_CONFIG_HOME is set) 12 | # See man 5 containers-storage.conf for more information 13 | # The "container storage" table contains all of the server options. 14 | [storage] 15 | 16 | # Default Storage Driver, Must be set for proper operation. 17 | driver = "overlay" 18 | 19 | # Temporary storage location 20 | runroot = "/mnt/containers/runroot" 21 | 22 | # Primary Read/Write location of container storage 23 | # When changing the graphroot location on an SELINUX system, you must 24 | # ensure the labeling matches the default locations labels with the 25 | # following commands: 26 | # semanage fcontext -a -e /var/lib/containers/storage /NEWSTORAGEPATH 27 | # restorecon -R -v /NEWSTORAGEPATH 28 | graphroot = "/mnt/containers/graphroot" 29 | 30 | # Optional alternate location of image store if a location separate from the 31 | # container store is required. If set, it must be different than graphroot. 32 | imagestore = "/mnt/containers/imagestore" 33 | 34 | 35 | # Storage path for rootless users 36 | #hjx53m1 38209822345 37 | # rootless_storage_path = "$HOME/.local/share/containers/storage" 38 | 39 | # Transient store mode makes all container metadata be saved in temporary storage 40 | # (i.e. runroot above). This is faster, but doesn't persist across reboots. 41 | # Additional garbage collection must also be performed at boot-time, so this 42 | # option should remain disabled in most configurations. 43 | # transient_store = true 44 | 45 | [storage.options] 46 | # Storage options to be passed to underlying storage drivers 47 | 48 | # AdditionalImageStores is used to pass paths to additional Read/Only image stores 49 | # Must be comma separated list. 50 | additionalimagestores = [ 51 | ] 52 | 53 | # Allows specification of how storage is populated when pulling images. This 54 | # option can speed the pulling process of images compressed with format 55 | # zstd:chunked. Containers/storage looks for files within images that are being 56 | # pulled from a container registry that were previously pulled to the host. It 57 | # can copy or create a hard link to the existing file when it finds them, 58 | # eliminating the need to pull them from the container registry. These options 59 | # can deduplicate pulling of content, disk storage of content and can allow the 60 | # kernel to use less memory when running containers. 61 | 62 | # containers/storage supports four keys 63 | # * enable_partial_images="true" | "false" 64 | # Tells containers/storage to look for files previously pulled in storage 65 | # rather then always pulling them from the container registry. 66 | # * use_hard_links = "false" | "true" 67 | # Tells containers/storage to use hard links rather then create new files in 68 | # the image, if an identical file already existed in storage. 69 | # * ostree_repos = "" 70 | # Tells containers/storage where an ostree repository exists that might have 71 | # previously pulled content which can be used when attempting to avoid 72 | # pulling content from the container registry 73 | # * convert_images = "false" | "true" 74 | # If set to true, containers/storage will convert images to a 75 | # format compatible with partial pulls in order to take advantage 76 | # of local deduplication and hard linking. It is an expensive 77 | # operation so it is not enabled by default. 78 | pull_options = {convert_images = "true", enable_partial_images = "true", use_hard_links = "false", ostree_repos=""} 79 | 80 | # Remap-UIDs/GIDs is the mapping from UIDs/GIDs as they should appear inside of 81 | # a container, to the UIDs/GIDs as they should appear outside of the container, 82 | # and the length of the range of UIDs/GIDs. Additional mapped sets can be 83 | # listed and will be heeded by libraries, but there are limits to the number of 84 | # mappings which the kernel will allow when you later attempt to run a 85 | # container. 86 | # 87 | # remap-uids = "0:1668442479:65536" 88 | # remap-gids = "0:1668442479:65536" 89 | 90 | # Remap-User/Group is a user name which can be used to look up one or more UID/GID 91 | # ranges in the /etc/subuid or /etc/subgid file. Mappings are set up starting 92 | # with an in-container ID of 0 and then a host-level ID taken from the lowest 93 | # range that matches the specified name, and using the length of that range. 94 | # Additional ranges are then assigned, using the ranges which specify the 95 | # lowest host-level IDs first, to the lowest not-yet-mapped in-container ID, 96 | # until all of the entries have been used for maps. This setting overrides the 97 | # Remap-UIDs/GIDs setting. 98 | # 99 | # remap-user = "containers" 100 | # remap-group = "containers" 101 | 102 | # Root-auto-userns-user is a user name which can be used to look up one or more UID/GID 103 | # ranges in the /etc/subuid and /etc/subgid file. These ranges will be partitioned 104 | # to containers configured to create automatically a user namespace. Containers 105 | # configured to automatically create a user namespace can still overlap with containers 106 | # having an explicit mapping set. 107 | # This setting is ignored when running as rootless. 108 | # root-auto-userns-user = "storage" 109 | # 110 | # Auto-userns-min-size is the minimum size for a user namespace created automatically. 111 | # auto-userns-min-size=1024 112 | # 113 | # Auto-userns-max-size is the maximum size for a user namespace created automatically. 114 | # auto-userns-max-size=65536 115 | 116 | [storage.options.overlay] 117 | # ignore_chown_errors can be set to allow a non privileged user running with 118 | # a single UID within a user namespace to run containers. The user can pull 119 | # and use any image even those with multiple uids. Note multiple UIDs will be 120 | # squashed down to the default uid in the container. These images will have no 121 | # separation between the users in the container. Only supported for the overlay 122 | # and vfs drivers. 123 | #ignore_chown_errors = "false" 124 | 125 | # Inodes is used to set a maximum inodes of the container image. 126 | # inodes = "" 127 | 128 | # Path to an helper program to use for mounting the file system instead of mounting it 129 | # directly. 130 | #mount_program = "/usr/bin/fuse-overlayfs" 131 | 132 | # mountopt specifies comma separated list of extra mount options 133 | mountopt = "nodev" 134 | 135 | # Set to skip a PRIVATE bind mount on the storage home directory. 136 | # skip_mount_home = "false" 137 | 138 | # Set to use composefs to mount data layers with overlay. 139 | use_composefs = "true" 140 | 141 | # Size is used to set a maximum size of the container image. 142 | # size = "" 143 | 144 | # ForceMask specifies the permissions mask that is used for new files and 145 | # directories. 146 | # 147 | # The values "shared" and "private" are accepted. 148 | # Octal permission masks are also accepted. 149 | # 150 | # "": No value specified. 151 | # All files/directories, get set with the permissions identified within the 152 | # image. 153 | # "private": it is equivalent to 0700. 154 | # All files/directories get set with 0700 permissions. The owner has rwx 155 | # access to the files. No other users on the system can access the files. 156 | # This setting could be used with networked based homedirs. 157 | # "shared": it is equivalent to 0755. 158 | # The owner has rwx access to the files and everyone else can read, access 159 | # and execute them. This setting is useful for sharing containers storage 160 | # with other users. For instance have a storage owned by root but shared 161 | # to rootless users as an additional store. 162 | # NOTE: All files within the image are made readable and executable by any 163 | # user on the system. Even /etc/shadow within your image is now readable by 164 | # any user. 165 | # 166 | # OCTAL: Users can experiment with other OCTAL Permissions. 167 | # 168 | # Note: The force_mask Flag is an experimental feature, it could change in the 169 | # future. When "force_mask" is set the original permission mask is stored in 170 | # the "user.containers.override_stat" xattr and the "mount_program" option must 171 | # be specified. Mount programs like "/usr/bin/fuse-overlayfs" present the 172 | # extended attribute permissions to processes within containers rather than the 173 | # "force_mask" permissions. 174 | # 175 | # force_mask = "" 176 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/crio/crio.conf: -------------------------------------------------------------------------------- 1 | # The CRI-O configuration file specifies all of the available configuration 2 | # options and command-line flags for the crio(8) OCI Kubernetes Container Runtime 3 | # daemon, but in a TOML format that can be more easily modified and versioned. 4 | # 5 | # Please refer to crio.conf(5) for details of all configuration options. 6 | 7 | # CRI-O supports partial configuration reload during runtime, which can be 8 | # done by sending SIGHUP to the running process. Currently supported options 9 | # are explicitly mentioned with: 'This option supports live configuration 10 | # reload'. 11 | 12 | # CRI-O reads its storage defaults from the containers-storage.conf(5) file 13 | # located at /etc/containers/storage.conf. Modify this storage configuration if 14 | # you want to change the system's defaults. If you want to modify storage just 15 | # for CRI-O, you can change the storage configuration options here. 16 | [crio] 17 | 18 | # Path to the "root directory". CRI-O stores all of its data, including 19 | # containers images, in this directory. 20 | root = "/mnt/containers/root" 21 | 22 | # Path to the "run directory". CRI-O stores all of its state in this directory. 23 | runroot = "/mnt/containers/runroot" 24 | 25 | # Storage driver used to manage the storage of images and containers. Please 26 | # refer to containers-storage.conf(5) to see all available storage drivers. 27 | #storage_driver = "" 28 | 29 | # List to pass options to the storage driver. Please refer to 30 | # containers-storage.conf(5) to see all available storage options. 31 | #storage_option = [ 32 | #] 33 | 34 | # The default log directory where all logs will go unless directly specified by 35 | # the kubelet. The log directory specified must be an absolute directory. 36 | log_dir = "/mnt/containers/logs" 37 | 38 | # Location for CRI-O to lay down the temporary version file. 39 | # It is used to check if crio wipe should wipe containers, which should 40 | # always happen on a node reboot 41 | version_file = "/var/run/crio/version" 42 | 43 | # Location for CRI-O to lay down the persistent version file. 44 | # It is used to check if crio wipe should wipe images, which should 45 | # only happen when CRI-O has been upgraded 46 | version_file_persist = "/mnt/containers/version" 47 | 48 | # The crio.api table contains settings for the kubelet/gRPC interface. 49 | [crio.api] 50 | 51 | # Path to AF_LOCAL socket on which CRI-O will listen. 52 | listen = "/var/run/crio/crio.sock" 53 | 54 | # IP address on which the stream server will listen. 55 | stream_address = "127.0.0.1" 56 | 57 | # The port on which the stream server will listen. If the port is set to "0", then 58 | # CRI-O will allocate a random free port number. 59 | stream_port = "0" 60 | 61 | # Enable encrypted TLS transport of the stream server. 62 | stream_enable_tls = false 63 | 64 | # Path to the x509 certificate file used to serve the encrypted stream. This 65 | # file can change, and CRI-O will automatically pick up the changes within 5 66 | # minutes. 67 | stream_tls_cert = "" 68 | 69 | # Path to the key file used to serve the encrypted stream. This file can 70 | # change and CRI-O will automatically pick up the changes within 5 minutes. 71 | stream_tls_key = "" 72 | 73 | # Path to the x509 CA(s) file used to verify and authenticate client 74 | # communication with the encrypted stream. This file can change and CRI-O will 75 | # automatically pick up the changes within 5 minutes. 76 | stream_tls_ca = "" 77 | 78 | # Maximum grpc send message size in bytes. If not set or <=0, then CRI-O will default to 16 * 1024 * 1024. 79 | grpc_max_send_msg_size = 16777216 80 | 81 | # Maximum grpc receive message size. If not set or <= 0, then CRI-O will default to 16 * 1024 * 1024. 82 | grpc_max_recv_msg_size = 16777216 83 | 84 | # The crio.runtime table contains settings pertaining to the OCI runtime used 85 | # and options for how to set up and manage the OCI runtime. 86 | [crio.runtime] 87 | 88 | # A list of ulimits to be set in containers by default, specified as 89 | # "=:", for example: 90 | # "nofile=1024:2048" 91 | # If nothing is set here, settings will be inherited from the CRI-O daemon 92 | #default_ulimits = [ 93 | #] 94 | 95 | # If true, the runtime will not use pivot_root, but instead use MS_MOVE. 96 | no_pivot = false 97 | 98 | # decryption_keys_path is the path where the keys required for 99 | # image decryption are stored. This option supports live configuration reload. 100 | decryption_keys_path = "/mnt/crio/keys/" 101 | 102 | # Path to the conmon binary, used for monitoring the OCI runtime. 103 | # Will be searched for using $PATH if empty. 104 | conmon = "" 105 | 106 | # Cgroup setting for conmon 107 | conmon_cgroup = "system.slice" 108 | 109 | # Environment variable list for the conmon process, used for passing necessary 110 | # environment variables to conmon or the runtime. 111 | conmon_env = [ 112 | "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 113 | ] 114 | 115 | # Additional environment variables to set for all the 116 | # containers. These are overridden if set in the 117 | # container image spec or in the container runtime configuration. 118 | default_env = [ 119 | ] 120 | 121 | # If true, SELinux will be used for pod separation on the host. 122 | selinux = false 123 | 124 | # Path to the seccomp.json profile which is used as the default seccomp profile 125 | # for the runtime. If not specified, then the internal default seccomp profile 126 | # will be used. This option supports live configuration reload. 127 | seccomp_profile = "" 128 | 129 | # Changes the meaning of an empty seccomp profile. By default 130 | # (and according to CRI spec), an empty profile means unconfined. 131 | # This option tells CRI-O to treat an empty profile as the default profile, 132 | # which might increase security. 133 | seccomp_use_default_when_empty = true 134 | 135 | # Used to change the name of the default AppArmor profile of CRI-O. The default 136 | # profile name is "crio-default". This profile only takes effect if the user 137 | # does not specify a profile via the Kubernetes Pod's metadata annotation. If 138 | # the profile is set to "unconfined", then this equals to disabling AppArmor. 139 | # This option supports live configuration reload. 140 | apparmor_profile = "crio-default" 141 | 142 | # Cgroup management implementation used for the runtime. 143 | cgroup_manager = "systemd" 144 | 145 | # Specify whether the image pull must be performed in a separate cgroup. 146 | separate_pull_cgroup = "" 147 | 148 | # List of default capabilities for containers. If it is empty or commented out, 149 | # only the capabilities defined in the containers json file by the user/kube 150 | # will be added. 151 | default_capabilities = [ 152 | "CHOWN", 153 | "DAC_OVERRIDE", 154 | "FSETID", 155 | "FOWNER", 156 | "SETGID", 157 | "SETUID", 158 | "SETPCAP", 159 | "NET_BIND_SERVICE", 160 | "KILL", 161 | ] 162 | 163 | # List of default sysctls. If it is empty or commented out, only the sysctls 164 | # defined in the container json file by the user/kube will be added. 165 | default_sysctls = [ 166 | ] 167 | 168 | # List of additional devices. specified as 169 | # "::", for example: "--device=/dev/sdc:/dev/xvdc:rwm". 170 | #If it is empty or commented out, only the devices 171 | # defined in the container json file by the user/kube will be added. 172 | additional_devices = [ 173 | ] 174 | 175 | # Path to OCI hooks directories for automatically executed hooks. If one of the 176 | # directories does not exist, then CRI-O will automatically skip them. 177 | hooks_dir = [ 178 | "/usr/share/containers/oci/hooks.d", 179 | ] 180 | 181 | # Path to the file specifying the defaults mounts for each container. The 182 | # format of the config is /SRC:/DST, one mount per line. Notice that CRI-O reads 183 | # its default mounts from the following two files: 184 | # 185 | # 1) /etc/containers/mounts.conf (i.e., default_mounts_file): This is the 186 | # override file, where users can either add in their own default mounts, or 187 | # override the default mounts shipped with the package. 188 | # 189 | # 2) /usr/share/containers/mounts.conf: This is the default file read for 190 | # mounts. If you want CRI-O to read from a different, specific mounts file, 191 | # you can change the default_mounts_file. Note, if this is done, CRI-O will 192 | # only add mounts it finds in this file. 193 | # 194 | #default_mounts_file = "" 195 | 196 | # Maximum number of processes allowed in a container. 197 | pids_limit = 1024 198 | 199 | # Maximum sized allowed for the container log file. Negative numbers indicate 200 | # that no size limit is imposed. If it is positive, it must be >= 8192 to 201 | # match/exceed conmon's read buffer. The file is truncated and re-opened so the 202 | # limit is never exceeded. 203 | log_size_max = -1 204 | 205 | # Whether container output should be logged to journald in addition to the kuberentes log file 206 | log_to_journald = false 207 | 208 | # Path to directory in which container exit files are written to by conmon. 209 | container_exits_dir = "/var/run/crio/exits" 210 | 211 | # Path to directory for container attach sockets. 212 | container_attach_socket_dir = "/var/run/crio" 213 | 214 | # The prefix to use for the source of the bind mounts. 215 | bind_mount_prefix = "" 216 | 217 | # If set to true, all containers will run in read-only mode. 218 | read_only = false 219 | 220 | # Changes the verbosity of the logs based on the level it is set to. Options 221 | # are fatal, panic, error, warn, info, debug and trace. This option supports 222 | # live configuration reload. 223 | log_level = "info" 224 | 225 | # Filter the log messages by the provided regular expression. 226 | # This option supports live configuration reload. 227 | log_filter = "" 228 | 229 | # The UID mappings for the user namespace of each container. A range is 230 | # specified in the form containerUID:HostUID:Size. Multiple ranges must be 231 | # separated by comma. 232 | uid_mappings = "" 233 | 234 | # The GID mappings for the user namespace of each container. A range is 235 | # specified in the form containerGID:HostGID:Size. Multiple ranges must be 236 | # separated by comma. 237 | gid_mappings = "" 238 | 239 | # The minimal amount of time in seconds to wait before issuing a timeout 240 | # regarding the proper termination of the container. The lowest possible 241 | # value is 30s, whereas lower values are not considered by CRI-O. 242 | ctr_stop_timeout = 30 243 | 244 | # manage_ns_lifecycle determines whether we pin and remove namespaces 245 | # and manage their lifecycle. 246 | # This option is being deprecated, and will be unconditionally true in the future. 247 | manage_ns_lifecycle = true 248 | 249 | # drop_infra_ctr determines whether CRI-O drops the infra container 250 | # when a pod does not have a private PID namespace, and does not use 251 | # a kernel separating runtime (like kata). 252 | # It requires manage_ns_lifecycle to be true. 253 | drop_infra_ctr = false 254 | 255 | # The directory where the state of the managed namespaces gets tracked. 256 | # Only used when manage_ns_lifecycle is true. 257 | namespaces_dir = "/var/run" 258 | 259 | # pinns_path is the path to find the pinns binary, which is needed to manage namespace lifecycle 260 | pinns_path = "" 261 | 262 | # default_runtime is the _name_ of the OCI runtime to be used as the default. 263 | # The name is matched against the runtimes map below. If this value is changed, 264 | # the corresponding existing entry from the runtimes map below will be ignored. 265 | default_runtime = "crun" 266 | 267 | # The "crio.runtime.runtimes" table defines a list of OCI compatible runtimes. 268 | # The runtime to use is picked based on the runtime_handler provided by the CRI. 269 | # If no runtime_handler is provided, the runtime will be picked based on the level 270 | # of trust of the workload. Each entry in the table should follow the format: 271 | # 272 | #[crio.runtime.runtimes.runtime-handler] 273 | # runtime_path = "/path/to/the/executable" 274 | # runtime_type = "oci" 275 | # runtime_root = "/path/to/the/root" 276 | # privileged_without_host_devices = false 277 | # allowed_annotations = [] 278 | # Where: 279 | # - runtime-handler: name used to identify the runtime 280 | # - runtime_path (optional, string): absolute path to the runtime executable in 281 | # the host filesystem. If omitted, the runtime-handler identifier should match 282 | # the runtime executable name, and the runtime executable should be placed 283 | # in $PATH. 284 | # - runtime_type (optional, string): type of runtime, one of: "oci", "vm". If 285 | # omitted, an "oci" runtime is assumed. 286 | # - runtime_root (optional, string): root directory for storage of containers 287 | # state. 288 | # - privileged_without_host_devices (optional, bool): an option for restricting 289 | # host devices from being passed to privileged containers. 290 | # - allowed_annotations (optional, array of strings): an option for specifying 291 | # a list of experimental annotations that this runtime handler is allowed to process. 292 | # The currently recognized values are: 293 | # "io.kubernetes.cri-o.userns-mode" for configuring a user namespace for the pod. 294 | # "io.kubernetes.cri-o.Devices" for configuring devices for the pod. 295 | # "io.kubernetes.cri-o.ShmSize" for configuring the size of /dev/shm. 296 | 297 | 298 | [crio.runtime.runtimes.crun] 299 | runtime_path = "" 300 | runtime_type = "oci" 301 | runtime_root = "/run/crun" 302 | 303 | [crio.runtime.runtimes.nvidia] 304 | runtime_path = "/usr/bin/nvidia-container-runtime" 305 | runtime_type = "oci" 306 | 307 | [crio.runtime.runtimes.runsc] 308 | runtime_path = "/usr/local/bin/runsc" 309 | runtime_type = "oci" 310 | 311 | # crun is a fast and lightweight fully featured OCI runtime and C library for 312 | # running containers 313 | #[crio.runtime.runtimes.crun] 314 | 315 | # Kata Containers is an OCI runtime, where containers are run inside lightweight 316 | # VMs. Kata provides additional isolation towards the host, minimizing the host attack 317 | # surface and mitigating the consequences of containers breakout. 318 | 319 | # Kata Containers with the default configured VMM 320 | #[crio.runtime.runtimes.kata-runtime] 321 | 322 | # Kata Containers with the QEMU VMM 323 | #[crio.runtime.runtimes.kata-qemu] 324 | 325 | # Kata Containers with the Firecracker VMM 326 | #[crio.runtime.runtimes.kata-fc] 327 | 328 | # The crio.image table contains settings pertaining to the management of OCI images. 329 | # 330 | # CRI-O reads its configured registries defaults from the system wide 331 | # containers-registries.conf(5) located in /etc/containers/registries.conf. If 332 | # you want to modify just CRI-O, you can change the registries configuration in 333 | # this file. Otherwise, leave insecure_registries and registries commented out to 334 | # use the system's defaults from /etc/containers/registries.conf. 335 | [crio.image] 336 | 337 | # Default transport for pulling images from a remote container storage. 338 | default_transport = "docker://" 339 | 340 | # The path to a file containing credentials necessary for pulling images from 341 | # secure registries. The file is similar to that of /var/lib/kubelet/config.json 342 | global_auth_file = "" 343 | 344 | # The image used to instantiate infra containers. 345 | # This option supports live configuration reload. 346 | # pause_image = "k8s.gcr.io/pause:3.2" 347 | 348 | # The path to a file containing credentials specific for pulling the pause_image from 349 | # above. The file is similar to that of /var/lib/kubelet/config.json 350 | # This option supports live configuration reload. 351 | pause_image_auth_file = "" 352 | 353 | # The command to run to have a container stay in the paused state. 354 | # When explicitly set to "", it will fallback to the entrypoint and command 355 | # specified in the pause image. When commented out, it will fallback to the 356 | # default: "/pause". This option supports live configuration reload. 357 | pause_command = "/pause" 358 | 359 | # Path to the file which decides what sort of policy we use when deciding 360 | # whether or not to trust an image that we've pulled. It is not recommended that 361 | # this option be used, as the default behavior of using the system-wide default 362 | # policy (i.e., /etc/containers/policy.json) is most often preferred. Please 363 | # refer to containers-policy.json(5) for more details. 364 | signature_policy = "" 365 | 366 | # List of registries to skip TLS verification for pulling images. Please 367 | # consider configuring the registries via /etc/containers/registries.conf before 368 | # changing them here. 369 | #insecure_registries = "[]" 370 | 371 | # Controls how image volumes are handled. The valid values are mkdir, bind and 372 | # ignore; the latter will ignore volumes entirely. 373 | image_volumes = "mkdir" 374 | 375 | # List of registries to be used when pulling an unqualified image (e.g., 376 | # "alpine:latest"). By default, registries is set to "docker.io" for 377 | # compatibility reasons. Depending on your workload and usecase you may add more 378 | # registries (e.g., "quay.io", "registry.fedoraproject.org", 379 | # "registry.opensuse.org", etc.). 380 | #registries = [ 381 | # ] 382 | 383 | # Temporary directory to use for storing big files 384 | big_files_temporary_dir = "/mnt/containers/big" 385 | 386 | # The crio.network table containers settings pertaining to the management of 387 | # CNI plugins. 388 | [crio.network] 389 | 390 | # The default CNI network name to be selected. If not set or "", then 391 | # CRI-O will pick-up the first one found in network_dir. 392 | # cni_default_network = "" 393 | 394 | # Path to the directory where CNI configuration files are located. 395 | network_dir = "/etc/cni/net.d/" 396 | 397 | # Paths to directories where CNI plugin binaries are located. 398 | plugin_dirs = [ 399 | "/opt/cni/bin/", 400 | "/usr/lib/cni/", 401 | ] 402 | 403 | # A necessary configuration for Prometheus based metrics retrieval 404 | [crio.metrics] 405 | 406 | # Globally enable or disable metrics support. 407 | enable_metrics = true 408 | 409 | # The port on which the metrics server will listen. 410 | metrics_port = 9090 411 | 412 | # Local socket path to bind the metrics server to 413 | metrics_socket = "" 414 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/kubeadm/kubeadm.conf.yaml.template: -------------------------------------------------------------------------------- 1 | apiVersion: kubeadm.k8s.io/v1beta3 2 | kind: JoinConfiguration 3 | nodeRegistration: 4 | name: ephemeral-$UUID 5 | taints: [] 6 | kubeletExtraArgs: 7 | resolv-conf: /etc/resolv.conf 8 | name: "ephemeral-${UUID}" 9 | cgroup-driver: systemd 10 | node-labels: "{{NODE_LABELS}}" 11 | cpu-manager-policy: static 12 | memory-manager-policy: Static 13 | reserved-cpus: "0" 14 | kube-reserved: "cpu=1,memory=4Gi" 15 | system-reserved: "cpu=1,memory=2Gi" 16 | # reserved-memory: "0:memory=4196Mi,hugepages-1M=2Gi" 17 | fail-swap-on: "false" 18 | max-pods: "220" 19 | seccomp-default: "true" 20 | feature-gates: "SeccompDefault=true,NodeSwap=true" 21 | root-dir: /mnt/kubelet 22 | discovery: 23 | bootstrapToken: 24 | token: {{TOKEN}} 25 | apiServerEndpoint: {{API_ADDRESS}} 26 | caCertHashes: 27 | - {{CERT_HASH}} 28 | 29 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/locale.conf: -------------------------------------------------------------------------------- 1 | LANG=C.UTF-8 2 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/localtime: -------------------------------------------------------------------------------- 1 | TZif2UTCTZif2UTC 2 | UTC0 -------------------------------------------------------------------------------- /baseline/airootfs/etc/mkinitcpio.conf: -------------------------------------------------------------------------------- 1 | # vim:set ft=sh 2 | # MODULES 3 | # The following modules are loaded before any boot hooks are 4 | # run. Advanced users may wish to specify all system modules 5 | # in this array. For instance: 6 | # MODULES=(piix ide_disk reiserfs) 7 | MODULES=() 8 | 9 | # BINARIES 10 | # This setting includes any additional binaries a given user may 11 | # wish into the CPIO image. This is run last, so it may be used to 12 | # override the actual binaries included by a given hook 13 | # BINARIES are dependency parsed, so you may safely ignore libraries 14 | BINARIES=() 15 | 16 | # FILES 17 | # This setting is similar to BINARIES above, however, files are added 18 | # as-is and are not parsed in any way. This is useful for config files. 19 | FILES=() 20 | 21 | # HOOKS 22 | # This is the most important setting in this file. The HOOKS control the 23 | # modules and scripts added to the image, and what happens at boot time. 24 | # Order is important, and it is recommended that you do not change the 25 | # order in which HOOKS are added. Run 'mkinitcpio -H ' for 26 | # help on a given hook. 27 | # 'base' is _required_ unless you know precisely what you are doing. 28 | # 'udev' is _required_ in order to automatically load modules 29 | # 'filesystems' is _required_ unless you specify your fs modules in MODULES 30 | # Examples: 31 | ## This setup specifies all modules in the MODULES setting above. 32 | ## No raid, lvm2, or encrypted root is needed. 33 | # HOOKS=(base) 34 | # 35 | ## This setup will autodetect all modules for your system and should 36 | ## work as a sane default 37 | # HOOKS=(base udev autodetect block filesystems) 38 | # 39 | ## This setup will generate a 'full' image which supports most systems. 40 | ## No autodetection is done. 41 | # HOOKS=(base udev block filesystems) 42 | # 43 | ## This setup assembles a pata mdadm array with an encrypted root FS. 44 | ## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. 45 | # HOOKS=(base udev block mdadm encrypt filesystems) 46 | # 47 | ## This setup loads an lvm2 volume group on a usb device. 48 | # HOOKS=(base udev block lvm2 filesystems) 49 | # 50 | ## NOTE: If you have /usr on a separate partition, you MUST include the 51 | # usr, fsck and shutdown hooks. 52 | HOOKS=(base udev modconf archiso block filesystems) 53 | 54 | # COMPRESSION 55 | # Use this to compress the initramfs image. By default, gzip compression 56 | # is used. Use 'cat' to create an uncompressed image. 57 | #COMPRESSION="gzip" 58 | #COMPRESSION="bzip2" 59 | #COMPRESSION="lzma" 60 | #COMPRESSION="xz" 61 | #COMPRESSION="lzop" 62 | #COMPRESSION="lz4" 63 | #COMPRESSION="zstd" 64 | 65 | # COMPRESSION_OPTIONS 66 | # Additional options for the compressor 67 | #COMPRESSION_OPTIONS=() 68 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/mkinitcpio.d/linux.preset.template: -------------------------------------------------------------------------------- 1 | # mkinitcpio preset file for the 'linux' package on archiso 2 | 3 | PRESETS=('archiso') 4 | 5 | ALL_kver='/boot/vmlinuz-{{LINUX}}' 6 | ALL_config='/etc/mkinitcpio.conf' 7 | 8 | archiso_image="/boot/initramfs-{{LINUX}}.img" 9 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/ntp.conf: -------------------------------------------------------------------------------- 1 | driftfile /var/lib/ntp/ntp.drift 2 | server {{NTP_SERVER_IP}} 3 | 4 | broadcastclient 5 | disable auth 6 | 7 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 1.1.1.1 -------------------------------------------------------------------------------- /baseline/airootfs/etc/shadow: -------------------------------------------------------------------------------- 1 | root::14871:::::: 2 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system-generators/systemd-gpt-auto-generator: -------------------------------------------------------------------------------- 1 | /dev/null -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service/NetworkManager-dispatcher.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/NetworkManager-dispatcher.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | ExecStart= 3 | ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root - $TERM 4 | -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/NetworkManager.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/NetworkManager.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_fcopy_daemon.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/hv_fcopy_daemon.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_kvp_daemon.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/hv_kvp_daemon.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/hv_vss_daemon.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/hv_vss_daemon.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/ntpd.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/ntpd.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/run-at-startup.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/run-at-startup.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/vboxservice.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/vboxservice.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/vmtoolsd.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/vmtoolsd.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/multi-user.target.wants/vmware-vmblock-fuse.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/vmware-vmblock-fuse.service -------------------------------------------------------------------------------- /baseline/airootfs/etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/NetworkManager-wait-online.service -------------------------------------------------------------------------------- /baseline/airootfs/root/.ssh/authorized_keys: -------------------------------------------------------------------------------- 1 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK6er0YDGJXizLIjUFvFNRurRpNZHplLxHv8Z5o71hHq 2 | sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIDV5Ufjh1TZiecx6xBKHOf+e5t90uQqqH3pPB3LUYXyMAAAABHNzaDo= 3 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDpRv5NGJOnXMYxBVFeFNH7R4ZtBfBzn5mbSi374Wd0p 4 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQClkzLg2Ne65k8/Nuhj6PbrhUSEZxRbw3tkB0lkzNCtHivDu5v9eCUIkEY7e4zvyO5efa2Tc9H/FPkau75AjhiIXD59ymrPKEVROmdPEQIGCSS9pclmnzBDIv6Y5ahqmmXCT1oxfzBlny3TsdnBvOHdW8ADeKJDAmwu22QXKgHYrWgl8KhVPINaaG89+ndQKuEUUtr2T5yMIAnLAHLU1vMbaeGk/jf3IE88ZzhzU4138J/VSdxVBDhHpU68I7mp82+IlclbusTfTe0qNWUdgaf5sitkEHcyDyoN8T3ROkpDbCXw961nG7v3NySn49xrQ+/HKuzDMFHdTfgbZjOssPBi4EsPHXZeYa+YaRoMSlqPQt25FIrOrk9CVF6qRIhHfSmGiaxW1XC55JAHuhUBYtNYbS6ZQifc1iuU/SEa09JJWYs0V18F9Hz9D7qdkxZmm+6IkBvNhoM/AGflMb8k9mLRpvEq65D6+7N7uMspODK4+kKZJxd+JE0rg/AylbDOeHc= 5 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDmSrth7xlxUVEJCODuaepprZmTXuThzWQXoovvStcsC4NSC9TmGh3m4vcS3DSrmudGvxAFt+VAe3b4deVYyg5q8rDs6IuLr6jGdmhpiGPLhW96YEZwP6AlIhcp3npFM5+nk+ImD1Xd6q222oSlL+MwCLZsy8YDB60Ho0tQiOB9uN99+uO7NH3vpUlvuza97QMAts21vL2SeE6CnQf+pBo9HE5WVhPi+aPRhA2crA/HukH0Q9zuUxDddJc+ZeCsB+bstnpM9y7hLlG4ADkrTRRLAaGcCARREERRPY5pMR6E22Sv2TRh+mVfLW/JEXO2zvWZ0Ifx99WTr0oWHRUI+ZPFLIaTlAxLhqvYXev6GQc6K53Hi3os8ckr8/uSACgXOfcml+3V5st45B+4rkFGi1MiON9maAmgNpjhm9fkZdHRuIG+v1lwnlQOuEf78KznF/jQcJePkYHpperrYrw7hUirooMkwx6AeetP5rOfthg3CZNXp+0AZLNLARikjMJiM98= 6 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOowo6Y5K3VWIeaYdDi2RWQ/+LN+avmex1lNp90r9EMc 7 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID4gPS+t6IO3xK+QzYUNKY0F88O6RT5UNJiqN38KQJgz 8 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC/ide6avZ2nxv5AiOFLWytXGb0k2qUzhYQTpKcR1gC409ZugC0fP88pl5JAM5ru2I3YGLr1dddv6FvzvBzrTsncwI0YGL08nGul+o1Mkg0UfArXAhgO/SNcfc/wdEctmggBqkFkKRtSNbtNpYOTBA/D8p7gtw4WhR+DHAKHnLb1CUSxVoalw9QJcjGlg1X5I6/qCQ6RSBJSvWV/7YrKku3pIi5rqih0qGAzoMkzzTjfpQnGQ7F2CD8DzdmYNT69K8hIRBSH2RMIiIS2fhfrZYn0fom5UCn8S91AhImjcmp3BTYdE5cWKVOR4aqRo4saL0INHetkY54NoWIZOA4cDxpjl3GAprKNXhDnmlU2s4u3nfN83z2bj87iX9j7CDSekktk7nn2dQXiMHt4sMPSeguXMtalARIpz03lqGmAzZVhA96LAC1JdvM9TaByR9GRgtm4H9MncvckEEqvDNQOaLV/vNQ3tXFC5lKknArmWS94/O3n9Z8FNSXT82jy+r/TQE= 9 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDB5A4v7DGDFvVuXQ9kFoAgrY9pJfWoepqh/gQDqacfbxQ3sowQEHdVnANQ8MDC1e6zJess0uregb51yM6jZJtJl+KA62eBJYPV0iHe2uf8DxiKhx1V9C8rPunGNVOntZEREAlLGdg1FOyq3C16TGvm12a9YZX3M+15+nkfrYVGMVnyJCAp8mave32ON9q+lD1pmFrobDjg3MPiXsGDyYYwZQV6M6VacNQSUWDXTZYUDaxT7p85V2zhxOHvNwhNuFhrREoxl+dB7NRFDcpM4/l7ualKnumeBjflnb+wViLQIs7YLKvZbWCENkN6VY5AEIIzC40AAP+1sMV9bKpSotM4vnIXcnS/tQQUt3NgidlB2ZaHfzJrmksDFP/dlUTusFYTO3RYUjDXKEbfzZbtgTH7KDXLxWK3+gsFT6w6BOq9XEVpw+M3KxbaUD3tYTY0y7FV9GjS9YiiPSmEXYdoDyaw+Rtc7fZO2A3s6FGd73ndqLAmojd1Hh3wdFIOcTvmpqE= 10 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDB0Rw+aMWPzuKe+UcRrzTevpunGVvZDFEZJ7OMH8clCxaQ/0p1FyshYqGjfj9i9Lbsptg0ThLu8j+Ylv+/ZU8q4yTV8/Iz5DLIkdlfp+uiGpYy583i/DIW8oL+afYVrAZZCAIcpK5nq/RslEfDJxkezyNYoWR5/sxuDrBlj4krsjTKkv8vF2yD+Q0MJZgf9khHcVwKc4dyct1ZYyZlkglGYSm30BlW4GdEbFiJrs4Kicmt0vCa98YAPzV9GQLFuAhnf9BE7TVG5/8jvXqqj0QT0fdjOQzLYQnDQE6S0CxuRg3r5ItCS7LArseZ/MVvx81nQhXZKpD/FjFFrCo8o1fg+CejuJf7/QahkTFUthY6UeyNPm5wYjsRNIiyh5lvUxE5602M6/fiqAOuLmFkb5pdpv9qtlaio+sQAjVQa8/RsqPDxnM07Qfuh5SY+bnbcrqQT8vb/TEJsG4kvBWfSUMiyDXAc28bYdRQEacD+NVOHRFt6h+VLN7M6oolLp5f2XU= 11 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDaijUgmUIjpvsvluuomrHYhtw9RDjnhp/1YVwN04OoC 12 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDiRsYos9zczmo4vW1Qd8IOIEAHsGdQersKM7DlE2hkjgqvPwsDUzhtMcIj/fyhQbXkV4W2MMfm6Gp4wS9D6TsmMRLf/eiwDpF+pNYSck4cJUff+/YdF92gCPKk6rBoVMybWjFVwppAfUn6qovrRvAiwVNkyRW72EnV9ruXYp1ScOkJLCU4BdAskP7SIHcyS0xOVC0PJyJzf/U9NfXd6LPYldxB9wEFqX5jfWrFnVzp60z44joxPXH0sQvmndPGqg+pPMcGOlHD3vbJB705+sDQcQt7yvVyKzXbQ1AQm9qYQnQFj8KeKfK7EQQZJCtO58xY5EvesE87X1j6D/J9DWYvm1Q/cN7wR6/j3vEc/KuZi2wYiPrfPOFZMf3l7ARNc7QirG+gac8SyXnfosMdwQNvLThYXMCMFi29u4WhZ1SGAepTHcHPRmykbSGRiBjPDrqGK4vucLfYFneQYSbaN6qw1zvXgEqgf+3OBJ8R6MG1bzKaTszxMmAqoWekcBWdQAE= 13 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPsCzyU2uJGfL5dk+qHO5oWHI+8enWjRjKr45lAAEIBC 14 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPMz4X3ScgO7JWrf1AgbZktNKbExfyrBfqG83PQCtk5M 15 | -------------------------------------------------------------------------------- /baseline/airootfs/root/init.sh.template: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | #ENABLE_SSH 5 | echo "[INFO] Initializing the script. Enabling sshd service." 6 | systemctl enable --now sshd 7 | sleep 20s 8 | 9 | # Check if placeholders are present in kubeadm.conf.yaml 10 | if grep -q '{{TOKEN}}' /etc/kubeadm/kubeadm.conf.yaml; then 11 | echo "[INFO] Placeholders detected in kubeadm.conf.yaml. Getting from k8s.lan." 12 | 13 | # Base URL for API server 14 | BASE_URL="http://k8s.lan" 15 | 16 | # Fetching each file and storing its contents in a variable 17 | API_ADDRESS=$(curl -s "${BASE_URL}/apiServerEndpoint") 18 | CERT_HASH=$(curl -s "${BASE_URL}/certHash") 19 | TOKEN=$(curl -s "${BASE_URL}/token") 20 | 21 | echo "[INFO] TOKEN: $TOKEN" 22 | echo "[INFO] CERT_HASH: $CERT_HASH" 23 | echo "[INFO] API_ADDRESS: $API_ADDRESS" 24 | 25 | # If any of the variables are empty, exit with an error 26 | if [ -z "$TOKEN" ] || [ -z "$CERT_HASH" ] || [ -z "$API_ADDRESS" ]; then 27 | echo "[ERROR] Missing cluster options. Exiting." 28 | exit 1 29 | fi 30 | 31 | # Replace placeholders in kubeadm.conf.yaml 32 | sed -i "s|\${TOKEN}|$TOKEN|g" /etc/kubeadm/kubeadm.conf.yaml 33 | sed -i "s|\${CERT_HASH}|$CERT_HASH|g" /etc/kubeadm/kubeadm.conf.yaml 34 | sed -i "s|\${API_ADDRESS}|$API_ADDRESS|g" /etc/kubeadm/kubeadm.conf.yaml 35 | else 36 | echo "[INFO] No placeholders in kubeadm.conf.yaml. Skipping DHCP option extraction." 37 | fi 38 | 39 | 40 | # Define a list of candidate disks to use 41 | candidate_disks="/dev/nvme0n1 /dev/sda /dev/vda" 42 | 43 | # Function to check if a disk is empty (no partitions) 44 | is_disk_empty() { 45 | local disk="$1" 46 | echo "[INFO] Checking if $disk is empty." 47 | 48 | local partition_count 49 | partition_count=$(parted --script "$disk" print | grep -c '^Number') 50 | 51 | [ "$partition_count" -eq 0 ] 52 | } 53 | 54 | # Function to wipe and format a disk 55 | wipe_and_format_disk() { 56 | local disk="$1" 57 | echo "[INFO] Wiping and formatting disk: $disk." 58 | 59 | sgdisk --zap-all "$disk" 60 | if [ "$(basename "$disk")" = "nvme0n1" ]; then 61 | blkdiscard "$disk" 62 | else 63 | dd if=/dev/zero of="$disk" bs=1M count=100 oflag=direct,dsync 64 | fi 65 | 66 | mkfs.ext4 "$disk" 67 | } 68 | 69 | # Iterate through the candidate disks 70 | for disk in $candidate_disks; do 71 | # Check if the disk exists 72 | if lsblk "$disk" >/dev/null 2>&1; then 73 | # Check if the disk is empty 74 | if is_disk_empty "$disk"; then 75 | echo "[INFO] Disk $disk is empty. Proceeding to wipe and format it." 76 | wipe_and_format_disk "$disk" 77 | export DISK="$disk" 78 | break 79 | else 80 | echo "[INFO] Disk $disk is not empty. Using it as a mount." 81 | export DISK="$disk" 82 | break 83 | fi 84 | fi 85 | done 86 | 87 | # If no suitable disk was found, use a ramdisk 88 | if [ -z "$DISK" ]; then 89 | echo "[WARN] No disk device found. Using a ramdisk. Assuming at least 32G of memory available." 90 | # Use half of the available memory, up to 16G 91 | MEM_AVAILABLE=$(grep MemTotal /proc/meminfo | awk '{print $2}') 92 | MEM_AVAILABLE_MB=$((MEM_AVAILABLE / 1024)) 93 | DISK_SIZE_MB=$((MEM_AVAILABLE_MB / 2)) 94 | if [ "$DISK_SIZE_MB" -gt 16384 ]; then 95 | DISK_SIZE_MB=16384 96 | fi 97 | modprobe zram num_devices=1 98 | echo "${DISK_SIZE_MB}M" > /sys/block/zram0/disksize 99 | export DISK=/dev/zram0 100 | mkfs.ext4 "$DISK" 101 | fi 102 | 103 | # Mount the disk to /mnt and /var/lib/kubelet 104 | mount "$DISK" /mnt 105 | mkdir -p /mnt/containers/runroot 106 | mkdir -p /mnt/containers/graphroot 107 | mkdir -p /mnt/containers/imagestore 108 | mkdir -p /mnt/containers/localstore 109 | mkdir -p /mnt/containers/root 110 | mkdir -p /mnt/containers/runroot 111 | mkdir -p /mnt/containers/big 112 | mkdir -p /mnt/crio/keys 113 | mkdir -p /mnt/kubelet 114 | 115 | echo "[INFO] Disk mounted to /mnt" 116 | 117 | export UUID=$(cat /etc/machine-id) 118 | 119 | # Load Kernel modules 120 | # The modprobe commands will be injected here by the Makefile 121 | 122 | echo '1' > /proc/sys/net/ipv4/ip_forward 123 | 124 | systemctl enable --now iscsid 125 | systemctl enable --now crio 126 | systemctl enable --now kubelet 127 | 128 | # Prepare kubeadm configuration 129 | cat < /etc/kubeadm/kubeadm.conf.yaml 130 | apiVersion: kubeadm.k8s.io/v1beta3 131 | kind: JoinConfiguration 132 | discovery: 133 | bootstrapToken: 134 | token: ${TOKEN} 135 | apiServerEndpoint: ${API_ADDRESS} 136 | caCertHashes: 137 | - ${CERT_HASH} 138 | nodeRegistration: 139 | name: "ephemeral-${UUID}" 140 | kubeletExtraArgs: 141 | node-labels: "net.mcserverhosting.node/ephemeral=true,kubernetes.io/os=MCSH" 142 | EOF 143 | 144 | echo "[INFO] Joining Kubernetes cluster." 145 | kubeadm join --config /etc/kubeadm/kubeadm.conf.yaml --v=5 146 | 147 | echo "[INFO] Kubernetes join operation complete." 148 | -------------------------------------------------------------------------------- /baseline/airootfs/usr/lib/systemd/system/run-at-startup.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Run script at startup 3 | 4 | [Service] 5 | Type=simple 6 | RemainAfterExit=yes 7 | ExecStart=/root/init.sh 8 | TimeoutStartSec=0 9 | 10 | [Install] 11 | WantedBy=default.target 12 | -------------------------------------------------------------------------------- /baseline/bootstrap_packages.x86_64: -------------------------------------------------------------------------------- 1 | arch-install-scripts 2 | base 3 | -------------------------------------------------------------------------------- /baseline/efiboot/loader/entries/01-archiso-x86_64-linux.conf.template: -------------------------------------------------------------------------------- 1 | title Arch Linux (x86_64, UEFI) 2 | linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-{{LINUX}} 3 | initrd /%INSTALL_DIR%/boot/x86_64/initramfs-{{LINUX}}.img 4 | options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% cow_spacesize=4G systemd.firstboot=off 5 | -------------------------------------------------------------------------------- /baseline/efiboot/loader/entries/02-archiso-x86_64-ram-linux.conf.template: -------------------------------------------------------------------------------- 1 | title Arch Linux (x86_64, UEFI) Copy to RAM 2 | linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-{{LINUX}} 3 | initrd /%INSTALL_DIR%/boot/x86_64/initramfs-{{LINUX}}.img 4 | options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% cow_spacesize=4G systemd.firstboot=off copytoram 5 | -------------------------------------------------------------------------------- /baseline/efiboot/loader/loader.conf: -------------------------------------------------------------------------------- 1 | timeout 3 2 | default 01-archiso-x86_64-linux.conf 3 | -------------------------------------------------------------------------------- /baseline/grub/grub.cfg.template: -------------------------------------------------------------------------------- 1 | # Load partition table and file system modules 2 | insmod part_gpt 3 | insmod part_msdos 4 | insmod fat 5 | insmod iso9660 6 | 7 | # Use graphics-mode output 8 | insmod all_video 9 | insmod font 10 | if loadfont "${prefix}/fonts/unicode.pf2" ; then 11 | insmod gfxterm 12 | set gfxmode="auto" 13 | terminal_input console 14 | terminal_output gfxterm 15 | fi 16 | 17 | # Enable serial console 18 | if serial --unit=0 --speed=115200; then 19 | terminal_input --append serial 20 | terminal_output --append serial 21 | fi 22 | 23 | # Set default menu entry 24 | default=mcshram 25 | timeout=3 26 | timeout_style=menu 27 | 28 | 29 | # Menu entries 30 | 31 | menuentry "MCSH Kubernetes" --class arch --class gnu-linux --class gnu --class os --id 'mcsh' { 32 | set gfxpayload=keep 33 | search --no-floppy --set=root --label %ARCHISO_LABEL% 34 | linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-{{LINUX}} archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% cow_spacesize=2G systemd.firstboot=off modprobe.blacklist=nouveau 35 | initrd /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-{{LINUX}}.img 36 | } 37 | 38 | menuentry "MCSH Kubernetes Copy to RAM" --class arch --class gnu-linux --class gnu --class os --id 'mcshram' { 39 | set gfxpayload=keep 40 | search --no-floppy --set=root --label %ARCHISO_LABEL% 41 | linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-{{LINUX}} archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% cow_spacesize=2G systemd.firstboot=off copytoram modprobe.blacklist=nouveau 42 | initrd /%INSTALL_DIR%/boot/amd-ucode.img /%INSTALL_DIR%/boot/intel-ucode.img /%INSTALL_DIR%/boot/x86_64/initramfs-{{LINUX}}.img 43 | } 44 | -------------------------------------------------------------------------------- /baseline/packages.x86_64.template: -------------------------------------------------------------------------------- 1 | base 2 | ${LINUX} 3 | ${LINUX}-headers 4 | mkinitcpio 5 | mkinitcpio-archiso 6 | pv 7 | syslinux 8 | grub 9 | edk2-shell 10 | amd-ucode 11 | intel-ucode 12 | kubelet 13 | kubeadm 14 | cri-o 15 | util-linux 16 | crun 17 | networkmanager 18 | gdisk 19 | ntp 20 | moreutils 21 | lvm2 22 | parted 23 | nbd 24 | avahi 25 | nss-mdns 26 | open-iscsi 27 | xfsprogs 28 | composefs 29 | ${UNIX_TOOLS} 30 | ${NVIDIA_PACKAGES} 31 | ${AMD_PACKAGES} 32 | -------------------------------------------------------------------------------- /baseline/pacman.conf.template: -------------------------------------------------------------------------------- 1 | [options] 2 | HoldPkg = pacman glibc 3 | Architecture = auto 4 | ParallelDownloads = 15 5 | 6 | SigLevel = Required DatabaseOptional 7 | LocalFileSigLevel = Optional 8 | 9 | [core-{{FEATURE_LEVEL}}] 10 | Server = https://alhp.krautflare.de/$repo/os/$arch/ 11 | 12 | [core] 13 | Include = /etc/pacman.d/mirrorlist 14 | 15 | [extra-{{FEATURE_LEVEL}}] 16 | Server = https://alhp.krautflare.de/$repo/os/$arch/ 17 | 18 | [extra] 19 | Include = /etc/pacman.d/mirrorlist 20 | 21 | [community] 22 | Include = /etc/pacman.d/mirrorlist 23 | 24 | [multilib-{{FEATURE_LEVEL}}] 25 | Server = https://alhp.krautflare.de/$repo/os/$arch/ 26 | 27 | [multilib] 28 | Include = /etc/pacman.d/mirrorlist -------------------------------------------------------------------------------- /baseline/profiledef.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC2034 3 | 4 | iso_name="archlinux-baseline" 5 | iso_label="ARCH_$(date +%Y%m)" 6 | iso_publisher="MC Server Hosting LLC " 7 | iso_application="Arch Linux baseline" 8 | iso_version="$(date +%Y.%m.%d)" 9 | install_dir="arch" 10 | buildmodes=('iso') 11 | bootmodes=('bios.syslinux.mbr' 'bios.syslinux.eltorito' 12 | 'uefi-ia32.grub.esp' 'uefi-x64.grub.esp' 13 | 'uefi-ia32.grub.eltorito' 'uefi-x64.grub.eltorito') 14 | arch="x86_64" 15 | pacman_conf="pacman.conf" 16 | airootfs_image_type="squashfs" 17 | #airootfs_image_tool_options=('-b 1M' '-comp xz') 18 | file_permissions=( 19 | ["/etc/shadow"]="0:0:400" 20 | ["/root/init.sh"]="0:0:755" 21 | ["/root/.ssh"]="0:0:700" 22 | ) 23 | -------------------------------------------------------------------------------- /baseline/syslinux/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcserverhosting-net/OS/b268ff45cba1d71f6db9cea544033969c6473139/baseline/syslinux/splash.png -------------------------------------------------------------------------------- /baseline/syslinux/syslinux-linux.cfg.template: -------------------------------------------------------------------------------- 1 | LABEL mcsh 2 | MENU LABEL MCSH Kubernetes 3 | LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-{{LINUX}} 4 | INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-{{LINUX}}.img 5 | APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% cow_spacesize=4G systemd.firstboot=off modprobe.blacklist=nouveau 6 | 7 | LABEL mcshram 8 | MENU LABEL MCSH Kubernetes Copy to RAM 9 | LINUX /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-{{LINUX}} 10 | INITRD /%INSTALL_DIR%/boot/%ARCH%/initramfs-{{LINUX}}.img 11 | APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% cow_spacesize=4G systemd.firstboot=off copytoram modprobe.blacklist=nouveau 12 | -------------------------------------------------------------------------------- /baseline/syslinux/syslinux.cfg: -------------------------------------------------------------------------------- 1 | SERIAL 0 115200 2 | UI vesamenu.c32 3 | MENU TITLE MCSH Kubernetes 4 | MENU RESOLUTION 640 480 5 | MENU BACKGROUND splash.png 6 | MENU CLEAR 7 | 8 | DEFAULT mcshram 9 | TIMEOUT 30 10 | 11 | INCLUDE syslinux-linux.cfg 12 | --------------------------------------------------------------------------------