Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions applications/idling-applications.adoc
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
:_mod-docs-content-type: ASSEMBLY
[id="idling-applications"]
= Idling applications
= Reducing resource consumption with application idling
include::_attributes/common-attributes.adoc[]
:context: idling-applications

toc::[]

Cluster administrators can idle applications to reduce resource consumption. This is useful when the cluster is deployed on a public cloud where cost is related to resource consumption.
[role="_abstract"]
As an administrator, you can reduce cluster resource consumption and lower public cloud costs by temporarily scaling inactive application resources to zero replicas.

If any scalable resources are not in use, {product-title} discovers and idles them by scaling their replicas to `0`. The next time network traffic is directed to the resources, the resources are unidled by scaling up the replicas, and normal operation continues.

Applications are made of services, as well as other scalable resources, such as deployment configs. The action of idling an application involves idling all associated resources.

include::modules/idle-idling-applications.adoc[leveloffset=+1]

include::modules/idle-idling-applications-single.adoc[leveloffset=+2]

include::modules/idle-idling-applications-multiple.adoc[leveloffset=+2]

include::modules/idle-unidling-applications.adoc[leveloffset=+1]
12 changes: 6 additions & 6 deletions applications/pruning-objects.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ include::_attributes/common-attributes.adoc[]

toc::[]

[role="_abstract"]
Reclaim cluster storage and optimize API server performance by pruning stale resources. You can run manual CLI commands or configure automated cron jobs to clean up obsolete deployment, build, image, and group records.

Over time, API objects created in {product-title} can accumulate in the
cluster's etcd data store through normal user operations, such as when building
and deploying applications.
Expand Down Expand Up @@ -34,7 +37,7 @@ include::modules/pruning-builds.adoc[leveloffset=+1]
ifndef::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
[role="_additional-resources"]
.Additional resources
* xref:../cicd/builds/advanced-build-operations.adoc#builds-build-pruning-advanced-build-operations[Performing advanced builds -> Pruning builds]
* xref:../cicd/builds/advanced-build-operations.adoc#builds-build-pruning_advanced-build-operations[Performing advanced builds -> Pruning builds]
endif::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]

include::modules/pruning-images.adoc[leveloffset=+1]
Expand All @@ -59,10 +62,7 @@ include::modules/pruning-images-troubleshooting.adoc[leveloffset=+2]
.Additional resources
* xref:../registry/accessing-the-registry.adoc#accessing-the-registry[Accessing the registry]
* xref:../registry/securing-exposing-registry.adoc#securing-exposing-registry[Exposing the registry]
* See
xref:../registry/configuring-registry-operator.adoc#configuring-registry-operator[Image
Registry Operator in {product-title}] for information on how to create a
registry route.
* xref:../registry/configuring-registry-operator.adoc#configuring-registry-operator[Image Registry Operator in {product-title}]
endif::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]

// cannot patch resource "configs"
Expand All @@ -78,7 +78,7 @@ include::modules/pruning-cronjobs.adoc[leveloffset=+1]
.Additional resources
// When the Operators book is added to ROSA/OSD, check if this link is valid.
ifndef::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
* xref:../nodes/jobs/nodes-nodes-jobs.adoc#nodes-nodes-jobs_nodes-nodes-jobs[Running tasks in pods using jobs]
* xref:../nodes/jobs/nodes-nodes-jobs.adoc#nodes-nodes-jobs[Running tasks in pods using jobs]
endif::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
* xref:../applications/quotas/quotas-setting-across-multiple-projects.adoc#setting-quotas-across-multiple-projects[Resource quotas across multiple projects]
// When the Operators book is added to ROSA/OSD, check if this link is valid.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include::_attributes/common-attributes.adoc[]

toc::[]

A multi-project quota, defined by a `ClusterResourceQuota` object, allows quotas to be shared across multiple projects. Resources used in each selected project are aggregated and that aggregate is used to limit resources across all the selected projects.
[role="_abstract"]
A multi-project quota, defined by a `ClusterResourceQuota` object, shares quotas across multiple projects. The system aggregates the resources used in each selected project and applies the aggregate limit across all selected projects.

