$ oc idle <service>
As an OpenShift Container Platform administrator, you can idle applications to reduce resource consumption. This is useful when deployed on a public cloud where cost is related to resource consumption.
If any scalable resources are not in use, OpenShift Container Platform discovers, then idles them, by scaling them to 0 replicas. When network traffic is directed to the resources, they are unidled by scaling up the replicas, then operation continues.
Applications are made of services, as well as other scalable resources, such as deployment configurations. The action of idling an application involves idling all associated resources.
Idling an application involves finding the scalable resources (deployment configurations, replication controllers, and others) associated with a service. Idling an application finds the service and marks it as idled, scaling down the resources to zero replicas.
Idle multiple services by creating a list of the desired services, then using the
--resource-names-file option with the
oc idle command.
This is helpful if an application spans across a set of services, or when idling multiples services in conjunction with a script in order to idle applications in bulk.
Create a file containing a list of the services, each on their own line.
Idle the services using the
$ oc idle --resource-names-file <filename>
Application services become active again when they receive network traffic and will be scaled back up their previous state. This includes both traffic to the services and traffic passing through routes.
Automatic unidling by a router is currently only supported by the default HAProxy router.