Member-only story
Ignoring Differences in Argocd
Sometimes, ArgoCD struggles to synchronize dynamic changes in Kubernetes objects. To handle this, we can use the ignoreDifferences
option within our Applications or ApplicationSets. This allows us to ignore specific differences, ensuring that our applications in ArgoCD remain in sync even when certain changes occur.
AppSet Example
Let’s look at an example involving Jenkins. In this scenario, the secret for the Jenkins application is always marked as OutOfSync because we’re using LDAP for user login, making the traditional secret no longer necessary.
YAML example:
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: devops-apps
namespace: argocd
spec:
goTemplate: true
generators:
- list:
elements:
- appName: jenkins
url: https://charts.jenkins.io/
chartName: jenkins
revision: 5.1.21
values:
path: jenkins
- appName: nexus
url: https://stevehipwell.github.io/helm-charts/
chartName: nexus3
revision: 4.45.0
values:
path: nexus
template:
metadata:
name: '{{.appName}}-app'
spec:
project: default
sources:
- repoURL: 'some_repo'
targetRevision: master
ref: values
- chart: '{{.chartName}}'
repoURL: '{{.url}}'…