This is a GitHub Action for setting up k3d.
k3d version.
Default: latest
cluster name.
Default: mycluster
If "true", the action will not create a cluster, just acquire the tools.
Default: false
If it is not 0
, ingress will be exposed to the specified port.
Default: 0
If it is not 0
, specified number of agents will be created.
Default: 0
extra options that will passed to k3d cluster create
command.
Default: ""
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)