Skip to content

Instantly share code, notes, and snippets.

@yazanmonshed
Created August 15, 2024 13:12
Show Gist options
  • Save yazanmonshed/af4873282f0fb37bea732ae63ca97604 to your computer and use it in GitHub Desktop.
Save yazanmonshed/af4873282f0fb37bea732ae63ca97604 to your computer and use it in GitHub Desktop.
# Using Annotations for Ignoring Differences
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
annotations:
argocd.argoproj.io/compare-options: IgnoreExtraneous
spec:
replicas: 3
...
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
namespace: argocd
spec:
project: default
source:
repoURL: 'https://github.com/your-repo.git'
targetRevision: HEAD
path: 'path/to/your/app'
destination:
server: 'https://kubernetes.default.svc'
namespace: default
syncPolicy:
automated:
prune: true
selfHeal: true
ignoreDifferences:
- group: apps
kind: Deployment
name: my-deployment
jsonPointers:
- /spec/replicas
- /spec/template/spec/containers/0/image
- group: batch
kind: Job
name: my-job
jsonPointers:
- /spec/template/spec/containers/0/command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment