3.4.3. Scaling up the deployment


Scale the application deployment up or down to meet workload demands.

In Kubernetes, a Deployment object defines how an application deploys. In most cases when you deploy an application, OpenShift Container Platform creates the Pod, Service, ReplicaSet, and Deployment resources for you.

When you deploy the parksmap image, a deployment resource is created. In this example, only one pod is deployed. You might want to scale up your application to keep up with user demand or to ensure that your application is always running even if one pod is down.

The following procedure scales the parksmap deployment to use two instances.

Prerequisites

  • You have deployed the parksmap front-end application.

Procedure

  • Scale your deployment from one pod instance to two pod instances by running the following command:

    $ oc scale --replicas=2 deployment/parksmap

    Example output

    deployment.apps/parksmap scaled

Verification

  • Verify that your deployment scaled up properly by running the following command:

    $ oc get pods

    Example output

    NAME                       READY   STATUS    RESTARTS   AGE
    parksmap-5f9579955-6sng8   1/1     Running   0          7m39s
    parksmap-5f9579955-8tgft   1/1     Running   0          24s

    Verify that two parksmap pods are listed.

    提示

    To scale your deployment back down to one pod instance, pass in 1 to the --replicas option:

    $ oc scale --replicas=1 deployment/parksmap
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部