GithubHelp home page GithubHelp logo

k3s-gha's Introduction

k3s on Github Actions

A GitHub Action for running k3s kubernetes cluster

How it works

  • 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

Optional Input parameters

  • k3s_tag - k3s tag to use. (can be found at https://hub.docker.com/r/rancher/k3s/tags)
  • registries_yaml_path - relative path of registries.yaml
  • 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

Required parameters

  • custom_registry - set to 'true' to mount your registries.yaml to k3s. This will allow to use private registry mapping in k3s. (set to false if you don't have such needs)

GitHub Actions

# 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

k3s-gha's People

Contributors

yellowmegaman avatar kierun avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.