A Drone Plugin for Kubernetes IN Docker - local clusters for testing Kubernetes using kubernetes-sigs/kind.
This plugin is based and inspired by the kind-action.
kind: pipeline
type: docker
name: default
steps:
- name: create kind cluster
image: otwld/drone-kind
settings:
verbose: 1
cluster_name: "kind-default"
hostname: "kubernetes" # Use same name as service`s name
volumes:
- name: dockersock
path: /var/run
- name: kubeconfig
path: /root/.kube
depends_on:
- kubernetes
# Add steps for interacting with your kind cluster
- name: kubectl example
image: bitnami/kubectl
commands:
- kubectl cluster-info
depends_on:
- create kind cluster
volumes:
- name: kubeconfig
path: /root/.kube
- name: delete kind cluster
image: otwld/drone-kind
settings:
clean: true
volumes:
- name: dockersock
path: /var/run
- name: kubeconfig
path: /root/.kube
depends_on:
- kubernetes
# Use docker:dind for running kind
services:
- name: kubernetes
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
- name: kubeconfig
temp: {}
- Project must be Trusted, Settings > General > Project Settings > Enable Trusted
- Create a
.drone.yml
file in your root directory. Pipelines examples are available below. For more information, reference the Drone CI Help Documentation for Pipeline Overview
Setting properties | type | default | required | description |
---|---|---|---|---|
version |
string | v0.21.0 |
optional | The kind version to use |
config |
string | |
optional | Config file for kind. For more information on the config file, see the documentation |
node_image |
string | |
optional | The node image to use if specified |
cluster_name |
string | default-kind |
optional | The cluster name |
wait |
string | 60s |
optional | Waiting time for cluster creation |
verbosity |
boolean | false | optional | Enabled verbosity of kind |
kubectl_version |
string | v1.28.6 |
optional | The kubectl version to use |
hostname |
string | kubernetes |
optional | Specify hostname, must match the docker:dind service name |
clean_only |
boolean | false | used for CI | This is used for the CI to delete the cluster. |
install_only |
boolean | false | used for CI | This is used for the CI. |
install_dir |
string | /usr/local/bin |
used for CI | This is used for the CI. |
- For questions, suggestions, and discussion about this plugin please visit Drone Kind Github issue page