Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 5.08 KB

migrate-cf-ce-scale.md

File metadata and controls

67 lines (44 loc) · 5.08 KB
copyright lastupdated keywords subcollection
years
2022, 2024
2024-02-27
code engine, getting started, migrating, cloud foundry
codeengine

{{site.data.keyword.attribute-definition-list}}

Scaling, high availability, and traffic management

{: #migrate-cf-ce-scale}

When your app is deployed to {{site.data.keyword.codeengineshort}}, it is accessible and available for tests and even production. Because {{site.data.keyword.codeengineshort}} provides a serverless platform for containerized workloads, most of your runtime details are managed automatically by {{site.data.keyword.codeengineshort}}. You can, however, control many of the details.

Scaling your app

{: #migrate-scale-app}

When working with Cloud Foundry, you might have setup and used the autoscaling feature, which enabled you to automatically add and remove app instances, depending on performance metrics or date and time. In contrast, {{site.data.keyword.codeengineshort}} autoscales your application by default. {{site.data.keyword.codeengineshort}} scales an app up to 10 runtime instances (by default) and down to zero (meaning that the app does not consume any resources when not in use).

You can edit these settings within the limits and quotas of the {{site.data.keyword.codeengineshort}}. A max scale of 0 (zero) scales your app to the maximum possible, if necessary while a min scale of 1 keeps at least one instance of your application running. By adjusting the concurrency and request timeout, you can tune the autoscaler to your needs. For more information, see Configuring application scaling

High availability

{: #migrate-ha}

For aspects of high availability (and disaster recovery), Cloud Foundry and {{site.data.keyword.codeengineshort}} are similar.

  • Follow best practices for handling concurrent requests.
  • Make sure to have at least two or even three instances of the app up and running.
  • Run app instances in the available zones of a multi-zone region (MZR).
  • Use a global load balancer (GLB) in front of app instances deployed to multiple MZRs for high availability on a global level.

Traffic management and rolling updates

{: #migrate-traffic-mgmt}

To keep your app available when deploying a new version on Cloud Foundry, you use special CLI command options for rolling updates or zero-downtime deployments{: external}. With {{site.data.keyword.codeengineshort}}, the rolling updates are performed automatically. After the new app revision is ready, the traffic is moved from the old app to the new revision.

Performing blue-green deployments and gradually moving traffic from the old app to the new revision required some manual intervention{: external} in Cloud Foundry. With {{site.data.keyword.codeengineshort}}, you can use the capabilities built into its underlying Kubernetes and Knative layers. The blog post, Blue-green deployment with IBM Cloud {{site.data.keyword.codeengineshort}} and Knative{: external}, shows how the Knative CLI command to update the app so that the traffic is configured to split between revisions. Given an app named bluegreen and two revisions rev-old and rev-new, the following command splits the traffic 80/20 between them.

kn service update bluegreen --traffic rev-old=80 --traffic rev-new=20

{: pre}

By adjusting the assigned percentages, you can test new code version with some traffic first and, when your code is ready, run the revision in production.

Next steps

{: #migrate-cf-ce-next-scale}

  1. Just starting your migration? Check out Getting started.
  2. Compare Cloud Foundry terminology with {{site.data.keyword.codeengineshort}}.
  3. Try out {{site.data.keyword.codeengineshort}} with a local build tutorial.
  4. Does your application use service bindings? Check out Migrating your service bindings.
  5. Scaling, high availability, and traffic management (current page)
  6. Find {{site.data.keyword.codeengineshort}} equivalents to Cloud Foundry commands.
  7. Still have questions? Try the Migrating Cloud Foundry applications to {{site.data.keyword.codeengineshort}} FAQ.

Other information