Skip to content

Commit a8e6352

Browse files
authored
Merge pull request GoogleCloudPlatform#4706 from vikramvs-gg/lustre_readme
Adding readme for example lustre blueprint for GKE
2 parents ac149a1 + 74c71c8 commit a8e6352

1 file changed

Lines changed: 134 additions & 0 deletions

File tree

examples/README.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ md_toc github examples/README.md | sed -e "s/\s-\s/ * /"
2929
* [serverless-batch-mpi.yaml](#serverless-batch-mpiyaml-) ![core-badge]
3030
* [pfs-lustre.yaml](#pfs-lustreyaml-) ![core-badge] ![deprecated-badge]
3131
* [pfs-managed-lustre-vms.yaml](#pfs-managed-lustre-vmsyaml-) ![core-badge]
32+
* [gke-managed-lustre.yaml](#gke-managed-lustreyaml-) ![core-badge]
3233
* [ps-slurm.yaml](#ps-slurmyaml--) ![core-badge] ![experimental-badge]
3334
* [cae-slurm.yaml](#cae-slurmyaml-) ![core-badge]
3435
* [hpc-build-slurm-image.yaml](#hpc-build-slurm-imageyaml--) ![community-badge] ![experimental-badge]
@@ -683,6 +684,139 @@ For this example, the following is needed in the selected region:
683684

684685
[pfs-managed-lustre-vms.yaml]: ./pfs-managed-lustre-vms.yaml
685686

687+
### [gke-managed-lustre.yaml] ![core-badge]
688+
689+
This Cluster Toolkit blueprint deploys a Google Kubernetes Engine (GKE) cluster integrated with Google Cloud Managed Lustre,
690+
providing a high-performance file system for demanding workloads.
691+
692+
#### Features
693+
694+
* **VPC Network:** Sets up a new VPC, subnet, and secondary ranges for GKE pods and services.
695+
* **Private Services Access:** Configures Private Services Access, required for Managed Lustre.
696+
* **Firewall Rules:** Creates firewall rules to allow traffic between GKE nodes and the Managed Lustre instance (port 988).
697+
* **Managed Lustre Instance:** Provisions a Google Cloud Managed Lustre file system instance.
698+
* **Service Accounts:** Creates dedicated service accounts for GKE node pools and workloads with necessary IAM roles.
699+
* **GKE Cluster:** Deploys a GKE cluster with the Managed Lustre CSI driver enabled (`enable_managed_lustre_csi: true`).
700+
* **Persistent Volume:** Creates a Kubernetes PersistentVolume (PV) and PersistentVolumeClaim (PVC) to make the Managed Lustre instance accessible to pods.
701+
* **GKE Node Pool:** Sets up a node pool where application pods can run and mount the Lustre file system.
702+
703+
#### Requirements
704+
705+
1. **Cluster Toolkit:** Ensure you have the Cluster Toolkit (`gcluster`) binary built and ready to use.
706+
2. **GCP Project:** A Google Cloud Project with necessary permissions to create VPCs, GKE clusters, Managed Lustre instances, and related resources.
707+
3. **Quotas:** Sufficient quotas for GCE, GKE, and Managed Lustre resources in the selected region. Note that Managed Lustre capacity and performance tiers have specific quota requirements. See [Managed Lustre Performance Tiers](https://cloud.google.com/managed-lustre/docs/create-instance#performance-tiers) and [Quotas](https://cloud.google.com/managed-lustre/docs/quotas).
708+
4. **GKE Version:** The blueprint is configured for GKE version `1.33.x` or later, as required by the Managed Lustre CSI driver.
709+
5. **Location:** Managed Lustre is only available in specific regions and zones. Verify and adjust based on [Managed Lustre Locations](https://cloud.google.com/managed-lustre/docs/locations).
710+
711+
#### Steps to deploy the blueprint
712+
713+
1. Install Cluster Toolkit
714+
1. Install [dependencies](https://cloud.google.com/cluster-toolkit/docs/setup/install-dependencies).
715+
1. Set up [Cluster Toolkit](https://cloud.google.com/cluster-toolkit/docs/setup/configure-environment).
716+
717+
1. Switch to the Cluster Toolkit directory
718+
719+
```sh
720+
cd cluster-toolkit
721+
```
722+
723+
1. Get the IP address for your host machine
724+
725+
```sh
726+
curl ifconfig.me
727+
```
728+
729+
1. Update the vars block of the blueprint file
730+
1. `project_id`: ID of the project where you are deploying the cluster.
731+
1. `deployment_name`: Name of the deployment.
732+
1. `region / zone`: Ensure these support Managed Lustre.
733+
1. `authorized_cidr`: update the IP address in <your-ip-address>/32.
734+
1. `size_gib`: Capacity of the Managed Lustre instance in GiB.
735+
1. `per_unit_storage_throughput`: Throughput in MB/s per TiB. The combination of size and throughput must match a valid performance tier.
736+
737+
1. Build the Cluster Toolkit binary
738+
739+
```sh
740+
make
741+
```
742+
743+
1. Provision the GKE cluster
744+
745+
```sh
746+
./gcluster deploy examples/gke-managed-lustre.yaml
747+
```
748+
749+
This process can take several minutes as it provisions the VPC, GKE cluster, Managed Lustre instance, and configures the CSI driver.
750+
751+
#### Accessing and Using Managed Lustre
752+
753+
1. Configure kubectl: After successful deployment, configure kubectl to connect to your new GKE cluster:
754+
755+
```sh
756+
gcloud container clusters get-credentials $(vars.deployment_name) \
757+
--region $(vars.region) \
758+
--project $(vars.project_id)
759+
```
760+
761+
Replace `$(vars.deployment_name)`, `$(vars.region)`, and `$(vars.project_id)` with the actual values from your blueprint.
762+
763+
1. Verify PVC: Check that the PersistentVolumeClaim has been created and is Bound:
764+
765+
```sh
766+
kubectl get pvc
767+
```
768+
769+
You should see a PVC named $(vars.lustre_instance_id)-pvc with STATUS: Bound
770+
771+
1. Example Pod: Create a file named lustre-client-pod.yaml to deploy a test pod that mounts the Lustre volume
772+
773+
```sh
774+
apiVersion: v1
775+
kind: Pod
776+
metadata:
777+
name: lustre-client-pod
778+
spec:
779+
containers:
780+
- name: app
781+
image: busybox
782+
command: ["/bin/sh", "-c", "sleep 36000"] # Keep container running
783+
volumeMounts:
784+
- mountPath: "/mnt/lustre"
785+
name: lustre-volume
786+
volumes:
787+
- name: lustre-volume
788+
persistentVolumeClaim:
789+
claimName: $(vars.lustre_instance_id)-pvc # Matches the PVC name
790+
```
791+
792+
Note: This is just an example job using busybox image.
793+
794+
1. Deploy the Pod:
795+
796+
```sh
797+
kubectl apply -f lustre-pod.yaml
798+
```
799+
800+
1. Verify Mount: Once the pod is running, exec into it to check the mount:
801+
802+
```sh
803+
kubectl exec -it lustre-client-pod -- /bin/sh
804+
# Inside the pod:
805+
df -h /mnt/lustre
806+
mount | grep lustre
807+
```
808+
809+
#### Clean Up
810+
To destroy all resources created by this blueprint, run:
811+
812+
```sh
813+
./gcluster destroy CLUSTER-NAME
814+
```
815+
816+
Replace `CLUSTER-NAME` with the `deployment_name` used in blueprint vars block.
817+
818+
[gke-managed-lustre.yaml]: ../examples/gke-managed-lustre.yaml
819+
686820
### [cae-slurm.yaml] ![core-badge]
687821

688822
The Computer Aided Engineering (CAE) blueprint captures a reference architecture

0 commit comments

Comments
 (0)