You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Helm charts often include explicit default values for certain parameters in the rendered templates. However, when Kubernetes stores these resources in etcd, it removes these default values from the actual state. This discrepancy causes ArgoCD sync issues, as it detects differences between the desired state (explicit defaults) and the actual state (defaults removed).
For example, in the provided ArgoCD configuration file, jqPathExpressions are used to ignore these discrepancies:
While this workaround resolves sync errors, it adds complexity to the configuration.
In addition, here is the full ArgoCD file which allow to install a bunck of stackable operators:
{{ if and .Values.e2e.enabled .Values.stackable.enabled }}{{- range $.Values.stackable.operators }}apiVersion: argoproj.io/v1alpha1kind: Applicationmetadata:
name: "{{ . }}-operator"namespace: argocdlabels:
app.kubernetes.io/name: "{{ . }}-operator"app.kubernetes.io/part-of: finkapp.kubernetes.io/component: operatorfinalizers:
- resources-finalizer.argocd.argoproj.iospec:
project: defaultignoreDifferences:
- group: "apiextensions.k8s.io"kind: "CustomResourceDefinition"# Default values for these fields appears explicitely in desired state but are removed from actual statejqPathExpressions:
- .spec.names.categories | select(. == [])
- .spec.names.shortNames | select(. == [])
- .spec.versions[].additionalPrinterColumns | select(. == [])source:
chart: "{{ . }}-operator"repoURL: https://repo.stackable.tech/repository/helm-stable/targetRevision: 24.11.0helm:
releaseName: "{{ . }}-operator"valuesObject:
resources:
requests:
cpu: "0"memory: "0"destination:
server: "https://kubernetes.default.svc"namespace: stackable-operatorssyncPolicy:
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
- RespectIgnoreDifferences=true
---
{{- end }}{{ end }}
Desired Behavior
Helm templates should avoid explicitly rendering default values that Kubernetes automatically assigns. This would eliminate the need for jqPathExpressions in ArgoCD configurations, simplifying setup and maintenance.
Proposed Solution
Update the Helm chart templates to conditionally omit parameters that match Kubernetes' default values.
For instance:
{{- if .Values.someParameter }}someField: {{ .Values.someParameter }}{{- end }}
Ensure that the templates only render non-default values when explicitly provided.
Benefits
Simplified ArgoCD Configurations: Removing the need for jqPathExpressions in the ignoreDifferences section.
Improved Sync Behavior: Avoid unnecessary diffs between desired and actual states.
Better Alignment with Kubernetes Practices: Align Helm templates with Kubernetes behavior regarding default values.
Impact
This change would enhance compatibility with ArgoCD and improve usability for teams relying on GitOps workflows to manage Helm-based deployments.
Additional Context
For example, with this change, the provided ArgoCD configuration could omit the ignoreDifferences block, as the sync issues caused by explicit defaults would no longer occur.
The text was updated successfully, but these errors were encountered:
thanks for bringing this up. We are aware of the problems and are trying to provide a fix in the next release.
This might take a couple of month though.
However, if you want you can provide a fix in operator-templating. Let us know if you're interested and/or need some guidance.
Problem
Helm charts often include explicit default values for certain parameters in the rendered templates. However, when Kubernetes stores these resources in etcd, it removes these default values from the actual state. This discrepancy causes ArgoCD sync issues, as it detects differences between the desired state (explicit defaults) and the actual state (defaults removed).
For example, in the provided ArgoCD configuration file,
jqPathExpressions
are used to ignore these discrepancies:While this workaround resolves sync errors, it adds complexity to the configuration.
In addition, here is the full ArgoCD file which allow to install a bunck of stackable operators:
Desired Behavior
Helm templates should avoid explicitly rendering default values that Kubernetes automatically assigns. This would eliminate the need for
jqPathExpressions
in ArgoCD configurations, simplifying setup and maintenance.Proposed Solution
For instance:
Benefits
jqPathExpressions
in theignoreDifferences
section.Impact
This change would enhance compatibility with ArgoCD and improve usability for teams relying on GitOps workflows to manage Helm-based deployments.
Additional Context
For example, with this change, the provided ArgoCD configuration could omit the
ignoreDifferences
block, as the sync issues caused by explicit defaults would no longer occur.The text was updated successfully, but these errors were encountered: