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

Support Extra config-cm entries in Argocd CR

    • 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.

            [GITOPS-1964] Support Extra config-cm entries in Argocd CR

            rhn-support-deghosh Added the release-notes-txt

            Abhishek Veeramalla added a comment - rhn-support-deghosh Added the release-notes-txt

            aveerama@redhat.com please provide the release-notes-text

            Debargho Ghosh (Inactive) added a comment - aveerama@redhat.com please provide the release-notes-text

            Abhishek Veeramalla added a comment - - edited

            I compared the existing fields that operator supports in "Argo CD CR" to update "argocd-cm" against the latest "argocd-cm" in the argocd repo. Below are the missing features.

            1. Argo CD's externally facing base URL (optional).

            2. User's Session Duration:

            • users.session.duration: "24h"

            3. Specifies regex expression for password

            •  passwordPattern: "^.{8,32}$"

            4. The URLs to download additional ArgoCD binaries (besides the Linux amd64 binary included by default). For different OS architectures. If provided, additional download buttons will be displayed on the help page.

            • help.download.linux-arm64: "path-or-url-to-download"
            • help.download.darwin-amd64: "path-or-url-to-download"
            • help.download.darwin-arm64: "path-or-url-to-download" 
            • help.download.windows-amd64: "path-or-url-to-download

            5. Split resource.customizations into sub keys

            • resource.customizations.
            • resource.customizations.actions.apps_Deployment

            6. if ignoreAggregatedRoles set to true then differences caused by aggregated roles in RBAC resources are ignored.

            • ignoreAggregatedRoles: true

            7. Disables status field diffing in specified resource types

            • ignoreResourceStatusField: crd

            8. A set of settings that allow enabling or disabling the config management tool.

            •   kustomize.enabled: true
            •   jsonnet.enabled: true
            •   helm.enabled: true

            9. Comma delimited list of additional custom remote values file schemes (http are https are allowed by default).

            • helm.valuesFileSchemes: http, https

            10. Add an additional local user with apiKey and login capabilities

            • accounts.alice: apiKey, login

            11. Disables user. User is enabled by default

            • accounts.alice.enabled: "false"

            12. An optional user-defined banner message that's displayed at the top of every UI page.

            •   ui.bannercontent: "Hello there!"
            •   ui.bannerurl: "https://argoproj.github.io"

            13. Reconciliation Timeout:

            • timeout.reconciliation: 180s

            14. Cluster.inClusterEnabled indicates whether to allow in-cluster server address. This is enabled by default.

            •   cluster.inClusterEnabled: "true"

            Abhishek Veeramalla added a comment - - edited I compared the existing fields that operator supports in "Argo CD CR" to update "argocd-cm" against the latest "argocd-cm" in the argocd repo. Below are the missing features. 1. Argo CD's externally facing base URL (optional). url: https://argo-cd-demo.argoproj.io 2. User's Session Duration: users.session.duration: "24h" 3. Specifies regex expression for password  passwordPattern: "^.{8,32}$" 4. The URLs to download additional ArgoCD binaries (besides the Linux amd64 binary included by default). For different OS architectures. If provided, additional download buttons will be displayed on the help page. help.download.linux-arm64: "path-or-url-to-download" help.download.darwin-amd64: "path-or-url-to-download" help.download.darwin-arm64: "path-or-url-to-download"  help.download.windows-amd64: "path-or-url-to-download 5. Split resource.customizations into sub keys resource.customizations. resource.customizations.actions.apps_Deployment 6. if ignoreAggregatedRoles set to true then differences caused by aggregated roles in RBAC resources are ignored. ignoreAggregatedRoles: true 7. Disables status field diffing in specified resource types ignoreResourceStatusField: crd 8. A set of settings that allow enabling or disabling the config management tool.   kustomize.enabled: true   jsonnet.enabled: true   helm.enabled: true 9. Comma delimited list of additional custom remote values file schemes (http are https are allowed by default). helm.valuesFileSchemes: http, https 10. Add an additional local user with apiKey and login capabilities accounts.alice: apiKey, login 11. Disables user. User is enabled by default accounts.alice.enabled: "false" 12. An optional user-defined banner message that's displayed at the top of every UI page.   ui.bannercontent: "Hello there!"   ui.bannerurl: "https://argoproj.github.io" 13. Reconciliation Timeout: timeout.reconciliation: 180s 14. Cluster.inClusterEnabled indicates whether to allow in-cluster server address. This is enabled by default.   cluster.inClusterEnabled: "true"

              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: