Loading
Slack製品の問い合わせ先はSalesforce Helpへ統合・変更されます続きを読む

Minimally Invasive Way to Restart RTF Apps in Bulk To Preserve Rolling Updates

公開日: Jun 26, 2024
タスク

CONTENTS

You are using RTF and need to restart all your apps via API. Instead of bulk stopping and starting your apps, which can cause some downtime, you want to maintain the Rolling Update feature to minimize downtime.

Original script of reference: RTF Stop and Start Applications in Bulk

If you have existing tools to manage app deployment, then use those existing tools to make a small non-impacting change (e.g. adding a dummy property, which can be removed in the future). Apply the change to all relevant apps, and it will trigger a restart using the selected (e.g. rolling) deployment model.

If you need to do this manually, the below steps explain how to achieve this using API call.

ステップ

STEPS TO FOLLOW

1. Please follow the steps 1-2 in this article: RTF Stop and Start Applications in Bulk
2. Send a PATCH request to make a small non-impacting change. For example, this request will modify the app properties.

a) Check current properties in the app.

curl --silent https://anypoint.mulesoft.com/hybrid/api/v2/organizations/<orgid>/environments/<envid>/deployments/<appid> \
-H "Authorization: Bearer <token>" | jq

b) PATCH request to set new list of properties.

curl --silent -X PATCH "https://anypoint.mulesoft.com/hybrid/api/v2/organizations/<orgid>/environments/<envid>/deployments/<appid>" \
-H "Authorization: Bearer <token>"  \
-H "Content-Type: application/json" \
-d '{"application": {"configuration": {"mule.agent.application.properties.service": {"properties": {"testproperty1": "1", "testproperty2": "2"}}}}}'

3. Or make a different change, such as decreasing the CPU limit by 1. For example, if all apps have a CPU limit of 3.9 vCPU (3900m), change (lower by 1m) it to 3.899 vCPU (3899m).

curl --silent -X PATCH "https://anypoint.mulesoft.com/hybrid/api/v2/organizations/<orgid>/environments/<envid>/deployments/<appid>" \
-H "Authorization: Bearer <token>"  \
-H "Content-Type: application/json" \
-d '{"target": {"deploymentSettings": {"resources": {"cpu": {"limit": "3899"}}}}}'

The above are just examples. The idea is to create a script that sends a PATCH request to all apps (that need to be restarted), by making a small non-impacting change, to trigger a rolling restart. Alternatively, if your app deployments are managed via automation (e.g. Jenkins), you can do the same from there.

ナレッジ記事番号

001117072

 
読み込み中
Salesforce Help | Article