Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-1964

Support Extra config-cm entries in Argocd CR

XMLWordPrintable

    • False
    • None
    • False
    • With this update, you can add entries to the argocd-cm configMap using the extraConfig field of Red Hat OpenShift GitOps Argo CD custom resource. The entries specified are reconciled to the live config-cm configMap without validations.
    • GITOPS Sprint 218

      Problem Statements

      • As the Argo CD upstream project evolves, new features are continuously added and new config-cm configurations are constantly introduced. Argocd Operator is virtually impossible to keep up with Argo CD’s new configurations. Argocd Operator is lagging behind to support new Argo CD features in months or more
      • Oftentimes to support a new feature, it is as simple as reconciling a config-cm entry. For example,https://github.com/argoproj-labs/argocd-operator/pull/598 introduced a map entry application.resourceTrackingMethod. However, the code to make this a first class configuration as a field Argocd CR required to touch 10+ files. It takes quite  a bit of engineering effort to reconcile just one new config-cm entry. Since we make a new field in Arogcd CR, the user will have to read the Argocd Operator’s manual in order to figure out the name of the field even though the user may already know the config-cm entry key.

      Proposed Solution

      Going forward, we enable users to add extra config-cm map entries in Argocd CR. We call this the extraConfig field in Argocd CR  The value of the extraConfig is key-value pairs  It is completely optional and has no default value. Therefore, when extraConfig is not set, the behavior is exactly the same as how it is today. When extraConfig  is set, the entries specified are reconciled to the live config-cm configmap without validations. Users can specify arbitrary configmap entries with the extraConfig .  Hence, users can use the extraConfig field to specify a new configuration even though the configuration is introduced after the argocd operator is released.  A nice thing is that it does not require any code changes in argocd operator to support a new configuration (well, in config-cm anyways).

      Here is an example of an Argocd CR enabled with extraConfig.  In this example, supporting ,https://github.com/argoproj-labs/argocd-operator/pull/59 could have been replaced with the specifying application.resourceTrackingMethod  in extraConfig.

       

      apiVersion: argoproj.io/v1alpha1
      kind: ArgoCD
      metadata:
       name: example-argocd
      spec:
       extraConfig:
         application.resourceTrackingMethod:label

      extraConfig can be used to override the first class configuration. Using https://github.com/argoproj-labs/argocd-operator/pull/59 as an example, that PR introduces first class configuration field resourceTrackingMethod in the Argocd CR.

      The following example CR has resourceTrackingMethod set in both first class configuration and extraConfig. The value(annotation) in extraConfig overrides the value (label) in first class configuration. 

      apiVersion: argoproj.io/v1alpha1
      kind: ArgoCD
      metadata:
       name: example-argocd
      Spec:
       extraConfigresourceTrackingMethod:label 
       extraConfig:
         application.resourceTrackingMethod:annotation

      Removing an entry from extraConfig will make the controller stop reconciling the entry. It does NOT remove the entry from the live config-cm.

      Acceptance Criteria:
      1. Track missing Argo CD features that can be added to the operator by updating the Argo CD configmap.
      2. Implement the missing features using the above proposed solution.
      3. Test the Implementation of proposed solution.

            aveerama@redhat.com Abhishek Veeramalla
            aveerama@redhat.com Abhishek Veeramalla
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: