Compare commits
7 Commits
92d3e8c147
...
feat/flatc
Author | SHA1 | Date | |
---|---|---|---|
6435d0e844 | |||
41f93fcf15 | |||
ead6298aa7 | |||
d2562a66df | |||
d2929a2514 | |||
3331d82d1a | |||
3c95ccb97c |
9
Makefile
Normal file
9
Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
SHELL := /bin/bash
|
||||||
|
|
||||||
|
apk:
|
||||||
|
nfpm package -p apk
|
||||||
|
deb:
|
||||||
|
nfpm package -p deb
|
||||||
|
rpm:
|
||||||
|
nfpm package -p rpm
|
||||||
|
|
5
butane/ckube-install
Normal file
5
butane/ckube-install
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
target=$(xargs -n1 -a /proc/cmdline | awk -F '=' '/^flatcar.target=.*/ {print $NF}')
|
||||||
|
|
||||||
|
flatcar-install -d ${target} -i /opt/ignition.json && udevadm settle && systemctl reboot
|
@ -21,23 +21,16 @@ systemd:
|
|||||||
Type=forking
|
Type=forking
|
||||||
TimeoutStartSec=600
|
TimeoutStartSec=600
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=/usr/bin/sh -c "flatcar-install -d /dev/vda -i /opt/ignition.json && udevadm settle && systemctl reboot"
|
ExecStart=/usr/bin/sh -c "/opt/ckube-install"
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
storage:
|
storage:
|
||||||
disks:
|
|
||||||
- device: /dev/vda
|
|
||||||
wipe_table: true
|
|
||||||
partitions:
|
|
||||||
- label: ROOT
|
|
||||||
filesystems:
|
|
||||||
- path: /
|
|
||||||
device: /dev/disk/by-partlabel/ROOT
|
|
||||||
format: btrfs
|
|
||||||
wipe_filesystem: true
|
|
||||||
label: ROOT
|
|
||||||
files:
|
files:
|
||||||
- path: /opt/ignition.json
|
- path: /opt/ignition.json
|
||||||
mode: 0700
|
mode: 0700
|
||||||
contents:
|
contents:
|
||||||
source: http://192.168.40.3/leader.json
|
source: http://192.168.40.3/leader.json
|
||||||
|
- path: /opt/ckube-install
|
||||||
|
mode: 0700
|
||||||
|
contents:
|
||||||
|
source: http://192.168.40.3/ckube-install
|
@ -1 +1,47 @@
|
|||||||
{"ignition":{"version":"3.3.0"},"passwd":{"users":[{"groups":["wheel","sudo"],"name":"cadoles","passwordHash":"$y$j9T$7dNoyJBSiQ5dJ6.kLs17I0$G9VVQkBUddW2E6TVQchecSE94jNxLz4F3wguz5QkvD8","sshAuthorizedKeys":["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDDph3zh6ojSvH44k13z9B6xj+Hargo3uzkxnYv5s5NI4yagNuBXEc3aS++KdocND+FtVfLK+iVE8qHo2bvmpMmVkqU6WU2apN7DfIP0QGLlSGeo+UOZ9hGeEDlgVO4AOnZKZ5kPGBEPZ84JXuE9CmhKfwEVCK8w3B8XQttA8alFl4A4/4F14x2w4njsSLY1H3b0qah7hgYKU5zHIGLg8Lxx+1BxGIF0l5n5m5rqAskRNaF+aYbs0CcWHv49bPK0sJJ0qPV2r2sq8BlzuZFHExnZRIxpsIXdce4Bm4rdlGi7tBmmurLk4OOtDkwvhD0LMaNJf10k6QLSmRUTVzgsYz/dmGxopbMtwwIXkwi014uSZgi8wAuznXx5I4j2TUGPZHOVf+1iw/yaxWlgTVOSoX7ZxyhDgW5cCgZZGNzU5UWe0vUuVTB+hfSMj50/Q6+Vi92/mDMbPhm4nBoVzD5DT15mB+yGyN45Ej61m0JzVUyZexfvVaffEug1/u5dnwilP0WGKr4i2OXxOXtvSdAs5rlZjvppZk6IxRCwXIcPwEFL97ZrQZAxlVS5Nh+ZnlSwTe3zfQhzHj1ao0AdCAHFPUEdoUPJhSb0OjyCvZ9XZ1KCkXhuhuN/3IUhuoWl4soNCeC3KmU/USx1wda438Exj0hM1mTyBZScDPGyD9nw78DGw== Philippe Caseiro"]}]},"storage":{"disks":[{"device":"/dev/vda","partitions":[{"label":"ROOT"}],"wipeTable":true}],"files":[{"path":"/opt/ignition.json","contents":{"source":"http://192.168.40.3/leader.json"},"mode":448}],"filesystems":[{"device":"/dev/disk/by-partlabel/ROOT","format":"btrfs","label":"ROOT","path":"/","wipeFilesystem":true}]},"systemd":{"units":[{"contents":"[Unit]\nRequires=network-online.target\nAfter=network-online.target\n[Service]\nType=forking\nTimeoutStartSec=600\nRemainAfterExit=yes\nExecStart=/usr/bin/sh -c \"flatcar-install -d /dev/vda -i /opt/ignition.json \u0026\u0026 udevadm settle \u0026\u0026 systemctl reboot\"\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"installer.service"}]}}
|
{
|
||||||
|
"ignition": {
|
||||||
|
"version": "3.3.0"
|
||||||
|
},
|
||||||
|
"passwd": {
|
||||||
|
"users": [
|
||||||
|
{
|
||||||
|
"groups": [
|
||||||
|
"wheel",
|
||||||
|
"sudo"
|
||||||
|
],
|
||||||
|
"name": "cadoles",
|
||||||
|
"passwordHash": "$y$j9T$7dNoyJBSiQ5dJ6.kLs17I0$G9VVQkBUddW2E6TVQchecSE94jNxLz4F3wguz5QkvD8",
|
||||||
|
"sshAuthorizedKeys": [
|
||||||
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDDph3zh6ojSvH44k13z9B6xj+Hargo3uzkxnYv5s5NI4yagNuBXEc3aS++KdocND+FtVfLK+iVE8qHo2bvmpMmVkqU6WU2apN7DfIP0QGLlSGeo+UOZ9hGeEDlgVO4AOnZKZ5kPGBEPZ84JXuE9CmhKfwEVCK8w3B8XQttA8alFl4A4/4F14x2w4njsSLY1H3b0qah7hgYKU5zHIGLg8Lxx+1BxGIF0l5n5m5rqAskRNaF+aYbs0CcWHv49bPK0sJJ0qPV2r2sq8BlzuZFHExnZRIxpsIXdce4Bm4rdlGi7tBmmurLk4OOtDkwvhD0LMaNJf10k6QLSmRUTVzgsYz/dmGxopbMtwwIXkwi014uSZgi8wAuznXx5I4j2TUGPZHOVf+1iw/yaxWlgTVOSoX7ZxyhDgW5cCgZZGNzU5UWe0vUuVTB+hfSMj50/Q6+Vi92/mDMbPhm4nBoVzD5DT15mB+yGyN45Ej61m0JzVUyZexfvVaffEug1/u5dnwilP0WGKr4i2OXxOXtvSdAs5rlZjvppZk6IxRCwXIcPwEFL97ZrQZAxlVS5Nh+ZnlSwTe3zfQhzHj1ao0AdCAHFPUEdoUPJhSb0OjyCvZ9XZ1KCkXhuhuN/3IUhuoWl4soNCeC3KmU/USx1wda438Exj0hM1mTyBZScDPGyD9nw78DGw== Philippe Caseiro"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"storage": {
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "/opt/ignition.json",
|
||||||
|
"contents": {
|
||||||
|
"source": "http://192.168.40.3/leader.json"
|
||||||
|
},
|
||||||
|
"mode": 448
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/opt/ckube-install",
|
||||||
|
"contents": {
|
||||||
|
"source": "http://192.168.40.3/ckube-install"
|
||||||
|
},
|
||||||
|
"mode": 448
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"systemd": {
|
||||||
|
"units": [
|
||||||
|
{
|
||||||
|
"contents": "[Unit]\nRequires=network-online.target\nAfter=network-online.target\n[Service]\nType=forking\nTimeoutStartSec=600\nRemainAfterExit=yes\nExecStart=/usr/bin/sh -c \"/opt/ckube-install\"\n[Install]\nWantedBy=multi-user.target\n",
|
||||||
|
"enabled": true,
|
||||||
|
"name": "installer.service"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
#!ipxe
|
|
||||||
|
|
||||||
:start
|
|
||||||
menu Cadoles PXE Boot Options
|
|
||||||
item shell iPXE shell
|
|
||||||
item klead CadolesKube Leader
|
|
||||||
item kmaster CadolesKube Master
|
|
||||||
item knode CadolesKube Node
|
|
||||||
item exit Exit to BIOS
|
|
||||||
|
|
||||||
choose --default exit --timeout 10000 option && goto ${option}
|
|
||||||
|
|
||||||
:shell
|
|
||||||
shell
|
|
||||||
|
|
||||||
:klead
|
|
||||||
set base-url http://stable.release.flatcar-linux.net/amd64-usr/current
|
|
||||||
set ignition-url http://192.168.10.177:8001/leader.json
|
|
||||||
|
|
||||||
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
|
|
||||||
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
|
||||||
boot
|
|
||||||
|
|
||||||
:kmaster
|
|
||||||
set base-url http://stable.release.flatcar-linux.net/amd64-usr/current
|
|
||||||
set ignition-url http://192.168.10.177:8001/master.json
|
|
||||||
|
|
||||||
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
|
|
||||||
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
|
||||||
|
|
||||||
:knode
|
|
||||||
set base-url http://stable.release.flatcar-linux.net/amd64-usr/current
|
|
||||||
set ignition-url http://192.168.10.177:8001/worker.json
|
|
||||||
|
|
||||||
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
|
|
||||||
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
|
||||||
:exit
|
|
||||||
exit
|
|
70
ipxe/tftpboot/menu/boot.ipxe
Normal file
70
ipxe/tftpboot/menu/boot.ipxe
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
#!ipxe
|
||||||
|
|
||||||
|
set ignition-server MY_IP_HERE
|
||||||
|
#set base-url http://${ignition-server}/flatcar
|
||||||
|
set base-url http://stable.release.flatcar-linux.net/amd64-usr/current
|
||||||
|
set vm-install-target /dev/vda
|
||||||
|
set bm-install-target /dev/sda
|
||||||
|
|
||||||
|
:start
|
||||||
|
menu Cadoles PXE Boot Options
|
||||||
|
item gap1 -------------------- CadolesKube --------------------
|
||||||
|
item klead Run Leader (RAM)
|
||||||
|
item kmaster Run Master (RAM)
|
||||||
|
item knode Run Node (RAM)
|
||||||
|
item gap2 -----------------------------------------------------
|
||||||
|
item iklead Install Leader (VM)
|
||||||
|
item ikmaster Install Master (VM)
|
||||||
|
item iknode Install Node (VM)
|
||||||
|
item gap2 -----------------------------------------------------
|
||||||
|
item shell iPXE shell
|
||||||
|
item gap3 -----------------------------------------------------
|
||||||
|
item exit Exit to BIOS
|
||||||
|
|
||||||
|
choose --default exit --timeout 10000 option && goto ${option}
|
||||||
|
|
||||||
|
:shell
|
||||||
|
shell
|
||||||
|
|
||||||
|
:klead
|
||||||
|
set ignition-url http://${ignition-server}/os/leader.json
|
||||||
|
|
||||||
|
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
|
||||||
|
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
||||||
|
boot
|
||||||
|
|
||||||
|
:kmaster
|
||||||
|
set ignition-url http://${ignition-server}/os/leader.json
|
||||||
|
|
||||||
|
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
|
||||||
|
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
||||||
|
|
||||||
|
:knode
|
||||||
|
set ignition-url http://${ignition-server}/os/leader.json
|
||||||
|
|
||||||
|
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 ignition.config.url=${ignition-url}
|
||||||
|
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
||||||
|
|
||||||
|
:iklead
|
||||||
|
set ignition-url http://${ignition-server}/os/leader-install.json
|
||||||
|
|
||||||
|
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 flatcar.target=${vm-install-target} ignition.config.url=${ignition-url}
|
||||||
|
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
||||||
|
boot
|
||||||
|
|
||||||
|
:iknode
|
||||||
|
set ignition-url http://${ignition-server}/os/leader.json
|
||||||
|
|
||||||
|
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 flatcar.target=${vm-install-target} ignition.config.url=${ignition-url}
|
||||||
|
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
||||||
|
boot
|
||||||
|
|
||||||
|
:iknode
|
||||||
|
set ignition-url http://${ignition-server}/os/leader.json
|
||||||
|
|
||||||
|
kernel ${base-url}/flatcar_production_pxe.vmlinuz initrd=flatcar_production_pxe_image.cpio.gz flatcar.first_boot=1 flatcar.target=${vm-install-target} ignition.config.url=${ignition-url}
|
||||||
|
initrd ${base-url}/flatcar_production_pxe_image.cpio.gz
|
||||||
|
boot
|
||||||
|
|
||||||
|
:exit
|
||||||
|
exit
|
8
misc/scripts/basic-setup.sh
Normal file
8
misc/scripts/basic-setup.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ip=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
|
||||||
|
|
||||||
|
sed -i -e "s/MY_IP_HERE/${ip}/g" /srv/tftpboot/menu/boot.ipxe
|
||||||
|
|
||||||
|
service dnsmasq start
|
||||||
|
service mini_httpd start
|
41
nfpm.yaml
Normal file
41
nfpm.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# nfpm example config file
|
||||||
|
#
|
||||||
|
# check https://nfpm.goreleaser.com/configuration for detailed usage
|
||||||
|
#
|
||||||
|
|
||||||
|
name: "ckube-pxe"
|
||||||
|
arch: "amd64"
|
||||||
|
platform: "linux"
|
||||||
|
version: "v0.0.1"
|
||||||
|
section: "default"
|
||||||
|
priority: "extra"
|
||||||
|
maintainer: "Cadoles <contact@cadoles.com>"
|
||||||
|
description: |
|
||||||
|
CadolesKube OS Installer (iPXE)
|
||||||
|
vendor: "Cadoles"
|
||||||
|
homepage: "https://www.cadoles.com"
|
||||||
|
license: "GPL-v3"
|
||||||
|
changelog: "changelog.yaml"
|
||||||
|
|
||||||
|
contents:
|
||||||
|
- src: butane
|
||||||
|
dst: /srv/os/butane
|
||||||
|
- src: /srv/os/butane
|
||||||
|
dst: /var/www/localhost/htdocs/os
|
||||||
|
type: symlink
|
||||||
|
- src: ipxe/etc/dnsmasq.d
|
||||||
|
dst: /etc
|
||||||
|
- src: ipxe/tftpboot
|
||||||
|
dst: /srv/tftpboot
|
||||||
|
|
||||||
|
scripts:
|
||||||
|
postinstall: ./misc/scripts/basic-setup.sh
|
||||||
|
|
||||||
|
overrides:
|
||||||
|
apk:
|
||||||
|
depends:
|
||||||
|
- dnsmasq
|
||||||
|
- dnsmasq-openrc
|
||||||
|
- dnsmasq-common
|
||||||
|
- alpine-ipxe
|
||||||
|
- mini_httpd
|
Reference in New Issue
Block a user