Installs a Kubernetes in Docker (KinD) cluster along with the Gremlin K8s client, Ingress, and the microservices-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 three-node cluster (one control plane and two 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
.
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 Online Boutique/microservices-demo project.
- Install Docker, Kubernetes in Docker (KinD), kubectl, and Helm
- Fill in the
.env
file:GREMLIN_CERT_PATH
: (Optional) the path containing your Gremlin certificates.GREMLIN_TEAM_ID
: (Optional) your Gremlin team IDCLUSTER_NAME
: the name of your cluster. This is how it will appear in Gremlin and Kind.ENV_PLATFORM
: the visual style to use. Can beaws
,onprem
,azure
, or blank for Google Cloud.
- (Optional) customize your KinD cluster by editing
config.yaml
. - Run
run.sh
to create the cluster.- Note: If the cluster already exists, it will be deleted. On Linux, you'll need to run the script using
sudo
or add your user to thedocker
group. - You can choose not to deploy Gremlin or the demo application with the arguments
--no-gremlin
and-no-app
. - If you want to redeploy Gremlin and Online Boutique 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.
When running Online Boutique v0.3.5 locally, the frontend might time out while trying to get info about the cluster name and zone. This adds a ton of lag to the site. If this happens, you'll need to clone the GitHub repository, edit the frontend handler, remove all references to metaServerClient, remove lines 531 and 536, then enter a string for podCluster
and podZone
. Finally, run run.sh --skaffold
to build the project.
If you're using cgroups v2, Gremlin might not detect the containers running on your cluster. You can re-enable the v1 interface by adding systemd.unified_chgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=false
to your kernel parameters (example for Debian here)