From 7452036a87317bdc1697c26e3e83dccb00a8cd91 Mon Sep 17 00:00:00 2001 From: Debargho Ghosh Date: Mon, 14 Nov 2022 13:51:11 +0530 Subject: [PATCH] added resource limit added in TOC made review changes made review changes --- _topic_maps/_topic_map.yml | 2 + cicd/gitops/configuring-resource-quota.adoc | 14 ++++ modules/configure-workloads.adoc | 72 +++++++++++++++++++++ modules/patch-argocd-instance.adoc | 21 ++++++ modules/remove-resource-requirements.adoc | 22 +++++++ 5 files changed, 131 insertions(+) create mode 100644 cicd/gitops/configuring-resource-quota.adoc create mode 100644 modules/configure-workloads.adoc create mode 100644 modules/patch-argocd-instance.adoc create mode 100644 modules/remove-resource-requirements.adoc diff --git a/_topic_maps/_topic_map.yml b/_topic_maps/_topic_map.yml index f94edc1af7..cef1687b02 100644 --- a/_topic_maps/_topic_map.yml +++ b/_topic_maps/_topic_map.yml @@ -1716,6 +1716,8 @@ Topics: File: configuring-sso-for-argo-cd-using-keycloak - Name: Configuring Argo CD RBAC File: configuring-argo-cd-rbac + - Name: Configuring Resource Quota + File: configuring-resource-quota - Name: Running Control Plane Workloads on Infra nodes File: run-gitops-control-plane-workload-on-infra-nodes - Name: Sizing requirements for GitOps Operator diff --git a/cicd/gitops/configuring-resource-quota.adoc b/cicd/gitops/configuring-resource-quota.adoc new file mode 100644 index 0000000000..937f1fb3c4 --- /dev/null +++ b/cicd/gitops/configuring-resource-quota.adoc @@ -0,0 +1,14 @@ +:_content-type: ASSEMBLY +[id="configuring-resource-quota"] += Configuring resource quota or requests +include::_attributes/common-attributes.adoc[] +:context: configuring-resource-quota + +toc::[] + +[role="_abstract"] +With the Argo CD Custom Resource, you can create, update, and delete resource requests and limits for Argo CD workloads. + +include::modules/configure-workloads.adoc[leveloffset=+1] +include::modules/patch-argocd-instance.adoc[leveloffset=+1] +include::modules/remove-resource-requirements.adoc[leveloffset=+1] diff --git a/modules/configure-workloads.adoc b/modules/configure-workloads.adoc new file mode 100644 index 0000000000..fe6bbe2658 --- /dev/null +++ b/modules/configure-workloads.adoc @@ -0,0 +1,72 @@ +// Module is included in the following assemblies: +// +// * cicd/gitops/configuring-resource-quota.adoc + +:_content-type: PROCEDURE +[id="configuring-workloads_{context}"] += Configuring workloads with resource requests and limits + +[role="_abstract"] +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. + +[source,yaml] +---- +apiVersion: argoproj.io/v1alpha1 +kind: ArgoCD +metadata: + name: example +spec: + server: + resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 125m + memory: 128Mi + route: + enabled: true + applicationSet: + resources: + limits: + cpu: '2' + memory: 1Gi + requests: + cpu: 250m + memory: 512Mi + repo: + resources: + limits: + cpu: '1' + memory: 512Mi + requests: + cpu: 250m + memory: 256Mi + dex: + resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 250m + memory: 128Mi + redis: + resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 250m + memory: 128Mi + controller: + resources: + limits: + cpu: '2' + memory: 2Gi + requests: + cpu: 250m + memory: 1Gi +---- + diff --git a/modules/patch-argocd-instance.adoc b/modules/patch-argocd-instance.adoc new file mode 100644 index 0000000000..ab4d688c5d --- /dev/null +++ b/modules/patch-argocd-instance.adoc @@ -0,0 +1,21 @@ +// Module is included in the following assemblies: +// +// * cicd/gitops/configuring-resource-quota.adoc + +:_content-type: PROCEDURE +[id="patch-argocd-instance_{context}"] += Patching Argo CD instance to update the resource requirements + +[role="_abstract"] +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. + +[source,terminal] +---- +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"}]' +---- + diff --git a/modules/remove-resource-requirements.adoc b/modules/remove-resource-requirements.adoc new file mode 100644 index 0000000000..455dcf97dc --- /dev/null +++ b/modules/remove-resource-requirements.adoc @@ -0,0 +1,22 @@ +// Module is included in the following assemblies: +// +// * cicd/gitops/configuring-resource-quota.adoc + +:_content-type: PROCEDURE +[id="remove-resource-requirements_{context}"] += Removing resource requests + +[role="_abstract"] +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. + +[source,terminal] +---- +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"}]' + +---- +