diff --git a/ci/ops-files/concourse-gcp-spot.yml b/ci/ops-files/concourse-gcp-spot.yml index 6c20c4f6d..0083373ee 100644 --- a/ci/ops-files/concourse-gcp-spot.yml +++ b/ci/ops-files/concourse-gcp-spot.yml @@ -8,18 +8,18 @@ # # Note: Spot VMs can be preempted at any time and are recommended for # non-production environments only. +# +# This appends 'spot' to vm_extensions without removing existing extensions +# like 'lb' which is required for load balancer configuration. - type: replace - path: /instance_groups/name=db/vm_extensions? - value: - - spot + path: /instance_groups/name=db/vm_extensions?/- + value: spot - type: replace - path: /instance_groups/name=web/vm_extensions? - value: - - spot + path: /instance_groups/name=web/vm_extensions?/- + value: spot - type: replace - path: /instance_groups/name=worker/vm_extensions? - value: - - spot + path: /instance_groups/name=worker/vm_extensions?/- + value: spot diff --git a/ci/pipelines/bosh-bootloader.yml b/ci/pipelines/bosh-bootloader.yml index 0742a8094..21af3b8a3 100644 --- a/ci/pipelines/bosh-bootloader.yml +++ b/ci/pipelines/bosh-bootloader.yml @@ -975,6 +975,7 @@ jobs: BBL_GCP_REGION: europe-north1 BBL_ENV_NAME: bump-deployments-gcp-concourse BBL_STATE_DIR: bump-deployments/bbl-gcp-concourse + BBL_PLAN_PATCH: spot-gcp DELETE_TERRAFORM_PLUGINS: false input_mapping: bbl-state: relint-envs diff --git a/ci/tasks/bbl-up-concourse/task b/ci/tasks/bbl-up-concourse/task index d24c910b5..13d66d0a3 100755 --- a/ci/tasks/bbl-up-concourse/task +++ b/ci/tasks/bbl-up-concourse/task @@ -29,7 +29,16 @@ function main() { ${name_flag} \ --lb-type concourse > "${root_dir}/bbl_plan.txt" - cp -r ${root_dir}/bbl-ci/plan-patches/spot-gcp . + # Apply plan patch if specified + if [ -n "${BBL_PLAN_PATCH:-}" ]; then + echo "Applying plan patch: ${BBL_PLAN_PATCH}" + if [ -d "${root_dir}/bbl-ci/plan-patches/${BBL_PLAN_PATCH}" ]; then + cp -r "${root_dir}/bbl-ci/plan-patches/${BBL_PLAN_PATCH}" . + else + echo "Warning: Plan patch '${BBL_PLAN_PATCH}' not found" + exit 1 + fi + fi bbl --debug up \ ${name_flag} \ diff --git a/ci/tasks/bbl-up-concourse/task.yml b/ci/tasks/bbl-up-concourse/task.yml index 18276c1fd..ea3f26111 100644 --- a/ci/tasks/bbl-up-concourse/task.yml +++ b/ci/tasks/bbl-up-concourse/task.yml @@ -41,6 +41,7 @@ params: BBL_IAAS: BBL_ENV_NAME: BBL_LB_TYPE: concourse + BBL_PLAN_PATCH: # Optional: Plan patch directory name (e.g., "spot-gcp", "bosh-lite-gcp") GIT_COMMIT_EMAIL: "cf-infrastructure@pivotal.io" GIT_COMMIT_USERNAME: "CI Infra Bot"