Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argocd Application does not pick the changes in its own annotations/labels and sync options. #19563

Open
3 tasks done
ArunKumarT1995 opened this issue Aug 16, 2024 · 10 comments
Open
3 tasks done

Comments

@ArunKumarT1995
Copy link

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug
Below are the 2 issues I face,

  1. When you add/modify the annotations of the argocd application, sync happens successfully to that commit but the change never gets updated to the application itself.
  2. When you add/modify the sync Options of the argocd application, sync happens successfully to that commit but the change never gets updated to the application itself.

Attached below screenshot.

NOTE : The annotations are only created when the very first deployment of the application itself afterwards we have manually add the annotations in the application.

To Reproduce

Deploy a sample argocd application for your first deployment. Then add a new annotations/labels in the application and push it to the repository. Argocd application will get synced to the latest commit but annotation/labels wont be added.

Same goes for syncOption.

Expected behavior

Screenshots

Annotation change in Argocd Application is not getting updated in the argo application.
image
image
image

Sync Options changes not getting updated in the argo application.

image
image
image

Version

argocd: v2.10.7+b060053.dirty
  BuildDate: 2024-04-15T12:31:39Z
  GitCommit: b060053b099b4c81c1e635839a309c9c8c1863e9
  GitTreeState: dirty
  GoVersion: go1.22.2
  Compiler: gc
  Platform: darwin/arm64
@ArunKumarT1995 ArunKumarT1995 added the bug Something isn't working label Aug 16, 2024
@nitishfy
Copy link
Contributor

nitishfy commented Aug 19, 2024

Hi Arun, thanks for raising the issue.

Annotation change in Argocd Application is not getting updated in the argo application.

Argo CD will be monitoring your GitHub Repository where your application manifests have been deployed. If your Argo CD manifest is not getting monitored by the Argo CD, you can use the kubectl apply command to reflect those changes to the Argo CD UI. If you want Argo CD to update the annotations automatically, you need to make sure that Argo CD monitors your Argo CD application manifest (pass the correct path and see if a resource of kind Application gets created). Generally, you'd let Argo CD monitor your application manifests stored in the GitHub Repository. Any changes to those manifests (deployment, svc...) on the github repo will automatically sync the state. The similar things goes for Sync Options too.

I'd recommend using kubectl apply command to reflect those changes to the Argo CD instead of expecting to changes to get automatically reflected from the github repository when your Argo CD is not monitoring the correct path where the Argo CD manifest is located. Looking at your configuration and resources created, i don't see any resource of kind Application being created which means Argo CD is monitoring the path where your Argo CD manifest has been created.

Let me know if it makes sense to you.

@ArunKumarT1995
Copy link
Author

@nitishfy - My k8s manifest like deploy, svc etc, are present inside the folder nginx and my Argocd Application is present in the root directory of the repo. So you mean to say since my argocd application manifest is configured to monitor nginx folder, it does not pick the changes made to argocd app manifest. Is that right ?

I will try adding root directory in the path and revert back if the issue persist, thanks for replying.

@nitishfy
Copy link
Contributor

yep, try adding the manifest in the path which Argo CD is monitoring and then check if a resource of kind Application gets created.

@nitishfy
Copy link
Contributor

@ArunKumarT1995 did you try this? If you are facing any doubts, don't hesitate to reach out to us on slack.

Are we good enough to close this issue?

@ArunKumarT1995
Copy link
Author

ArunKumarT1995 commented Aug 25, 2024

@nitishfy - sorry for late reply, I did try adding root directory in the path but the application nginx is creating another application nginx inside it (state is out of sync always) which is not what I was looking for.

My expectation is, change the application/applicationset annotation and I should be able to see the changes in argocd UI. I need this feature because based on few annotation, I would send notification to certain email id. The value of the annotation is mutable and I want to make sure only change in git should change the configuration and no manual intervention.

If this feature is not available, I think this will be good feature request. What do you think ?

@nitishfy
Copy link
Contributor

can you share your application manifest?

@ArunKumarT1995
Copy link
Author

@nitishfy - PFB the screenshot for app manifest.

image

Below is the Screenshot from UI

image

@nitishfy
Copy link
Contributor

Please correct me if i am wrong - Suppose you remove an annotation from the application manifest and apply the changes, you mean that the argo cd does not get in sync with the git repository although the status in the UI shows as Synced. Correct?

@ArunKumarT1995
Copy link
Author

No. I dont want to do kubectl apply whenever I make changes in application manifest annotation. I would rather expect argocd to pick it from git commit as part of sync operation.

@ArunKumarT1995
Copy link
Author

@nitishfy - any update ? is this possible with git commit ? or can this be added as feature request ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants