A GitHub Action for installing and configuring k0s - Zero Friction Kubernetes. k0s is a lightweight, CNCF-certified Kubernetes distribution that's easy to install and maintain.
- ✅ Automatic installation of k0s
- ✅ Single-node controller setup
- ✅ Configurable version
- ✅ Waits for cluster readiness
- ✅ Outputs kubeconfig path for easy integration
- ✅ No cleanup required - designed for ephemeral GitHub Actions runners
name: Test with k0s
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup k0s
id: k0s
uses: fenio/setup-k0s@v2
- name: Deploy and test
run: |
kubectl apply -f k8s/
kubectl wait --for=condition=available --timeout=60s deployment/my-app| Input | Description | Default |
|---|---|---|
version |
k0s version to install (e.g., v1.30.0+k0s.0) or latest |
latest |
wait-for-ready |
Wait for cluster to be ready before completing | true |
timeout |
Timeout in seconds to wait for cluster readiness | 120 |
dns-readiness |
Wait for CoreDNS to be ready and verify DNS resolution works | true |
| Output | Description |
|---|---|
kubeconfig |
Path to the kubeconfig file (typically ~/.kube/config) |
- name: Setup k0s
uses: fenio/setup-k0s@v2- name: Setup k0s
uses: fenio/setup-k0s@v2
with:
version: 'v1.30.0+k0s.0'- name: Setup k0s
uses: fenio/setup-k0s@v2
with:
timeout: '600' # 10 minutes- Installs the k0s binary for your platform
- Installs k0s as a single-node controller using systemd
- Starts the k0s service
- Extracts and configures kubectl with the admin kubeconfig
- Waits for the cluster to become ready (if
wait-for-readyis enabled)
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) - Requires systemd for service management
If the cluster doesn't become ready in time, increase the timeout:
- name: Setup k0s
uses: fenio/setup-k0s@v2
with:
timeout: '600' # 10 minutesYou can add a step to check the k0s status:
- name: Check k0s Status
run: |
sudo k0s status
kubectl get nodes
kubectl get pods -AThis action is implemented as a pure bash script (setup.sh) with no build step required.
To test changes locally:
- Fork and clone the repository
- Make your changes to
action.ymlorsetup.sh - Create a test workflow that uses your local action (
uses: ./) - Push to your fork and verify the workflow runs successfully
See CONTRIBUTING.md for more details.
MIT License - see LICENSE file for details.
- k0s - Zero Friction Kubernetes
- setup-k3s - Lightweight Kubernetes (k3s)
- setup-kubesolo - Ultra-lightweight Kubernetes
- setup-microk8s - Lightweight Kubernetes by Canonical
- setup-minikube - Local Kubernetes (Minikube)
- setup-talos - Secure, immutable Kubernetes OS (Talos)