Having issues updating argocd-cm with Openshift-GitOps?! 🤔

Tal Hason
3 min readDec 8, 2022

--

Openshift-GitOps

if you are using Openshift and using the openshift-GitOps operator you probably Notice that when you are trying to update the argocd-cm directly the operator is reverting the change…

so how do we add a new configuration to our running ArgoCD instance?

after a little research, I found that the ACD CRD, can accept new configurations but that requires us to add some new lines in the YAML

apiVersion: argoproj.io/v1alpha1
kind: ArgoCD

to get to the YAML we have 2 options:
1. Via CLI, by running the following command

oc edit argocd openshift-gitops -n openshift-gitops

2. Via the Console, here you will need to navigate to
Operators → “Installed Operators” → “Openshift-GitOps” → ArgoCD

Openshift-GitOps Instances

you may have more than one instance, so choose the one you want to update with the new configuration, and go to the YAML display.

YAML

Now the update part, for that we need to add a new key under the “spec:” section of the YAML.

spec:
extraConfig: <---------------- this is the extra config key to add.
timeout.reconciliation: 1h <-------------- this is a new configuration

in my sample I added the “kustomize.buildOptions: — enable-helm”, to enable rendering helm charts in kustomized folders.

apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
name: openshift-gitops
namespace: openshift-gitops
spec:
server:
autoscale:
enabled: false
grpc:
ingress:
enabled: false
ingress:
enabled: false
|
V
...
rbac:
policy: |
g, system:cluster-admins, role:admin
g, cluster-admins, role:admin
g, masters, role:admin
scopes: '[groups]'
////////////////////////////////
...
extraConfig:
kustomize.buildOptions: '--enable-helm'
...
////////////////////////////////
|
V
repo:
resources:
limits:
cpu: '1'
memory: 1Gi
requests:
cpu: 250m
memory: 256Mi

After saving the new ArgoCD YAML file. we can now check if the argocd-cm has been updated with the new config.

Updated ConfigMap

Hope you can find this information helpful

now go and do some GitOps with ArgoCD 🤓

--

--