This guide describes how cluster administrators can set and manage resource quotas across multiple projects.

Expand Down
3 changes: 2 additions & 1 deletion applications/quotas/quotas-setting-per-project.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ include::_attributes/common-attributes.adoc[]

toc::[]

A _resource quota_, defined by a `ResourceQuota` object, provides constraints that limit aggregate resource consumption per project. It can limit the quantity of objects that can be created in a project by type, as well as the total amount of compute resources and storage that might be consumed by resources in that project.
[role="_abstract"]
A resource quota, defined by a `ResourceQuota` object, limits aggregate resource consumption per project. It can limit the quantity of objects that you can create in a project by type, and the total amount of compute resources and storage consumed by resources in that project.

This guide describes how resource quotas work, how cluster administrators can set and manage resource quotas on a per project basis, and how developers and cluster administrators can view them.

Expand Down
9 changes: 8 additions & 1 deletion applications/red-hat-marketplace.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ include::_attributes/common-attributes.adoc[]

toc::[]

The link:https://marketplace.redhat.com[Red Hat Marketplace] is an open cloud marketplace that makes it easy to discover and access certified software for container-based environments that run on public clouds and on-premise.
[role="_abstract"]
The Red Hat Marketplace is an open cloud marketplace that makes it easy to discover and access certified software for container-based environments that run on public clouds and on-premise.

include::modules/red-hat-marketplace-features.adoc[leveloffset=+1]

[role="_additional-resources"]
[id="additional-resources_{context}"]
== Additional resources

* link:https://marketplace.redhat.com[Red Hat Marketplace]
6 changes: 2 additions & 4 deletions applications/working-with-quotas.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ include::_attributes/common-attributes.adoc[]

toc::[]

A _resource quota_, defined by a ResourceQuota object, provides constraints that
limit aggregate resource consumption per project. It can limit the quantity of
objects that can be created in a project by type, as well as the total amount of
compute resources and storage that may be consumed by resources in that project.
[role="_abstract"]
A resource quota, defined by a `ResourceQuota` object, limits aggregate resource consumption per project. You can limit the quantity of objects that you can create in a project by type, and the total amount of compute resources and storage consumed by resources in that project.

An _object quota count_ places a defined quota on all standard namespaced resource
types. When using a resource quota, an object is charged against the quota if it
Expand Down
29 changes: 29 additions & 0 deletions modules/idle-idling-applications-multiple.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Module included in the following assemblies:
//
// * applications/idling-applications.adoc

:_mod-docs-content-type: PROCEDURE
[id="idle-idling-applications-multiple_{context}"]
= Idling multiple services

[role="_abstract"]
Scale multiple inactive services down to zero replicas to optimize cluster capacity.

Idling multiple services is helpful if an application spans across a set of services within a project, or when idling multiple services in conjunction with a script to idle multiple applications in bulk within the same project.

.Procedure

. Create a file containing a list of the services, each on their own line.

. Idle the services using the `--resource-names-file` option:
+
[source,terminal]
----
$ oc idle --resource-names-file <filename>
----
+
[NOTE]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] AsciiDocDITA.TaskStep: Content other than a single list cannot be mapped to DITA steps.

====
The `idle` command is limited to a single project. For idling applications across
a cluster, run the `idle` command for each project individually.
====
19 changes: 19 additions & 0 deletions modules/idle-idling-applications-single.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Module included in the following assemblies:
//
// * applications/idling-applications.adoc

:_mod-docs-content-type: PROCEDURE
[id="idle-idling-applications-single_{context}"]
= Idling a single service

[role="_abstract"]
Scale down the scalable resources of a specific service to zero replicas to reduce cluster consumption.

.Procedure

. To idle a single service, run:
+
[source,terminal]
----
$ oc idle <service>
----
49 changes: 5 additions & 44 deletions modules/idle-idling-applications.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,11 @@
//
// * applications/idling-applications.adoc

:_mod-docs-content-type: PROCEDURE
:_mod-docs-content-type: CONCEPT
[id="idle-idling-applications_{context}"]
= Idling applications
= Application idling

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.
[role="_abstract"]
Identify the scalable resources for one or more services, such as deployment configurations and replication controllers, and scale them down to zero replicas to optimize cluster capacity.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] Vale.Avoid: Avoid using 'deployment configurations'.


