1919 podvm-image-id :
2020 type : string
2121 description : prebuilt podvm image
22+ install_method :
23+ default : ' kustomize'
24+ description : Installation method. Either kustomize or helm.
25+ required : false
26+ type : string
2227 secrets :
2328 AZURE_CLIENT_ID :
2429 required : true
3237 podvm-image-id :
3338 type : string
3439 description : prebuilt podvm image
40+ install_method :
41+ default : ' kustomize'
42+ description : Installation method. Either kustomize or helm.
43+ required : false
44+ type : string
3545
3646jobs :
3747 build-caa-container-image :
@@ -211,11 +221,24 @@ jobs:
211221 sudo apt-get install -y sipcalc
212222
213223 - name : Install kustomize
224+ if : ${{ inputs.install_method == 'kustomize' }}
214225 run : |
215226 command -v kustomize >/dev/null || \
216227 curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | \
217228 sudo bash -s /usr/local/bin
218229
230+ - name : Install Helm
231+ if : ${{ inputs.install_method == 'helm' }}
232+ run : |
233+ HELM_VERSION="$(yq -e '.tools.helm.version' versions.yaml)"
234+ HELM_CHECKSUM="$(yq -e '.tools.helm.sha256' versions.yaml)"
235+ curl -fsSL -o helm.tar.gz "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
236+ echo "${HELM_CHECKSUM} helm.tar.gz" | sha256sum --check --strict
237+ tar -xzf helm.tar.gz
238+ sudo mv linux-amd64/helm /usr/local/bin/helm
239+ rm -rf helm.tar.gz linux-amd64
240+ helm version
241+
219242 - name : Restore the configuration created before
220243 uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
221244 with :
@@ -246,6 +269,48 @@ jobs:
246269 AZURE_SUBNET_ID="$subnet_id"
247270 EOF
248271
272+ # Export for helm values step
273+ echo "AZURE_SUBNET_ID=$subnet_id" >> "$GITHUB_ENV"
274+
275+ - name : Create helm values file
276+ if : ${{ inputs.install_method == 'helm' }}
277+ env :
278+ CAA_IMAGE : " ${{ needs.build-caa-container-image.outputs.caa-image }}"
279+ AZURE_IMAGE_ID : " ${{ inputs.podvm-image-id }}"
280+ AZURE_INSTANCE_SIZE : " ${{ matrix.parameters.machine_type }}"
281+ AZURE_SUBSCRIPTION_ID : " ${{ secrets.AZURE_SUBSCRIPTION_ID }}"
282+ AZURE_CLIENT_ID : " ${{ secrets.AZURE_CLIENT_ID }}"
283+ run : |
284+ CAA_IMAGE_TAG="${CAA_IMAGE##*:}"
285+ CAA_IMAGE_NAME="${CAA_IMAGE%:*}"
286+
287+ cat <<EOF > helm-values.yaml
288+ image:
289+ name: "${CAA_IMAGE_NAME}"
290+ tag: "${CAA_IMAGE_TAG}"
291+ providerConfigs:
292+ azure:
293+ AZURE_SUBSCRIPTION_ID: "${AZURE_SUBSCRIPTION_ID}"
294+ AZURE_REGION: "${LOCATION}"
295+ AZURE_RESOURCE_GROUP: "${RG_NAME}"
296+ AZURE_IMAGE_ID: "${AZURE_IMAGE_ID}"
297+ AZURE_INSTANCE_SIZE: "${AZURE_INSTANCE_SIZE}"
298+ AZURE_SUBNET_ID: "${AZURE_SUBNET_ID}"
299+ providerSecrets:
300+ azure:
301+ AZURE_CLIENT_ID: "${AZURE_CLIENT_ID}"
302+ EOF
303+
304+ echo "HELM_VALUES_FILES=$PWD/install/charts/peerpods/providers/azure.yaml,$PWD/helm-values.yaml" >> "$GITHUB_ENV"
305+
306+ # For debugging (without secrets)
307+ echo "::group::helm-values.yaml (structure only)"
308+ echo "image.name: ${CAA_IMAGE_NAME}"
309+ echo "image.tag: ${CAA_IMAGE_TAG}"
310+ echo "providerConfigs.azure: (subscription, region, resource group, image, instance size, subnet)"
311+ echo "providerSecrets.azure: (client id)"
312+ echo "::endgroup::"
313+
249314 - name : Checkout KBS Repository
250315 run : test/utils/checkout_kbs.sh
251316
@@ -254,6 +319,7 @@ jobs:
254319 env :
255320 TEST_PROVISION : " no"
256321 DEPLOY_KBS : " yes"
322+ INSTALL_METHOD : " ${{ inputs.install_method }}"
257323 CUSTOM_PCCS_URL : " https://global.acccache.azure.net/sgx/certification/v4"
258324 CLUSTER_NAME : " ${{ format(env.CLUSTER_NAME_TEMPLATE, matrix.parameters.id) }}"
259325 run : |
0 commit comments