Easily create/delete/something-else Kubernetes clusters.
Features:
- common interface for creating Kubernetes clusters in both local and cloud environments.
- clusters have their own Docker registry for pushing/pulling images.
- configuration via environment variables. cluster information is also obtained from environment variables.
It can be used both as a standalone script as well as a GitHub action.
name: Create Cluster
on: pull_request
jobs:
create-cluster:
runs-on: ubuntu-latest
steps:
- name: Create a local k3d cluster
uses: datawire/cluster-providers@master
# changing the provider to something different would keep things the same
with:
provider: k3d
command: create
# we can pass some advanced, provider-specific configuration in env variables
env:
K3D_EXTRA_ARGS: --server-arg '--no-deploy=traefik'
- name: Test the cluster we created
# KUBECONFIG has been set by the previous step: kubectl should work fine
run: |
kubectl cluster-info
- name: Delete the k3d cluster
uses: datawire/cluster-providers@master
# not really important to destroy a local cluster, but we should always
# remember to do it in cloud providers like GKE or Azure.
with:
provider: k3d
command: delete
- Using the Kubernetes cluster providers in:
- Usage:
- List of commands:
create
,delete
... - Input and output variables: configuring the cluster and getting info from it.
- List of commands:
- List of current providers: