Getting started with Kind
This example shows how to create a kind cluster using a blueprint with the Blueprint Operator and an example server installed on it.
Prerequisites
Along with blueprint
CLI, you will also need the following tools:
- kind - required for installing a kind distribution
Create a Kind blueprint
Generate a sample blueprint file using the built in init
command:
bctl init --kind > blueprint.yaml
This will create a blueprint file blueprint.yaml
with a kind cluster definition, and two addons.
Deploy the blueprint
bctl apply --config blueprint.yaml
Connect to the cluster:
kubectl cluster-info
bctl
will create akubeconfig
file in the current directory. Use this file to connect to the cluster.
Update the cluster
Add a wordpress addon to the blueprint.yaml
:
- name: wordpress
kind: chart
enabled: true
namespace: wordpress
chart:
name: wordpress
repo: https://charts.bitnami.com/bitnami
version: 18.0.11
Update your cluster with the modified blueprint:
bctl update --config blueprint.yaml
Verify that the wordpress addon is installed and running:
kubectl get pods --namespace wordpress
You output will look similar to the following:
NAME READY STATUS RESTARTS AGE
helm-install-wordpress-st8rh 0/1 Completed 0 2m58s
wordpress-79d45fc94c-vg7n7 1/1 Running 0 2m49s
wordpress-mariadb-0 1/1 Running 0 2m49s
Access the wordpress page
To connect to the cluster, forward requests to the server by running:
kubectl port-forward --namespace wordpress wordpress-79d45fc94c-vg7n7 8080:8080
This command will need to be left running in the background. It does not return.
You can then access the wordpress page at http://localhost:8080 in your browser.
Delete a cluster
Deleting a cluster is easily done in a single command:
bctl reset --config blueprint.yaml
You can see that the cluster no longer exists by running:
kind get clusters
And verifying that your cluster is no longer listed.