Installs a Kubernetes in Docker (KinD) cluster along with the Gremlin Kubernetes client, Ingress, and the Bank of Anthos demo application. This is a quick and easy way to get started with a "multi-node" Kubernetes cluster on your local computer or in a VM.
By default, this creates a four-node cluster (one control plane and three workers). For more configuration info, see https://kind.sigs.k8s.io/docs/user/configuration/. Port 80 is mapped from the control plane to your local system, and the Kubernetes API is exposed on 127.0.0.1:6443. You can configure the cluster using the config.yaml file.
Kind is a quick and easy way to create multi-node Kubernetes clusters. This is great for running node-level chaos experiments like node shutdown, blackhole, and control plane failure. You can target nodes, Pods, Deployments, Daemonsets, and other K8s resources through Gremlin just like a normal cluster. Since creating a Kind cluster is faster, less complicated, and less resource-intensive than a VM-based setup like K3s, you can easily recreate the cluster if something breaks.
Note that this cluster is meant for testing Kubernetes and Gremlin, not for running production applications. I recommend running in a virtual machine.
First, run git submodule update --init --recursive to download the Bank of Anthos demo project.
- Install Docker (or Podman or a similar runtime), Kubernetes in Docker (KinD), kubectl, and Helm
- Fill in the
.envfile:GREMLIN_CONFIG_FILE_PATH: the path to your Gremlinvalues.yamlfile. To get this file, go to the Getting Started page in the Gremlin web app and click the values.yaml link under the "Install the Gremlin Agent" step.GREMLIN_STAGING_CONFIG_FILE_PATH: (Optional) the path tovalues.yamlfor the staging environment.CLUSTER_NAME: the name of your cluster. This is how it will appear in Gremlin and in Kind.APP_REPLICAS: (Optional) how many replicas of each Deployment in the demo application you want to use. Defaults to 2.
- (Optional) customize your KinD cluster by editing
config.yaml. - Run
run.shto create the cluster.- Note: If the cluster already exists, it will be deleted. On Linux, you'll need to run the script using
sudoor add your user to thedockergroup. - You can choose not to deploy Gremlin or the demo application with the arguments
--no-gremlinand-no-app. - If you want to redeploy Gremlin and the demo app only without rebuilding the cluster, add the argument
--no-cluster.
- Note: If the cluster already exists, it will be deleted. On Linux, you'll need to run the script using
- Access the application using http://127.0.0.1.