cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
149 stars 45 forks source link

[Bug]: can't override argocd config settings with idpbuilder create -c argocd:argocd-cm.yaml #298

Closed csantanapr closed 1 week ago

csantanapr commented 2 weeks ago

What is your environment, configuration, and command?

idpbuilder v0.5.0

What did you do and What did you see instead?

Lets say I want to have different value for argocd cm config like timeout.reconciliation: 10s instead of the default 180s

make sure you starting with no cluster kind delete cluster --name localdev

create argocd-cm.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
data:
  application.resourceTrackingMethod: annotation
  resource.exclusions: |
    - kinds:
        - ProviderConfigUsage
      apiGroups:
        - "*"
  timeout.reconciliation: 10s

run

idpbuilder create -c argocd:argocd-cm.yaml

Check the config map has the new override of 10s

 k get cm -n argocd argocd-cm -o yaml | grep "timeout.reconciliation: 10s" 
  timeout.reconciliation: 10s

Check if environment variable is set on app controllers, as you can see its not set

k exec -n argocd argocd-application-controller-0 -- env | grep ARGOCD_RECONCILIATION_TIMEOUT 
<nothing>

Restart pod and see that the setting is set. The configmap with the override is apply after deploying argocd this should be done before.

k rollout restart -n argocd sts/argocd-application-controller
k exec -n argocd argocd-application-controller-0 -- env | grep ARGOCD_RECONCILIATION_TIMEOUT 
ARGOCD_RECONCILIATION_TIMEOUT=10s

Additional Information. Logs.

No response

csantanapr commented 2 weeks ago

override for config that controllers fetch dynamically like secrets to connect to helm http/oci or git repos, but not config maps that configure optional environment variables of the controllers

for example in this case here https://github.com/argoproj/argo-cd/blob/master/manifests/install.yaml#L22780-L22785

        - name: ARGOCD_RECONCILIATION_TIMEOUT
          valueFrom:
            configMapKeyRef:
              key: timeout.reconciliation
              name: argocd-cm
              optional: true
ricker-flow commented 2 weeks ago

The documentation here appears to be incorrect https://github.com/cnoe-io/idpbuilder/blob/main/docs/pluggable-packages.md#runtime-git-server-content-generation