Skip to content
/ setup-k3d Public

GitHub Action for setting up k3d (k3s in Docker). It's lighter than KinD (Kubernetes in Docker).

License

Notifications You must be signed in to change notification settings

rinx/setup-k3d

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setup-k3d

This is a GitHub Action for setting up k3d.

Inputs

version

k3d version.

Default: latest

name

cluster name.

Default: mycluster

skipClusterCreation

If "true", the action will not create a cluster, just acquire the tools.

Default: false

ingressPort

If it is not 0, ingress will be exposed to the specified port.

Default: 0

agents

If it is not 0, specified number of agents will be created.

Default: 0

options

extra options that will passed to k3d cluster create command.

Default: ""

Examples

To create a single node cluster,

on: push
jobs:
  setup-k3d:
    runs-on: ubuntu-latest
    steps:
      - uses: rinx/[email protected]
      - name: Get cluster info
        run: |
          kubectl cluster-info
          kubectl get pods -n kube-system
          kubectl get nodes
          echo "current-context:" $(kubectl config current-context)

To create a cluster with multi agents,

on: push
jobs:
  setup-k3d:
    runs-on: ubuntu-latest
    steps:
      - uses: rinx/[email protected]
        with:
          agents: 3
      - name: Get cluster info
        run: |
          kubectl cluster-info
          kubectl get pods -n kube-system
          kubectl get nodes
          echo "current-context:" $(kubectl config current-context)

To create a cluster with exposed ingress,

on: push
jobs:
  setup-k3d:
    runs-on: ubuntu-latest
    steps:
      - uses: rinx/[email protected]
        with:
          ingressPort: 8081
      - name: Get cluster info
        run: |
          kubectl cluster-info
          kubectl get pods -n kube-system
          kubectl get nodes
          echo "current-context:" $(kubectl config current-context)

References

About

GitHub Action for setting up k3d (k3s in Docker). It's lighter than KinD (Kubernetes in Docker).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published