Files
vcenter-coreos-k3s/ignition/template01.yaml
NAGY Akos 6ae461b7ef add base
2023-12-13 19:21:40 +02:00

144 lines
4.4 KiB
YAML

variant: fcos
version: 1.5.0
systemd:
units:
- name: getty@tty1.service
dropins:
- name: autologin-core.conf
contents: |
[Service]
ExecStart=
ExecStart=-/usr/sbin/agetty --autologin core --noclear %I $TERM
- name: run-k3s-prereq-installer.service
enabled: true
contents: |
[Unit]
After=network-online.target
Wants=network-online.target
Before=systemd-user-sessions.service
OnFailure=emergency.target
OnFailureJobMode=replace-irreversibly
ConditionPathExists=!/var/lib/k3s-prereq-installed
[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/usr/local/bin/run-k3s-prereq-installer
ExecStartPost=/usr/bin/touch /var/lib/k3s-prereq-installed
ExecStartPost=/usr/bin/systemctl --no-block reboot
StandardOutput=kmsg+console
StandardError=kmsg+console
[Install]
WantedBy=multi-user.target
- name: run-k3s-installer.service
enabled: true
contents: |
[Unit]
After=network-online.target
Wants=network-online.target
Before=systemd-user-sessions.service
OnFailure=emergency.target
OnFailureJobMode=replace-irreversibly
ConditionPathExists=/var/lib/k3s-prereq-installed
ConditionPathExists=!/var/lib/k3s-installed
[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/usr/local/bin/run-k3s-installer
ExecStartPost=/usr/bin/touch /var/lib/k3s-installed
#ExecStartPost=/usr/bin/systemctl --no-block reboot
StandardOutput=kmsg+console
StandardError=kmsg+console
[Install]
WantedBy=multi-user.target
- name: install-open-vm-tools.service
enabled: true
contents: |
[Unit]
After=network-online.target
Wants=network-online.target
Before=systemd-user-sessions.service
OnFailure=emergency.target
OnFailureJobMode=replace-irreversibly
ConditionPathExists=!/var/lib/open-vm-tools-installed
[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/usr/local/bin/install-open-vm-tools
ExecStartPost=/usr/bin/touch /var/lib/open-vm-tools-installed
ExecStartPost=/usr/bin/systemctl --no-block reboot
StandardOutput=kmsg+console
StandardError=kmsg+console
[Install]
WantedBy=multi-user.target
storage:
files:
- path: /usr/local/bin/run-k3s-prereq-installer
mode: 0755
contents:
inline: |
#!/usr/bin/env sh
main() {
rpm-ostree install https://github.com/k3s-io/k3s-selinux/releases/download/v1.4.stable.1/k3s-selinux-1.4-1.coreos.noarch.rpm
return 0
}
main
- path: /etc/hostname
mode: 0644
contents:
inline: |
k3s-1
- path: /etc/NetworkManager/system-connections/ens192.nmconnection
mode: 0600
contents:
inline: |
[connection]
id=ens192
type=ethernet
interface-name=ens192
[ipv4]
address1=10.2.4.111/24,10.2.4.1
dns=10.2.4.1;
dns-search=example.com
may-fail=false
method=manual
- path: /usr/local/bin/run-k3s-installer
mode: 0755
contents:
inline: |
#!/usr/bin/env sh
main() {
export K3S_KUBECONFIG_MODE="644"
export INSTALL_K3S_EXEC=" --flannel-backend=none --disable-network-policy"
# export INSTALL_K3S_EXEC=" --flannel-backend=none --disable-network-policy" K3S_URL="https://10.2.4.111:6443" K3S_TOKEN=""
curl -sfL https://get.k3s.io | sh -
return 0
}
main
- path: /etc/rancher/k3s/kubelet.config
mode: 0644
contents:
inline: |
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
shutdownGracePeriod: 60s
shutdownGracePeriodCriticalPods: 10s
- path: /usr/local/bin/install-open-vm-tools
mode: 0755
contents:
inline: |
#!/usr/bin/env sh
main() {
while [ ! -f /var/lib/k3s-installed ] ; do
sleep 2
done
rpm-ostree install open-vm-tools
return 0
}
main
passwd:
users:
- name: core
password_hash: ""
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAEvf7cRxXo3dCYwLU0cxbxSgD4FabfYA2UFeZv1fwo7 akosfred