You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
github actions k3s
v0.3
A GitHub Action for running k3s kubernetes cluster
- Action is by itself a docker container with docker and kubectl installed
- Action is launching k3s container and some checks to ensure kubernetes is up and running
- Optionally (by default, but can be turned off) installs kubectl (copies over) to enable hassle-free k8s interaction
- k3s_tag - k3s tag to use. (can be found at https://hub.docker.com/r/rancher/k3s/tags)
- parent_workspace - workspace path on runner, obtainer from context, no need to specify anything here, except you know what you're doing
- kubectl_version
- install_kubectl - enabled by default, copies kubectl to bin dir in workspace to allow other steps to use kubectl
- k3s_arguments - by default set to
--no-deploy=traefik
- custom_registry - set to 'true' to mount your
registries.yaml
to k3s. This will allow to use private registry mapping in k3s. (set tofalse
if you don't have such needs)
# File: .github/workflows/ci.yml
name: k3s
on:
push:
branches:
- master
pull_request:
env:
KUBECONFIG: k3s.yaml
jobs:
k3s:
name: k3s
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@master
- name: k3s
uses: yellowmegaman/k3s-gha@master
with:
custom_registry: true
- name: try to use kubeconfig
run: kubectl get ns
This will result in something similar:
Run kubectl get ns
NAME STATUS AGE
default Active 52s
kube-system Active 51s
kube-public Active 51s
kube-node-lease Active 51s