You can use the `oc idle` command to idle a single service, or use the
`--resource-names-file` option to idle multiple services.

[id="idle-idling-applications-single_{context}"]
== Idling a single service

.Procedure

. To idle a single service, run:
+
[source,terminal]
----
$ oc idle <service>
----

[id="idle-idling-applications-multiple_{context}"]
== Idling multiple services

Idling multiple services is helpful if an application spans across a set of
services within a project, or when idling multiple services in conjunction with
a script to idle multiple applications in bulk within the same project.

.Procedure

. Create a file containing a list of the services, each on their own line.

. Idle the services using the `--resource-names-file` option:
+
[source,terminal]
----
$ oc idle --resource-names-file <filename>
----

[NOTE]
====
The `idle` command is limited to a single project. For idling applications across
a cluster, run the `idle` command for each project individually.
====
You can use the `oc idle` command to idle a single service, or use the `--resource-names-file` option to idle multiple services.
11 changes: 5 additions & 6 deletions modules/idle-unidling-applications.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@
[id="idle-unidling-applications_{context}"]
= Unidling applications

Application services become active again when they receive network traffic and
are scaled back up their previous state. This includes both traffic to the
services and traffic passing through routes.
[role="_abstract"]
Restore normal application operations by scaling up the replicas when network traffic is directed back to the idled resources.

Applications can also be manually unidled by scaling up the resources.
Application services become active again when they receive network traffic and are scaled back up to their previous state. This includes both traffic to the services and traffic passing through routes. Applications can also be manually unidled by scaling up the resources.

.Procedure

. To scale up a DeploymentConfig, run:
* To scale up a DeploymentConfig, run:
+
[source,terminal]
----
$ oc scale --replicas=1 dc <dc_name>
----

+
[NOTE]
====
Automatic unidling by a router is currently only supported by the default
Expand Down
2 changes: 1 addition & 1 deletion modules/oadp-creating-restore-cr.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ When you restore a stateful application that uses the `azurefile-csi` storage cl

.Prerequisites

* You must install the OpenShift API for Data Protection (OADP) Operator.
* You must install the {oadp-first} Operator.
* The `DataProtectionApplication` CR must be in a `Ready` state.
* You must have a Velero `Backup` CR.
* The persistent volume (PV) capacity must match the requested size at backup time. Adjust the requested size if needed.
Expand Down
2 changes: 1 addition & 1 deletion modules/oadp-review-backup-restore.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Preview the backup and restore resources in advance by doing a dry run of the ba

.Prerequisites

* You have installed the OADP Operator.
* You have installed the {oadp-short} Operator.

.Procedure

Expand Down
3 changes: 3 additions & 0 deletions modules/pruning-basic-operations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
[id="pruning-basic-operations_{context}"]
= Basic pruning operations

[role="_abstract"]
Remove obsolete or unreferenced cluster objects to reclaim cluster storage and maintain optimal API server performance.

The CLI groups prune operations under a common parent command:

[source,terminal]
Expand Down
5 changes: 4 additions & 1 deletion modules/pruning-builds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
[id="pruning-builds_{context}"]
= Pruning builds

[role="_abstract"]
Prune obsolete build records and logs from your cluster to reclaim cluster storage and prevent API performance degradation.

To prune builds that are no longer required by the system due to age and status, administrators can run the following command:

[source,terminal]
Expand Down Expand Up @@ -52,7 +55,7 @@ $ oc adm prune builds --orphans --keep-complete=5 --keep-failed=1 \
$ oc adm prune builds --orphans --keep-complete=5 --keep-failed=1 \
--keep-younger-than=60m --confirm
----

+
[NOTE]
====
Developers can enable automatic build pruning by modifying their build configuration.
Expand Down
9 changes: 4 additions & 5 deletions modules/pruning-cronjobs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
[id="pruning-cronjobs_{context}"]
= Pruning cron jobs

