Bootstrap a Talos Linux cluster for Cozystack using talos-bootstrap
talos-bootstrap is an interactive script for bootstrapping Kubernetes clusters on Talos OS.
It was created by Ænix to simplify the installation of Talos Linux on bare metal nodes in a user-friendly manner.
Install dependencies:
talosctl
dialog
nmap
Preparation
Create a new directory for holding your cluster configuration
mkdir cluster1
cd cluster1
Write configuration for Cozystack:
cat > patch.yaml <<\EOT
machine:
kubelet:
nodeIP:
validSubnets:
- 192.168.100.0/24
extraConfig:
maxPods: 512
kernel:
modules:
- name: openvswitch
- name: drbd
parameters:
- usermode_helper=disabled
- name: zfs
- name: spl
install:
image: ghcr.io/aenix-io/cozystack/talos:v1.8.0
files:
- content: |
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
device_ownership_from_security_context = true
[plugins."io.containerd.cri.v1.runtime"]
device_ownership_from_security_context = true
path: /etc/cri/conf.d/20-customization.part
op: create
cluster:
network:
cni:
name: none
dnsDomain: cozy.local
podSubnets:
- 10.244.0.0/16
serviceSubnets:
- 10.96.0.0/16
EOT
cat > patch-controlplane.yaml <<\EOT
cluster:
allowSchedulingOnControlPlanes: true
controllerManager:
extraArgs:
bind-address: 0.0.0.0
scheduler:
extraArgs:
bind-address: 0.0.0.0
apiServer:
certSANs:
- 127.0.0.1
proxy:
disabled: true
discovery:
enabled: false
etcd:
advertisedSubnets:
- 192.168.100.0/24
EOT
Run talos-bootstrap to deploy the first node in a cluster:
talos-bootstrap install
⚠️ If your nodes are running on an external network, you must specify each node explicitly in the argument:
talos-bootstrap install -n 1.2.3.4
Where 1.2.3.4
is the IP-address of your remote node.
BOOTSTRAP_ETCD=false
from your cluster.conf
file.Repeat the step for the other nodes in a cluster.
Now follow Get Started guide starting from the Install Cozystack section, to continue the installation.
An interactive script for bootstrapping Kubernetes clusters on Talos OS.
Example: bootstrap full-feature Kubernetes cluster in 5 minutes:
Install dependencies:
talosctl
(>=1.6.0)dialog
nmap
Install talos-bootstrap:
curl -LO https://github.com/aenix-io/talos-bootstrap/raw/master/talos-bootstrap
chmod +x ./talos-bootstrap
sudo mv ./talos-bootstrap /usr/local/bin/talos-bootstrap
- Boot your nodes with Talos in maintenance mode.
(booting from ISO or PXE using matchbox is the best option) - Create a directory for holding your cluster configuration.
- Run
talos-bootstrap
command for every node in your cluster.
USAGE:
talos-bootstrap ACTION [OPTIONS]
ACTIONS:
help Show this help message.
install Setup a node for a new or existing cluster.
upgrade Upgrade a node in an existing cluster.
reset Reset and remove a node from an existing cluster.
reboot Reboot a node.
shutdown Shutdown a node.
dashboard Open dashboard for a node.
OPTIONS:
-n, --node <address> Node address
You can specify your customizations in one of the following files:
patch.yaml
- common settings used for all nodes.patch-controlplane.yaml
- settings used for controlplane nodes onlypatch-worker.yaml
- settings used for worker nodes only
Read the Configuration Patches documentation for more details.
Looking for enhanced, non-interactive version of talos-bootstrap?
Take a look at Talm project.
Andrei Kvapil kvapss@gmail.com
Licensed under Apache 2.0 License
Tidak ada komentar:
Posting Komentar