Generator for kind k8s clusters
Project description
kindtool
Python program for simplyfing workflows with kind.
kind is a tool for running local Kubernetes clusters using Docker container “nodes”.
With kindtool you can add a simple Kindfile
to your project. You can crate, destroy, start and maintain a k8s
cluster for ci or development.
Installation
Requirements:
- docker
- python3
- kind
- kubectl
- optional: helm
Kind installation
Official documentation: https://kind.sigs.k8s.io/docs/user/quick-start/
Fast lane:
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
KIND_LATEST=$(get_latest_release kubernetes-sigs/kind)
ARCH=$(dpkg --print-architecture 2>/dev/null || echo "amd64")
curl -Lo ./kind https://kind.sigs.k8s.io/dl/${KIND_LATEST}/kind-linux-${ARCH}
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
Kindtool installation
$ pip3 install kindtool
Kubectl installation
- Linux: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
- Windows: https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/
Helm installation
Workflow
# creates a new Kindfile (edit for your needs)
$ kindtool init -d <projectdir>
# creates the cluster - this will create a .kind directory next to Kindfile
$ kindtool up
# kills the kind cluster - configuration, k8s config is removed,
# the persistent data will be kept in .kind/data
$ kindtool destroy
# kills the kind cluster and removes the data folder
# this needs to be run as root! Docker might created files that have 0/0 uids/gids
$ sudo kindtool destroy -f
# is kind running - print status information
$ kindtool status
# start the k8s dashboard
$ kindtool dashboard
# returns the directory with the config files
# can be used as export KUBECONFIG=$(kindfile get kubeconfig)
$ kindtool get kubeconfig
Examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kindtool-0.0.4.tar.gz
(16.3 kB
view details)
File details
Details for the file kindtool-0.0.4.tar.gz
.
File metadata
- Download URL: kindtool-0.0.4.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
bb702c6813b7d493c5d0e18231c685508af0b1baaa57bb648db60e6e164849cf
|
|
MD5 |
0281c59d1c45bb6012efd48bab4c0c26
|
|
BLAKE2b-256 |
5096efec3449f56daf572de3925e8dcda7c869bac9bc350043012a5dbd0085c2
|