jupyterhub / action-k3s-helm

A GitHub action to install K3S, Calico, and Helm.
BSD 3-Clause "New" or "Revised" License
25 stars 6 forks source link
actions github-actions k3s kubernetes

GitHub Action: Install K3s, Calico and Helm

GitHub Action badge

Creates a Kubernetes cluster using K3s (1.24+) with Calico (3.27.0) for NetworkPolicy enforcement, and installs Helm 3 (3.5+).

Optional input parameters

Outputs

Example

name: Example workflow

on:
  pull_request:
  push:
  workflow_dispatch:

jobs:
  k8s-test:
    runs-on: ubuntu-22.04
    steps:
      # GitHub Action reference: https://github.com/jupyterhub/action-k3s-helm
      - name: Start a local k8s cluster
        uses: jupyterhub/action-k3s-helm@v4
        with:
          # See available:
          # - k3s release channels at https://github.com/k3s-io/k3s/blob/HEAD/channel.yaml
          # - k3s versions at https://github.com/k3s-io/k3s/tags
          # - helm versions at https://github.com/helm/helm/tags
          k3s-channel: latest
          # k3s-version: v1.29.0+k3s1
          # helm-version: v3.13.0

      - name: Verify function of k8s, kubectl, and helm
        run: |
          echo "kubeconfig: $KUBECONFIG"
          kubectl version
          kubectl get pods --all-namespaces

          helm version
          helm list

Development

This is based on https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/08c13609c1d0c6cb07d45d49d0a876100cf941eb/ci/common by @consideratio.

This action aims to to provide an easy to use Kubernetes cluster with the following features:

A small number of features are configurable. All K3s defaults are kept except where they conflict with the deployment of Calico. Due to the difficulty in comprehensively testing this action the aim is to minimise the number of arguments. If you have an advanced use case hopefully extra-setup-args will be sufficient.