|
| 1 | +# Copyright 2025 "Google LLC" |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +blueprint_name: gke-managed-lustre |
| 16 | +vars: |
| 17 | + project_id: # Set GCP Project ID Here |
| 18 | + deployment_name: # Set deployment name |
| 19 | + # Managed Lustre is only supported in specific regions and zones |
| 20 | + # Please refer https://cloud.google.com/managed-lustre/docs/locations |
| 21 | + # The GCP Region used for this deployment. |
| 22 | + region: us-central1 |
| 23 | + # The GCP Zone used for this deployment. |
| 24 | + zone: us-central1-c |
| 25 | + # Cidr block containing the IP of the machine calling terraform. |
| 26 | + # The following line must be updated for this example to work. |
| 27 | + authorized_cidr: <your-ip-address>/32 |
| 28 | + version_prefix: "1.33." |
| 29 | + base_network_name: $(vars.deployment_name) |
| 30 | + lustre_instance_id: gke-lustre-instance |
| 31 | + # The values of size_gib and per_unit_storage_throughput are co-related |
| 32 | + # Please refer https://cloud.google.com/managed-lustre/docs/create-instance#performance-tiers |
| 33 | + # Storage capacity of the lustre instance in GiB |
| 34 | + size_gib: 18000 |
| 35 | + # Maximum throughput of the lustre instance in MBps per TiB |
| 36 | + per_unit_storage_throughput: 1000 |
| 37 | + |
| 38 | +deployment_groups: |
| 39 | +- group: primary |
| 40 | + modules: |
| 41 | + - id: network |
| 42 | + source: modules/network/vpc |
| 43 | + settings: |
| 44 | + network_name: $(vars.base_network_name)-net |
| 45 | + subnetwork_name: $(vars.base_network_name)-subnet |
| 46 | + secondary_ranges_list: |
| 47 | + - subnetwork_name: $(vars.base_network_name)-subnet |
| 48 | + ranges: |
| 49 | + - range_name: pods |
| 50 | + ip_cidr_range: 10.4.0.0/14 |
| 51 | + - range_name: services |
| 52 | + ip_cidr_range: 10.0.32.0/20 |
| 53 | + |
| 54 | + # Private Service Access (PSA) requires the compute.networkAdmin role which is |
| 55 | + # included in the Owner role, but not Editor. |
| 56 | + # PSA is required for all Managed Lustre functionality. |
| 57 | + # https://cloud.google.com/vpc/docs/configure-private-services-access#permissions |
| 58 | + - id: private_service_access |
| 59 | + source: community/modules/network/private-service-access |
| 60 | + use: [network] |
| 61 | + settings: |
| 62 | + prefix_length: 24 |
| 63 | + |
| 64 | + # Firewall to allow Managed Lustre connection |
| 65 | + - id: lustre_firewall_rule |
| 66 | + source: modules/network/firewall-rules |
| 67 | + use: [network] |
| 68 | + settings: |
| 69 | + ingress_rules: |
| 70 | + - name: $(vars.base_network_name)-allow-lustre-traffic |
| 71 | + description: Allow Managed Lustre traffic |
| 72 | + source_ranges: |
| 73 | + - $(private_service_access.cidr_range) |
| 74 | + allow: |
| 75 | + - protocol: tcp |
| 76 | + ports: |
| 77 | + - "988" |
| 78 | + |
| 79 | + - id: managed-lustre |
| 80 | + source: modules/file-system/managed-lustre |
| 81 | + use: [network, private_service_access] |
| 82 | + settings: |
| 83 | + name: $(vars.lustre_instance_id) |
| 84 | + local_mount: /lustre |
| 85 | + remote_mount: lustrefs |
| 86 | + size_gib: $(vars.size_gib) |
| 87 | + per_unit_storage_throughput: $(vars.per_unit_storage_throughput) |
| 88 | + |
| 89 | + - id: node_pool_service_account |
| 90 | + source: community/modules/project/service-account |
| 91 | + settings: |
| 92 | + name: gke-np-sa |
| 93 | + project_roles: |
| 94 | + - logging.logWriter |
| 95 | + - monitoring.metricWriter |
| 96 | + - monitoring.viewer |
| 97 | + - stackdriver.resourceMetadata.writer |
| 98 | + - storage.objectViewer |
| 99 | + - artifactregistry.reader |
| 100 | + |
| 101 | + - id: workload_service_account |
| 102 | + source: community/modules/project/service-account |
| 103 | + settings: |
| 104 | + name: gke-wl-sa |
| 105 | + project_roles: |
| 106 | + - logging.logWriter |
| 107 | + - monitoring.metricWriter |
| 108 | + - monitoring.viewer |
| 109 | + - stackdriver.resourceMetadata.writer |
| 110 | + - storage.objectAdmin |
| 111 | + - artifactregistry.reader |
| 112 | + |
| 113 | + - id: gke_cluster |
| 114 | + source: modules/scheduler/gke-cluster |
| 115 | + use: [network, workload_service_account] |
| 116 | + settings: |
| 117 | + version_prefix: $(vars.version_prefix) |
| 118 | + release_channel: RAPID |
| 119 | + enable_managed_lustre_csi: true # Enable Managed Lustre for the cluster |
| 120 | + configure_workload_identity_sa: true |
| 121 | + enable_private_endpoint: false # Allows for access from authorized public IPs |
| 122 | + master_authorized_networks: |
| 123 | + - display_name: kubectl-access-network |
| 124 | + cidr_block: $(vars.authorized_cidr) |
| 125 | + maintenance_exclusions: |
| 126 | + - name: no-minor-or-node-upgrades-indefinite |
| 127 | + start_time: "2025-08-01T00:00:00Z" |
| 128 | + end_time: "2026-08-01T00:00:00Z" |
| 129 | + exclusion_scope: NO_MINOR_OR_NODE_UPGRADES |
| 130 | + outputs: [instructions] |
| 131 | + |
| 132 | + - id: lustre-pv |
| 133 | + source: modules/file-system/gke-persistent-volume |
| 134 | + use: [managed-lustre, gke_cluster] |
| 135 | + settings: |
| 136 | + capacity_gb: $(vars.size_gib) |
| 137 | + |
| 138 | + - id: gke-lustre-pool |
| 139 | + source: modules/compute/gke-node-pool |
| 140 | + use: [gke_cluster, node_pool_service_account] |
| 141 | + settings: |
| 142 | + name: gke-lustre-pool |
| 143 | + zones: [$(vars.zone)] |
| 144 | + machine_type: n2-standard-16 |
| 145 | + auto_upgrade: true |
0 commit comments