Talos Linux — Kubernetes Operating System
Kubernetes
Talos Linux1
Talos ISO — Live system in RAM
- …boots without a configuration …enters maintenance mode
- …installation to local stage by configuration file
- …defined by a machine config file passed to server
talosctl
Command-line tool to access the Talos API
- Download
talosctlfrom GitHub releases2 - Configuration file…
- …defaults to
~/.talos/config - …set path with
$TALOSCONFIG - …options
--talosconfig
- …defaults to
# install
mkdir ~/bin && export PATH=$PATH:~/bin
curl -L https://github.com/siderolabs/talos/releases/download/v1.10.1/talosctl-linux-amd64 -o ~/bin/talosctl
chmod +x ~/bin/talosctl
export TALOSCONFIG=$(realpath ./talosconfig)
source <(talosctl completion zsh)
talosctl config info- Endpoints — where
talosctlsends commands to-e node,nodeoptions to address control plane nodes- …automatic load-balancing over multiple endpoints
- Nodes — target node of operation
- …endpoints automatic proxy requests to nodes
-n node,node,...option to define target
# specify endpoint and node
talosctl -e $ip_cp1 -n $ip_cp1 #...
# add endpoints to the configuration
talosctl config endpoint $ip_cp1,$ip_cp2,$ip_cp3Debug with sub-commands:
dmesg— kernel logsservice— list serviceslogs <service>— service logsprocessesmemorynetstat— network portspcap— capture network packages
# launch a debug container
kubectl debug -n kube-system -it --image alpine node/talos-5wl-rauMachine Configuration
gen config— generate the machine configurations for a clustertalosconfig— Localtalosctlclient configurationcontrolplane.yaml— Configure control plane nodesworker.yaml— Configure nodes that run workloads
apply-config— apply a configuration to a node--insecure- …connect without authentication (however encrypted)
- …initial configuration can not use PKI infrasructure
edit machineconfig— live edit configurationpatch machineconfig— apply via JSON patch
# list all resource definitions
talosctl get rdKubernetes
Kubernetes Endpoint — Address of the Kubernetes API server
- HTTPS URL endpoint …default to port 6443
- Highly available …uses all available control plane nodes
- Endpoint IP either…
- …multiple DNS records
- …load-balancer
- …Talos VIP (build-in)
VIP3 — shared/virtual IP address (layer 2)
- …control plane nodes must share a layer 2 network (same switch)
- …
etcdfor elections and leadership (control) of the IP address
etcd
Distributed key-value store — stores the state of Kubernetes
- Talos manages
etcdmembers running on the control plane - Recommended to run an odd number …3 or more
talosctlsub-commandsservice etcd– state ofetcdetcd members- list nodes with anetcdinstance
talosctl -n $ip_cp1,$ip_cp2,$ip_cp3 etcd statusTests
Docker
Setup a test environment in Docker containers…
# create default cluster with two containers
talosctl cluster create
talosctl cluster create --workers 3
# clean up
talosctl cluster destoryFootnotes
Talos Linux
https://www.talos.dev
https://github.com/siderolabs/talos↩︎Talos Releases, GitHub
https://github.com/siderolabs/talos/releases↩︎Virtual (shared) IP, Talos Documentation
https://www.talos.dev/v1.9/talos-guides/network/vip↩︎