A GitHub Action for installing and configuring Talos Linux - a modern, secure, immutable, and minimal Linux OS designed specifically for running Kubernetes. Perfect for CI/CD pipelines, testing, and development workflows.
- ✅ Automatic installation of talosctl CLI
- ✅ Creates local Talos cluster using Docker
- ✅ Configurable number of worker nodes
- ✅ Supports custom Kubernetes versions
- ✅ Waits for cluster readiness
- ✅ Outputs both kubeconfig and talosconfig paths
- ✅ No cleanup required - designed for ephemeral GitHub Actions runners
name: Test with Talos
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Talos
id: talos
uses: fenio/setup-talos@v1
with:
version: 'latest'
nodes: '1'
- name: Deploy and test
env:
KUBECONFIG: ${{ steps.talos.outputs.kubeconfig }}
run: |
kubectl apply -f k8s/
kubectl wait --for=condition=available --timeout=60s deployment/my-app| Input | Description | Default |
|---|---|---|
version |
Talos version to install (e.g., v1.8.0) or latest |
latest |
cluster-name |
Name of the Talos cluster | talos-ci |
kubernetes-version |
Kubernetes version to use (e.g., v1.31.1) |
(Talos default) |
nodes |
Number of worker nodes (in addition to control plane) | 0 |
talosctl-args |
Additional arguments to pass to talosctl cluster create |
"" |
wait-for-ready |
Wait for cluster to be ready before completing | true |
timeout |
Timeout in seconds to wait for cluster readiness | 300 |
dns-readiness |
Wait for CoreDNS to be ready and verify DNS resolution works | true |
load-nvme-modules |
Load NVMe kernel modules on host (required for NVMe-oF with Docker provisioner) | false |
mount-dev |
Bind mount /dev from host into containers (required for NVMe-oF to see dynamically created devices) | false |
| Output | Description |
|---|---|
kubeconfig |
Path to the kubeconfig file (~/.kube/config) |
talosconfig |
Path to the talosconfig file (~/.talos/config) |
- name: Setup Talos
uses: fenio/setup-talos@v1- name: Setup Talos with 2 workers
id: talos
uses: fenio/setup-talos@v1
with:
nodes: '2'
cluster-name: 'my-test-cluster'- name: Setup Talos with specific versions
uses: fenio/setup-talos@v1
with:
version: 'v1.8.0'
kubernetes-version: 'v1.31.1'- name: Setup Talos
id: talos
uses: fenio/setup-talos@v1
- name: Query cluster via Talos API
env:
TALOSCONFIG: ${{ steps.talos.outputs.talosconfig }}
run: |
talosctl --nodes 127.0.0.1 version
talosctl --nodes 127.0.0.1 health
talosctl --nodes 127.0.0.1 get servicesThis action runs a bash script that:
- Installs Docker (if not already available)
- Downloads and installs the
talosctlCLI tool - Creates a local Talos cluster using Docker containers
- Waits for the cluster to become fully ready
- Exports both kubeconfig and talosconfig paths for use in subsequent steps
No cleanup needed - GitHub Actions runners are ephemeral and destroyed after each workflow run, so there's no need to restore system state.
- Runs on
ubuntu-latest(or any Linux-based runner) - Requires
sudoaccess (provided by default in GitHub Actions) - Docker is automatically installed if not present
If the cluster doesn't become ready in time, increase the timeout:
- name: Setup Talos
uses: fenio/setup-talos@v1
with:
timeout: '600' # 10 minutesCheck the GitHub Actions logs. The script uses ::group:: annotations for collapsible sections.
To test locally on a Linux machine:
export INPUT_VERSION="latest"
export INPUT_CLUSTER_NAME="talos-ci"
export INPUT_KUBERNETES_VERSION=""
export INPUT_NODES="0"
export INPUT_TALOSCTL_ARGS=""
export INPUT_WAIT_FOR_READY="true"
export INPUT_TIMEOUT="300"
export INPUT_DNS_READINESS="true"
export GITHUB_ENV=/tmp/github_env
export GITHUB_OUTPUT=/tmp/github_output
bash setup.shTalos Linux offers several advantages for CI/CD environments:
- Immutable: No SSH, no shell - reduces attack surface
- Minimal: Small footprint, fast startup times
- API-driven: Everything is managed via API (talosctl)
- Secure by default: All system APIs use mutual TLS
- Perfect for testing: Quick cluster creation and destruction
MIT License - see LICENSE file for details.
- Talos Linux - Secure Kubernetes OS
- setup-k0s - Zero friction Kubernetes (k0s)
- setup-k3s - Lightweight Kubernetes (k3s)
- setup-kubesolo - Ultra-lightweight Kubernetes
- setup-microk8s - Lightweight Kubernetes by Canonical
- setup-minikube - Local Kubernetes (Minikube)