Use the templates to provision your k3s instances on Fedora CoreOS using ignition. This will install k3s-selinux with rpm-ostree.
Last active
August 19, 2024 05:34
-
-
Save siegy22/a981aaf67f7310f558eee8b82300f3df to your computer and use it in GitHub Desktop.
Fedora CoreOS k3s ignition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variant: fcos | |
version: 1.5.0 | |
systemd: | |
units: | |
- name: 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/rancher/k3s | |
[Service] | |
RemainAfterExit=yes | |
Type=oneshot | |
ExecStart=/usr/local/bin/run-k3s-installer | |
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-installer | |
mode: 0755 | |
contents: | |
inline: | | |
#!/usr/bin/env sh | |
main() { | |
export K3S_TOKEN=SECRET # Please replace this. | |
curl -sfL https://get.k3s.io | sh - server --cluster-init | |
return 0 | |
} | |
main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variant: fcos | |
version: 1.5.0 | |
systemd: | |
units: | |
- name: 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/rancher/k3s | |
[Service] | |
RemainAfterExit=yes | |
Type=oneshot | |
ExecStart=/usr/local/bin/run-k3s-installer | |
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-installer | |
mode: 0755 | |
contents: | |
inline: | | |
#!/usr/bin/env sh | |
main() { | |
export K3S_TOKEN=SECRET # Please replace this. | |
curl -sfL https://get.k3s.io | sh -s - server --server https://<ip or hostname of bootstrap>:6443 | |
return 0 | |
} | |
main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variant: fcos | |
version: 1.5.0 | |
systemd: | |
units: | |
- name: 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/rancher/k3s | |
[Service] | |
RemainAfterExit=yes | |
Type=oneshot | |
ExecStart=/usr/local/bin/run-k3s-installer | |
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-installer | |
mode: 0755 | |
contents: | |
inline: | | |
#!/usr/bin/env sh | |
main() { | |
export K3S_TOKEN=SECRET # Please replace this. | |
curl -sfL https://get.k3s.io | sh -s - agent --server https://<ip or hostname of your kubernetes API>:6443 | |
return 0 | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment