Managing resource use
Configuring resource requests and limits for Argo CD workloads
Abstract
Chapter 1. Configuring resource quota or requests Copy linkLink copied to clipboard!
With the Argo CD custom resource (CR), you can create, update, and delete resource requests and limits for Argo CD workloads.
1.1. Configuring workloads with resource requests and limits Copy linkLink copied to clipboard!
You can create Argo CD custom resource workloads with resource requests and limits. This is required when you want to deploy the Argo CD instance in a namespace that is configured with resource quotas.
The following Argo CD instance deploys the Argo CD workloads such as Application Controller, ApplicationSet Controller, Dex, Redis,Repo Server, and Server with resource requests and limits. You can also create the other workloads with resource requirements in the same manner.
1.2. Patching Argo CD instance to update the resource requirements Copy linkLink copied to clipboard!
You can update the resource requirements for all or any of the workloads post installation.
Procedure
Update the Application Controller resource requests of an Argo CD instance in the Argo CD namespace.
oc -n argocd patch argocd example --type='json' -p='[{"op": "replace", "path": "/spec/controller/resources/requests/cpu", "value":"1"}]'
oc -n argocd patch argocd example --type='json' -p='[{"op": "replace", "path": "/spec/controller/resources/requests/memory", "value":"512Mi"}]'
oc -n argocd patch argocd example --type='json' -p='[{"op": "replace", "path": "/spec/controller/resources/requests/cpu", "value":"1"}]'
oc -n argocd patch argocd example --type='json' -p='[{"op": "replace", "path": "/spec/controller/resources/requests/memory", "value":"512Mi"}]'
1.3. Removing resource requests Copy linkLink copied to clipboard!
You can also remove resource requirements for all or any of your workloads after installation.
Procedure
Remove the Application Controller resource requests of an Argo CD instance in the Argo CD namespace.
oc -n argocd patch argocd example --type='json' -p='[{"op": "remove", "path": "/spec/controller/resources/requests/cpu"}]'
oc -n argocd argocd patch argocd example --type='json' -p='[{"op": "remove", "path": "/spec/controller/resources/requests/memory"}]'
oc -n argocd patch argocd example --type='json' -p='[{"op": "remove", "path": "/spec/controller/resources/requests/cpu"}]'
oc -n argocd argocd patch argocd example --type='json' -p='[{"op": "remove", "path": "/spec/controller/resources/requests/memory"}]'
Chapter 2. Configure resource requests and limits for GitOps plugin components Copy linkLink copied to clipboard!
You can configure CPU and memory resource requests and limits for the GitOps console plugin and its backend cluster components. Resource allocation is controlled through the GitOpsService custom resource (CR) and can be modified during creation or update. The GitOpsService controller reconciles both the backend and plugin resources. You can define separate or identical resource configurations for each component, depending on your requirements. This feature is beneficial for scenarios requiring specific resource requests and limits for components, which can effectively address memory and performance issues.
2.1. Enabling the GitOpsService custom resource Copy linkLink copied to clipboard!
To enable resource configuration for the GitOps plugin components, specify the .spec.consolePlugin.backend.resources field for the backend component and the .spec.consolePlugin.gitopsPlugin.resources field for the GitOps console plugin. The resources section defines the requests (minimum resources) and limits (maximum resources) for each component.
Prerequisites
- You have logged in to the OpenShift Container Platform cluster as an administrator.
- You have installed the Red Hat OpenShift GitOps Operator on your OpenShift Container Platform cluster.
Procedure
Get the
GitOpsServiceCR by running the following command.oc get gitopsService -A
$ oc get gitopsService -ACopy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
GitOpsServiceCR by running the following command.oc edit gitopsservice cluster -n openshift-gitops
$ oc edit gitopsservice cluster -n openshift-gitopsCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the
.spec.consolePluginsection, add the.backend.resourcesand.gitopsPlugin.resourcesfields. These sections define requests and limits for CPU and memory.Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After you update the GitOpsService CR, the GitOpsService controller applies the specified resource requests and limits to the backend and the GitOps plugin components.
Verification
-
Ensure that the requests and limits values in the pod specifications match the configuration you have added to the
GitOpsServiceCR.
2.2. Behavior of resource configuration Copy linkLink copied to clipboard!
The following information describes how the GitOpsService controller applies resource values defined in the GitOpsService custom resource (CR).
-
Specified values: When you define resource values in the
GitOpsServiceCR, theGitOpsServicecontroller applies those values only to the components you specify. For example, if you configure resource limits only for the backend, those values apply to the backend deployment and not to the plugin. -
Default values: If you do not define any resource values in the
GitOpsServicecustom resource, theGitOpsServicecontroller applies default values to all components.
| Component | Request CPU | Request Memory | Limit CPU | Limit Memory |
|---|---|---|---|---|
| Backend | 250m | 128Mi | 500m | 256Mi |
| GitOps plugin | 250m | 128Mi | 500m | 256Mi |