nephelaiio.kind
nephelaiio.kind
This is an Ansible role that helps you install and remove Kind clusters.
Role Variables
By default, this role will create a 4-node cluster using the latest release of Kind. Here are the variables you can customize:
Parameter | Default | Type | Required | Description |
---|---|---|---|---|
kind_release_tag | latest | string | false | The version of Kind to use from the release page |
kind_image_tag | latest | string | false | The Docker image version from Docker Hub |
kind_cluster_state | present | string | false | Set to create ('present') or remove ('absent') the cluster |
kind_cluster_name | kind | string | false | The name of the cluster you want to create or remove |
kind_network_addr | 172.160.0/16 | string | false | The subnet for the Kind Docker network |
kind_kubeconfig | ~/.kube/config | string | false | Location to save the kubeconfig file for the cluster |
kind_bin | undefined | string | false | Location to save the Kind binary used for deploying the cluster |
kind_registry_deploy | false | bool | false | Create a local registry container |
kind_registry_hostname | localhost | string | false | The hostname for the local Docker registry |
kind_registry_cleanup | true | string | false | Remove the local registry container when the cluster is destroyed |
kind_registry_port | 49153 | integer | false | Port for the local Docker registry |
kind_proxy_deploy | false | bool | false | Create a proxy registry container |
kind_proxy_hostname | localhost | string | false | The hostname for the proxy registry |
kind_proxy_cleanup | true | string | false | Add the proxy registry container to the cluster configuration |
kind_nodes | 4 | integer | false | The number of nodes in the cluster |
Dependencies
System Requirements
Make sure your host meets the following requirements:
- 64-bit Linux or Darwin OS
- The
kubectl
binary must be in your PATH
This role works with arm64 and darwin systems. You need to gather facts before running this role for it to work properly.
If you're using Apple Silicon devices, you must set the environment variable DOCKER_HOST
to unix:///$HOME/.docker/run/docker.sock
, since the default unix:///var/run/docker.sock
is not available on MacOS.
Ansible Requirements
The following Python collections should be installed on the host:
- ansible.utils
Example Playbook
---
- name: deploy Kind cluster
hosts: all
roles:
- nephelaiio.kind
Testing
Ensure that Docker is installed in your environment. Then, run the following commands from the project root to test the role:
poetry install
poetry run molecule test
License
This project is licensed under the MIT License.
ansible-galaxy install nephelaiio.kind