@@ -67,27 +67,39 @@ var _ = Describe("BYOK", func() {
6767 It ("should provision a VM with customer-managed key disk encryption" , func () {
6868 ctx := context .Background ()
6969 var diskEncryptionSetID string
70+
71+ By ("Phase 1: Setting up DES (Disk Encryption Set)" )
7072 // If not InClusterController, assume the test setup will include the creation of the KV, KV-Key + DES
7173 if env .InClusterController {
7274 diskEncryptionSetID = CreateKeyVaultAndDiskEncryptionSet (ctx , env )
7375 env .ExpectSettingsOverridden (corev1.EnvVar {Name : "NODE_OSDISK_DISKENCRYPTIONSET_ID" , Value : diskEncryptionSetID })
7476 }
7577
78+ By ("Phase 2: Creating NodeClass and NodePool" )
7679 nodeClass := env .DefaultAKSNodeClass ()
7780 nodePool := env .DefaultNodePool (nodeClass )
7881
82+ By ("Phase 3: Creating test Pod" )
7983 pod := test .Pod ()
84+
85+ By ("Applying resources to Kubernetes" )
8086 env .ExpectCreated (nodeClass , nodePool , pod )
87+
88+ By ("Phase 4: Waiting for VM to be created and node to be registered" )
89+ env .EventuallyExpectCreatedNodeCount ("==" , 1 )
90+
91+ By ("Phase 5: Verifying Pod becomes healthy" )
8192 env .EventuallyExpectHealthy (pod )
82- env .ExpectCreatedNodeCount ("==" , 1 )
8393
94+ By ("Phase 6: Verifying VM disk encryption configuration" )
8495 vm := env .GetVM (pod .Spec .NodeName )
8596 Expect (vm .Properties ).ToNot (BeNil ())
8697 Expect (vm .Properties .StorageProfile ).ToNot (BeNil ())
8798 Expect (vm .Properties .StorageProfile .OSDisk ).ToNot (BeNil ())
8899 Expect (vm .Properties .StorageProfile .OSDisk .ManagedDisk ).ToNot (BeNil ())
89100 Expect (vm .Properties .StorageProfile .OSDisk .ManagedDisk .DiskEncryptionSet ).ToNot (BeNil ())
90101 Expect (vm .Properties .StorageProfile .OSDisk .ManagedDisk .DiskEncryptionSet .ID ).ToNot (BeNil ())
102+
91103 if env .InClusterController {
92104 Expect (lo .FromPtr (vm .Properties .StorageProfile .OSDisk .ManagedDisk .DiskEncryptionSet .ID )).To (Equal (diskEncryptionSetID ))
93105 }
@@ -96,38 +108,51 @@ var _ = Describe("BYOK", func() {
96108 It ("should provision a VM with ephemeral OS disk and customer-managed key disk encryption" , func () {
97109 ctx := context .Background ()
98110 var diskEncryptionSetID string
111+
112+ By ("Phase 1: Setting up DES (Disk Encryption Set)" )
99113 // If not InClusterController, assume the test setup will include the creation of the KV, KV-Key + DES
100114 if env .InClusterController {
101115 diskEncryptionSetID = CreateKeyVaultAndDiskEncryptionSet (ctx , env )
102116 env .ExpectSettingsOverridden (corev1.EnvVar {Name : "NODE_OSDISK_DISKENCRYPTIONSET_ID" , Value : diskEncryptionSetID })
103117 }
104118
119+ By ("Phase 2: Creating NodeClass with ephemeral disk configuration" )
105120 nodeClass := env .DefaultAKSNodeClass ()
106121 nodePool := env .DefaultNodePool (nodeClass )
107122
123+ By ("Phase 3: Configuring ephemeral OS disk requirement" )
108124 test .ReplaceRequirements (nodePool , karpv1.NodeSelectorRequirementWithMinValues {
109125 NodeSelectorRequirement : corev1.NodeSelectorRequirement {
110126 Key : v1beta1 .LabelSKUStorageEphemeralOSMaxSize ,
111127 Operator : corev1 .NodeSelectorOpGt ,
112128 Values : []string {"50" },
113129 }})
114-
115130 nodeClass .Spec .OSDiskSizeGB = lo.ToPtr [int32 ](50 )
116131
132+ By ("Phase 4: Creating test Pod" )
117133 pod := test .Pod ()
134+
135+ By ("Applying resources to Kubernetes" )
118136 env .ExpectCreated (nodeClass , nodePool , pod )
137+
138+ By ("Phase 5: Waiting for VM to be created and node to be registered" )
139+ env .EventuallyExpectCreatedNodeCount ("==" , 1 )
140+
141+ By ("Phase 6: Verifying Pod becomes healthy" )
119142 env .EventuallyExpectHealthy (pod )
120- env .ExpectCreatedNodeCount ("==" , 1 )
121143
144+ By ("Phase 7: Verifying VM disk configuration" )
122145 vm := env .GetVM (pod .Spec .NodeName )
123146 Expect (vm .Properties ).ToNot (BeNil ())
124147 Expect (vm .Properties .StorageProfile ).ToNot (BeNil ())
125148 Expect (vm .Properties .StorageProfile .OSDisk ).ToNot (BeNil ())
126149
150+ By ("Phase 8: Verifying ephemeral OS disk settings" )
127151 Expect (vm .Properties .StorageProfile .OSDisk .DiffDiskSettings ).ToNot (BeNil ())
128152 Expect (vm .Properties .StorageProfile .OSDisk .DiffDiskSettings .Option ).ToNot (BeNil ())
129153 Expect (string (lo .FromPtr (vm .Properties .StorageProfile .OSDisk .DiffDiskSettings .Option ))).To (Equal ("Local" ))
130154
155+ By ("Phase 9: Verifying DES is configured on managed disk" )
131156 Expect (vm .Properties .StorageProfile .OSDisk .ManagedDisk ).ToNot (BeNil ())
132157 Expect (vm .Properties .StorageProfile .OSDisk .ManagedDisk .DiskEncryptionSet ).ToNot (BeNil ())
133158 Expect (vm .Properties .StorageProfile .OSDisk .ManagedDisk .DiskEncryptionSet .ID ).ToNot (BeNil ())
0 commit comments