Skip to content

Commit 38a3c02

Browse files
authored
Update integration tests to validate CMEK support in Managed Lustre (#5757)
1 parent 6d9946a commit 38a3c02

8 files changed

Lines changed: 38 additions & 1 deletion

File tree

examples/gke-managed-lustre.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ vars:
3535
size_gib: 36000
3636
# Maximum throughput of the lustre instance in MBps per TiB
3737
per_unit_storage_throughput: 500
38+
kms_key: ""
3839

3940
deployment_groups:
4041
- group: primary
@@ -86,6 +87,7 @@ deployment_groups:
8687
remote_mount: lustrefs
8788
size_gib: $(vars.size_gib)
8889
per_unit_storage_throughput: $(vars.per_unit_storage_throughput)
90+
kms_key: $(vars.kms_key)
8991

9092
- id: node_pool_service_account
9193
source: modules/project/service-account

examples/pfs-managed-lustre-slurm.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ vars:
3434
lustre_size_gib: 36000
3535
# Maximum throughput of the lustre instance in MBps per TiB
3636
per_unit_storage_throughput: 500
37+
kms_key: ""
3738

3839
# Documentation for each of the modules used below can be found at
3940
# https://github.com/GoogleCloudPlatform/hpc-toolkit/blob/main/modules/README.md
@@ -58,6 +59,7 @@ deployment_groups:
5859
remote_mount: lustrefs
5960
size_gib: $(vars.lustre_size_gib)
6061
per_unit_storage_throughput: $(vars.per_unit_storage_throughput)
62+
kms_key: $(vars.kms_key)
6163

6264
- group: slurm-cluster
6365
modules:

modules/file-system/managed-lustre/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ resource "google_lustre_instance" "lustre_instance" {
7373
network = var.network_id
7474

7575
gke_support_enabled = var.gke_support_enabled
76-
kms_key = var.kms_key
76+
kms_key = var.kms_key == "" ? null : var.kms_key
7777

7878
timeouts {
7979
create = "1h"

tools/cloud-build/daily-tests/ansible_playbooks/test-validation/test-gke-managed-lustre.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,6 @@
218218
delegate_to: localhost
219219
ansible.builtin.command: kubectl delete pod lustre-test-pod --ignore-not-found=true
220220
changed_when: True
221+
222+
- name: Verify Lustre KMS Key
223+
ansible.builtin.include_tasks: verify-lustre-cmek.yml

tools/cloud-build/daily-tests/ansible_playbooks/test-validation/test-managed-lustre-slurm.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@
5454
ansible.builtin.file:
5555
path: "/{{ custom_vars.output_dir }}/{{ item }}.txt"
5656
state: absent
57+
58+
- name: Verify Lustre KMS Key
59+
ansible.builtin.include_tasks: verify-lustre-cmek.yml
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2026 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+
- name: Verify Lustre instance is encrypted with the expected KMS key
16+
ansible.builtin.command: >
17+
gcloud lustre instances describe {{ cli_deployment_vars.lustre_instance_id }}
18+
--location={{ zone }} --project={{ custom_vars.project }}
19+
--format='value(kmsKey)'
20+
delegate_to: localhost
21+
register: lustre_kms_key
22+
changed_when: false
23+
failed_when: lustre_kms_key.rc != 0 or lustre_kms_key.stdout | trim != cli_deployment_vars.kms_key
24+
when: cli_deployment_vars is defined and cli_deployment_vars.kms_key is defined and cli_deployment_vars.kms_key != ""

tools/cloud-build/daily-tests/tests/gke-managed-lustre.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ cli_deployment_vars:
3535
size_gib: "{{ size_gib }}"
3636
per_unit_storage_throughput: "{{ per_unit_storage_throughput }}"
3737
gcp_public_cidrs_access_enabled: true
38+
kms_key: "projects/{{ project }}/locations/us-central1/keyRings/lustre-keyring/cryptoKeys/lustre-key"

tools/cloud-build/daily-tests/tests/pfs-managed-lustre-slurm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ cli_deployment_vars:
2727
compute_node_machine_type: c2-standard-4
2828
slurm_cluster_name: "{{ slurm_cluster_name }}"
2929
lustre_instance_id: "lustre-instance-{{build}}"
30+
kms_key: "projects/{{ project }}/locations/us-central1/keyRings/lustre-keyring/cryptoKeys/lustre-key"
3031
# Note: Pattern matching in gcloud only supports 1 wildcard.
3132
login_node: "{{ slurm_cluster_name }}-slurm-login-*"
3233
controller_node: "{{ slurm_cluster_name }}-controller"
@@ -35,6 +36,7 @@ post_deploy_tests:
3536
- test-validation/test-mounts.yml
3637
- test-validation/test-managed-lustre-slurm.yml
3738
custom_vars:
39+
project: "{{ project }}"
3840
output_dir: /lustre/test
3941
num_slurm_nodes: 1
4042
mounts:

0 commit comments

Comments
 (0)