-
Notifications
You must be signed in to change notification settings - Fork 41
fix: principal errors due to forbidden - in bindings subject updated the principal ServiceAccount namespace to argocd (from default) #542
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done intentionally in #428 (comment)
I don't have a strong opinion on whether it's good or bad. Just providing an additional reference.
I think that one is supposed to run If we're considering |
OK, so after a bit of testing, it seems that kustomize will only replace the referred SA's So, we basically have two choices now:
My gut tells me it would be good to follow what Argo CD does, and this is option 1. Users can still install to a different namespace, but need a kustomization patch to do so. But it will be usable out of the box, no changes needed, when going with the standard kustomization base and installing to the argocd namespace. Option 2 would require the user to make a change, regardless of which namespace to install to. So if we're going with option 1, we should also make the same change to the ClusterRoleBinding of the agent's manifests. WDYT? |
My vote is option 1 as well. Setting the namespace to argocd will help us simplify installs. IE. we can remove the first troubleshooting in this doc regarding namespace: https://argocd-agent.readthedocs.io/latest/getting-started/openshift/#troubleshooting |
I see the original intent now. At least we could hint it in the GettingStartedGuide and provide a patch for the case $ git remote show origin
warning: ignoring http.savecookies for empty http.cookiefile
* remote origin
Fetch URL: https://github.com/argoproj-labs/argocd-agent.git
Push URL: https://github.com/argoproj-labs/argocd-agent.git
HEAD branch: main
Remote branches:
dependabot/go_modules/github.com/argoproj/argo-cd/v3-3.1.1 tracked
dependabot/go_modules/github.com/stretchr/testify-1.11.1 tracked
feat/api-proxy tracked
fix/remap-cluster tracked
main tracked
redis-proxy tracked
refs/remotes/origin/dependabot/go_modules/github.com/spf13/cobra-1.10.1 stale (use 'git remote prune' to remove)
release-0.1 tracked
release-0.2 tracked
release-0.3 tracked
Local branch configured for 'git pull':
main merges with remote main
Local ref configured for 'git push':
main pushes to main (local out of date)
$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
$ kubectl apply -n argocd \
-k 'https://github.com/argoproj-labs/argocd-agent/install/kubernetes/principal?ref=main' \
--context "$CONTROL_PLANE_CTX" -oyaml --dry-run=client | grep 'subjects:' -A3
subjects:
- kind: ServiceAccount
name: argocd-agent-principal
namespace: argocd
--
subjects:
- kind: ServiceAccount
name: argocd-agent-principal
namespace: argocd
$ kubectl apply -n argocd \
-k 'https://github.com/argoproj-labs/argocd-agent/install/kubernetes/principal?ref=main' \
--context "$CONTROL_PLANE_CTX" -oyaml --dry-run=server | grep 'subjects:' -A3
subjects:
- kind: ServiceAccount
name: argocd-agent-principal
namespace: default
--
subjects:
- kind: ServiceAccount
name: argocd-agent-principal
namespace: default |
ChatGPT explanation of the inconsistency in behavior https://chatgpt.com/s/t_68ba90803b048191a3ba4e8c366f06d7 |
What does this PR do / why we need it: This PR fixes the CrashLoopBackOff and forbidden errors when argocd-agent-principal is deployed due to ineffective Role and ClusterRole ment to be bound to
argocd-agent-principal
ServiceAccount.Which issue(s) this PR fixes: #403
Fixes #?
How to test changes / Special notes to the reviewer:
The
argocd-agent-principal
ServiceAccount which is the subject of the ClusterRoleBinding and RoleBinding should be deployed toargocd
namespace (according to documentation here) and then non-existent in thedefault
namespace. This PR fixes the false namespace value inargocd-agent-principal
ClusterRoleBinding and RoleBinding subject's namespace keyChecklist