agentleFS
Aidas-devAidas-dev/k8s-agent-skills/skills/talosconfig/SKILL.md

talosconfig

Skill4 starsChanged 5 months agoMITView on GitHub

Talos Linux machine configuration — multi-document YAML format, config documents, generation flags, patching, apply modes, and v1.13+ config features.

  • Reads credentials

The file

Files
SKILL.md

talosconfig — Machine Configuration

For CLI operations see talosctl. For Terraform provider see talos-terraform.

Format

Multi-document YAML — each document is a config type. All config is declarative, applied via talosctl apply-config or talosctl patch. Legacy single-document v1alpha1 format still supported.

Cluster Config Documents

Document typeKindPurpose
Machine configConfigCore: machine type, install, network, disks
Environment configEnvironmentConfigContainer env overrides (v1.13+, replaces .machine.env)
Install configInstallConfigSeparate disk/install settings
Disk encryption configDiskEncryptionConfigLUKS2 encryption settings per partition
Network configNetworkConfigInterface config, DNS, NTP
KubeSpan configKubeSpanConfigWireGuard mesh settings
Image verification configImageVerificationConfigContainer signature verification (v1.13+)
External volume configExternalVolumeConfigVirtiofs volumes (v1.13+)
Probe configProbeConfigNode/API health probes (v1.13+)
Resolver configResolverConfigDNS resolver config (v1.13+)
Routing rule configRoutingRuleConfigAdvanced routing rules (v1.13+)
VRF configVRFConfigVRF interface config (v1.13+)

Key Config Fields

# Cluster document example
kind: Config
version: v1alpha1
machine:
  type: controlplane          # controlplane, worker
  install:
    disk: /dev/sda            # Install target
    image: ghcr.io/siderolabs/installer:v1.13.0
    wipe: false               # Preserve on re-apply
  network:
    hostname: node-1
    interfaces:
      - interface: eno1
        dhcp: false
        addresses: [10.0.1.10/24]
        routes:
          - network: 0.0.0.0/0
            gateway: 10.0.1.1
    nameservers: [1.1.1.1]
  systemDiskEncryption:
    state:                    # Encrypts etcd partition
      provider: luks2
      keys:
        - slot: 0
          tpm: {}             # TPM 2.0 sealed key
    ephemeral:                # Encrypts ephemeral partition
      provider: luks2
      keys:
        - slot: 0
          tpm: {}
cluster:
  network:
    cni:
      name: none              # Install CNI separately
    podSubnets: [10.244.0.0/16]
    serviceSubnets: [10.96.0.0/12]
  apiServer:
    extraArgs:
      feature-gates: [ServerSideApply=true]  # Slice format in v1.13+
  etcd:
    extraArgs:
      quota-backend-bytes: "8589934592"      # 8GB
      auto-compaction-retention: "1000"

Config Generation

FlagPurpose
--with-secrets secrets.yamlUse saved secrets (required for reproducibility)
--config-patch @patch.yamlPatch all node types
--config-patch-control-plane @cp.yamlPatch control planes only
--config-patch-worker @w.yamlPatch workers only
--additional-sans <dns>Extra SANs for API cert
--dns-domain <domain>Cluster DNS domain (default: cluster.local)
--kubernetes-version v1.36.0Override K8s version

Always use --with-secrets — without it, each run produces different certs/keys and nodes can't join across runs. Store the secrets file encrypted (Vault/SOPS).

Applying Config

⚠️ Every change MUST be dry-run first, and the user MUST confirm before applying.

⚠️ apply-config replaces the ENTIRE machine config. It needs the full config file, not a partial patch. Targeted changes use talosctl patch machineconfig.

# Targeted patch (dry-run first!)
talosctl patch machineconfig --nodes cp1 --patch @patch.yaml --dry-run
# after user confirms:
talosctl patch machineconfig --nodes cp1 --patch @patch.yaml

# Full config replacement (dry-run first!)
talosctl apply-config --nodes cp1 --file controlplane.yaml --dry-run
# after user confirms:
talosctl apply-config --nodes cp1 --file controlplane.yaml

Apply Modes

ModeBehavior
auto (default)Immediate apply, reboot if needed
no-rebootApply without reboot
rebootAlways reboot to apply
stagedApply on next reboot
tryApply, rollback after timeout if not confirmed

v1.13+ Config Features

  • LifecycleService — Unified upgrade API. Replaces legacy upgrade lifecycle.
  • EnvironmentConfig document — Replaces .machine.env in machine config. Separate config document.
  • ImageVerificationConfig — Verify container image signatures before pulling.
  • ExternalVolumeConfig — Virtiofs volumes for VMs.
  • Slice args — extraArgs now accept YAML slices ([val1, val2]) in addition to string maps.
  • KubeSpanConfig document — WireGuard mesh config as separate document.
  • Advanced network docs — RoutingRuleConfig, VRFConfig, ProbeConfig, ResolverConfig as separate documents.

Common Mistakes

  • Losing secrets — Always --with-secrets secrets.yaml during gen config. Without secrets, you cannot add nodes, rotate certs, or recover.
  • Forgot --with-secrets during gen — Without it, each run produces different certs/keys. Nodes from one gen can't join configs from another.
  • --stage/--preserve deprecated — Legacy upgrade flags, removed in Talos 1.18. Use --no-reboot instead of --stage.
  • Apply config to all nodes at once — For CP changes, use sequential apply with health checks between nodes (etcd quorum).
  • Hardcoded network assumptions — Config encodes node-specific IPs/hostnames. Use --config-patch-* per node type rather than editing the base config per node.
  • .machine.env in v1.13+ — Replaced by EnvironmentConfig document. Old field is deprecated.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.