Cron jobs can perform pruning of successful jobs, but might not properly handle
failed jobs. Therefore, the cluster administrator should perform regular cleanup of
jobs manually. They should also restrict the access to cron jobs to a small
group of trusted users and set appropriate quota to prevent the cron job from
creating too many jobs and pods.
[role="_abstract"]
Clean up completed and failed Kubernetes jobs manually to prevent resource exhaustion. You can restrict cron job access to authorized users and configure resource quotas to control job and pod creation.

Cron jobs can perform pruning of successful jobs, but might not properly handle failed jobs. Therefore, the cluster administrator should perform regular cleanup of jobs manually. They should also restrict the access to cron jobs to a small group of trusted users and set appropriate quota to prevent the cron job from creating too many jobs and pods.
3 changes: 3 additions & 0 deletions modules/pruning-deployments.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
[id="pruning-deployments_{context}"]
= Pruning deployment resources

[role="_abstract"]
Delete completed or failed deployment configurations and pod records to free up cluster storage, reduce database clutter, and speed up resource lookups.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] Vale.Avoid: Avoid using 'deployment configurations'.


You can prune resources associated with deployments that are no longer required by the system, due to age and status.

The following command prunes replication controllers associated with `DeploymentConfig` objects:
Expand Down
3 changes: 3 additions & 0 deletions modules/pruning-groups.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
[id="pruning-groups_{context}"]
= Pruning groups

[role="_abstract"]
Remove stale user group records from external identity providers by using the group pruner. Pruning orphaned groups keeps user management data accurate, ensures cluster security, and prevents unauthorized access permissions.

To prune groups records from an external provider, administrators can run the
following command:

Expand Down
19 changes: 10 additions & 9 deletions modules/pruning-hard-pruning-registry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
[id="pruning-hard-pruning-registry_{context}"]
= Hard pruning the registry

The OpenShift Container Registry can accumulate blobs that are not referenced by
[role="_abstract"]
Hard prune the {product-registry} to remove orphaned image blobs that are not referenced in etcd and reclaim registry storage space when standard image pruning is insufficient.

The {product-registry} can accumulate blobs that are not referenced by
the {product-title} cluster's etcd. The basic pruning images procedure,
therefore, is unable to operate on them. These are called _orphaned blobs_.

Expand All @@ -30,7 +33,7 @@ the image objects referencing them to be removed and the blobs becoming orphans.

_Hard pruning_ the registry, a separate procedure from basic image pruning,
allows cluster administrators to remove orphaned blobs. You should hard prune if
you are running out of storage space in your OpenShift Container Registry and
you are running out of storage space in your {product-registry} and
believe you have orphaned blobs.

This should be an infrequent operation and is necessary only when you have
Expand All @@ -40,20 +43,18 @@ day (depending on the number of images being created).

.Procedure

To hard prune orphaned blobs from the registry:

. *Log in.*
. Log in.
+
Log in to the cluster with the CLI as `kubeadmin` or another privileged user that
has access to the `openshift-image-registry` namespace.

. *Run a basic image prune*.
. Run a basic image prune.
+
Basic image pruning removes additional images that are no longer needed. The
hard prune does not remove images on its own. It only removes blobs stored in
the registry storage. Therefore, you should run this just before the hard prune.

. *Switch the registry to read-only mode.*
. Switch the registry to read-only mode.
+
If the registry is not running in read-only mode, any pushes happening at the
same time as the prune will either:
Expand Down Expand Up @@ -131,7 +132,7 @@ Would free up 2.835 GiB of disk space
Use -prune=delete to actually delete the data
----

. *Run the hard prune.*
. Run the hard prune.
+
Execute the following command inside one running instance of a `image-registry` pod to run the hard prune. The following example references an image registry pod called `image-registry-3-vhndw`:
+
Expand All @@ -147,7 +148,7 @@ Deleted 13374 blobs
Freed up 2.835 GiB of disk space
----

. *Switch the registry back to read-write mode.*
. Switch the registry back to read-write mode.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] RedHat.TermsErrors: Use 'read/write' rather than 'read-write'. For more information, see RedHat.TermsErrors.

+
After the prune is finished, the registry can be switched back to read-write
mode. In `configs.imageregistry.operator.openshift.io/cluster`, set
Expand Down
Loading