Running 3forge on a Distributed Kubernetes Cluster¶
This guide provides instructions for deploying a distributed AMI application on a Kubernetes cluster. Please read the main Kubernetes page first.
Overview¶
AMI's modular architecture enables easy distributed deployment in a Kubernetes cluster.
For this guide, each AMI component (Center, Web, and Relay) is deployed in its own Kubernetes pod, each running in its own StatefulSet.
This setup uses:
- StatefulSets for each component to provide stable, unique network identifiers (hostnames)
- Headless Services for stable, internal DNS discovery (e.g.,
ami-center-0.ami-center-headless-service) - Cluster IP Service on the Center for internal access
- NodePort Service for external access to the Web component
Requirements¶
- A working Kubernetes cluster
kubectlandkustomizeare installed and configured-
Each AMI component as Docker images (
ami-center,ami-relay,ami-web) hosted in some repository, with correctly configuredlocal.propertiesfiles for each component:Center
Web
Setup¶
Create a new directory named distributed_k8s and place the following YAML files inside it.
This bundles K8s resources.
This defines the Web component and exposes a static port for external access.
This defines the Center component.
This defines the Relay component.
Workflow¶
- Apply the Manifests. From within the
distributed_k8sdirectory, run the followingkustomizecommand to deploy all resources:
- Verify deployment and check the status of your pods and services by running the following command:
-
Access the pod and the AMI interface at
http://<YOUR_NODE_IP>:30080. -
To clean up and delete all the resources created by this guide, run the following command from the
distributed_k8sdirectory: