adding install script

This commit is contained in:
Philippe Caseiro 2022-12-02 12:24:23 +01:00
parent d2929a2514
commit d2562a66df
3 changed files with 52 additions and 12 deletions

5
butane/ckube-install Normal file
View 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"

View File

@ -21,7 +21,7 @@ systemd:
Type=forking
TimeoutStartSec=600
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]
WantedBy=multi-user.target
storage:
@ -29,4 +29,8 @@ storage:
- path: /opt/ignition.json
mode: 0700
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

View File

@ -1,11 +1,23 @@
#!ipxe
set ignition-server 192.168.40.3
#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
: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 klead CadolesKube Leader
item kmaster CadolesKube Master
item knode CadolesKube Node
item gap3 -----------------------------------------------------
item exit Exit to BIOS
choose --default exit --timeout 10000 option && goto ${option}
@ -14,25 +26,44 @@ choose --default exit --timeout 10000 option && goto ${option}
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
set ignition-url http://${ignition-server}/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
set ignition-url http://${ignition-server}/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 base-url http://stable.release.flatcar-linux.net/amd64-usr/current
set ignition-url http://192.168.10.177:8001/worker.json
set ignition-url http://${ignition-server}/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}/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}/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}/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
exit