86 lines
2.3 KiB
YAML
86 lines
2.3 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: custom-script
|
|
namespace: system-upgrade
|
|
type: Opaque
|
|
stringData:
|
|
config.yaml: |
|
|
#cloud-config
|
|
|
|
install:
|
|
poweroff: true
|
|
image: quay.io/kairos/debian:bookworm-standard-amd64-generic-v3.3.0-k3sv1.32.0-k3s1
|
|
|
|
reset:
|
|
reboot: true
|
|
reset-persistent: true
|
|
|
|
users:
|
|
- name: "kairos"
|
|
passwd: "kairos"
|
|
groups:
|
|
- "admin"
|
|
ssh_authorized_keys:
|
|
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAjAjv9cWzwoJhTlzdrDw47eIg9t51vMbXbf0he96mRK joemonk@hotmail.co.uk" # VSCode Container
|
|
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFOzNQet/Vm/EXU8GR0D4I+QYIPiGL5rCKPgDPhjWKIU joemonk@hotmail.co.uk" # Laptop
|
|
|
|
# Enable K3s on the node.
|
|
k3s:
|
|
enabled: true # Set to true to enable K3s.
|
|
args:
|
|
- --disable=local-storage
|
|
|
|
stages:
|
|
boot:
|
|
- name: "Setup hostname"
|
|
hostname: "kairos"
|
|
- name: "Setup dns"
|
|
dns:
|
|
nameservers:
|
|
- 192.168.1.1
|
|
add-config-file.sh: |
|
|
#!/bin/sh
|
|
set -e
|
|
if diff /host/run/system-upgrade/secrets/custom-script/config.yaml /host/oem/90_custom.yaml >/dev/null; then
|
|
echo config present
|
|
exit 0
|
|
fi
|
|
# we can't cp, that's a symlink!
|
|
cat /host/run/system-upgrade/secrets/custom-script/config.yaml > /host/oem/90_custom.yaml
|
|
grub2-editenv /host/oem/grubenv set next_entry=statereset
|
|
sync
|
|
|
|
mount --rbind /host/dev /dev
|
|
mount --rbind /host/run /run
|
|
nsenter -i -m -t 1 -- reboot
|
|
exit 1
|
|
---
|
|
apiVersion: upgrade.cattle.io/v1
|
|
kind: Plan
|
|
metadata:
|
|
name: reset-and-reconfig
|
|
namespace: system-upgrade
|
|
spec:
|
|
concurrency: 2
|
|
# This is the version (tag) of the image.
|
|
version: "bookworm-standard-amd64-generic-v3.3.0-k3sv1.32.0-k3s1"
|
|
nodeSelector:
|
|
matchExpressions:
|
|
- { key: kubernetes.io/hostname, operator: Exists }
|
|
serviceAccountName: system-upgrade
|
|
cordon: false
|
|
upgrade:
|
|
# Here goes the image which is tied to the flavor being used.
|
|
# Currently can pick between opensuse and alpine
|
|
image: quay.io/kairos/debian:bookworm-standard-amd64-generic-v3.3.0-k3sv1.32.0-k3s1
|
|
command:
|
|
- "/bin/bash"
|
|
- "-c"
|
|
args:
|
|
- bash /host/run/system-upgrade/secrets/custom-script/add-config-file.sh
|
|
secrets:
|
|
- name: custom-script
|
|
path: /host/run/system-upgrade/secrets/custom-script
|