-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Error accumulating resources when using a plugin and overlays points to another repo #9443
Comments
Possibly related: #8820 |
I have the same issue, if kustomize base references other private repo argocd sync gives upper mentioned error, while "builtin" kustomize tool works fine. My CMP looks like this:
Versionargocd: v2.3.1+b65c169 |
+1 |
Hitting the same exact issue. Without a plugin Kustomize with private remote base works properly, but with plugin enabled it does not. |
I faced the same issue in case of using CMP to kustomize building with private repository. Env: |
Hopping on this train, since I believe it's the same issue I had originally reported on #8820. We were able to find a workaround to be able to upgrade to 2.4, but I'm hoping we can eventually solve it in a cleaner way. |
I stuck on same issue by updating latest version of argoCD. My kustomize manifests refers to other version of same repository using remote targets feature of kustomize and it couldn't build with plugin. Applications without plugin work well. |
I've used Git's AskPass to inject credentials in a similar case. Git askpass script in a configmap: https://github.com/HariSekhon/Kubernetes-configs/blob/master/git-askpass.configmap.yaml patch the ArgoCD repo server with this script and environment variables to use the above script and whatever standard k8s secret credentials you want: |
@HariSekhon do you have to run the script manually? or define it in the plugin commands? |
@kxs-sindrakumar it's executed by the |
@HariSekhon so with GIT_ASKPASS env variable set, repo server should automatically authenticate to repo yea? do I need to do anything else besides putting the configmap/patches as you mentioned above? I have the same format of the plugin + app as OP and using your GIT_ASKPASS. Inside the env I see GIT_ASKPASS=/usr/local/bin/git_askpass.sh But still getting manifest generation error or no manifest found. Any ideas? |
@kxs-sindrakumar I've tested it using the 2 files I pasted above in ArgoCD and it worked. This is a very generic Git mechanism that you can test on the command line by just setting the If you read the script in the configmap it'll just output the |
@HariSekhon my apps points to a remote repo kustomize which points to another remote repo. Both of which I have added to https in my argo. Do you have something like this? |
@kxs-sindrakumar I don't do the double hop. The script could in theory account for this based on the repo path, but if you configure the repos to use https and the https creds are in the repo in Argo that should work too as I've tested it with one repo. This is in the comment here: |
@HariSekhon so i can confirm it does look like mine is a git related issue. I copied my kustomization.yaml file which is below into my repo server, then ran kustomize build . from that location and i got a prompt asking me for git username and password, if i didn't enter and just pressed enter enter, I get the error shown below. I have your gitaskpass in there with the correct credentials but it doesn't seem to be working (i am on version 2.4.17). Any ideas? kustomization.yaml:
Error
|
@HariSekhon quick update, so the gitaskpass does work if i am running kustomize build . after shelling into the pod. But automatically it does not. Have you experienced that? |
@kxs-sindrakumar @HariSekhon encountered a similar issue. Can be reproduced by following the setup laid out in the below repo. Any help is much appreciated. |
@abkura i created a ticket yesterday related to this as well. see above mentions. I think this should be a high priority item as i've seen few posts related to it and no solution yet. Who can we tag to get attention on this asap? 2.2 is gong EOL and we can't upgrade at all due to this @crenshaw-dev sos! |
Hi, I wanted to ask if there is any update or workaround for this issue. I have the same problem while setting up argocd with version 2.6.5. The workaround with askpass works when I shell into the pod but during reconciliation it runs kustomize without any errors but the output seems to be empty. |
@kxs-sindrakumar @abkura @Wompipomp I did get it working with the script embedded in yaml (you just need to mount k8s secrets to env vars for the If you're checking out tagged bases from the same private repo, there is a simpler method in the comment in the yaml to just switch your ArgoCD app's repo checkout to use the same https url as the |
@HariSekhon thank you very much for the answer. 🙏 Do you use the plugin via config map or via sidecar configuration? When I try the configuration via config map it seems to work fine but as this is deprecated I have the sidecar configuration which does not seem to have the credentials in the container. Also tried it with different URL versions but in vain. When I use the credentials directly in the url of the remote base (like https://user:pw@...) it works. |
I used it as a configmap to drop the script into the This sounds like an environment problem in your configuration. Ultimately this mechanism is straight Git + environment variables. |
I run into a very similar issue, but related to self-signed certificate rather than authentication. When a remote target repository is resolved inside a plugin sidecar, it does not trust the self-signed certificate for that repository despite the repository being connected and working otherwise (not as a remote target). Furthermore, there is no error and it's hard to understand what's going on. There is no error from the command defined in generate plugin config section, but when using the same command inside init plugin section, it does produce an error in the sidecar logs as expected:
Workaround: env:
- name: GIT_SSL_NO_VERIFY
value: "true" on the plugin sidecar container. |
Due to the limitations of private repos it seems impossible to reference Kustomization base from an Argo Application located in a different repo. Possibly related to: argoproj/argo-cd#9443
Due to the limitations of private repos it seems impossible to reference Kustomization base from an Argo Application located in a different repo. Possibly related to: argoproj/argo-cd#9443
I'm attempting to get the vault plugin working with a Kustomize application and I believe I'm running into this as well. I'm trying to understand the scope of the issue to determine if it's a dealbreaker. From the docs:
Also from the docs:
Needing to run Is there any way to run the kustomize build inside of the repo server and pass the output to the sidecar instead? |
I've spent the last few days addressing this problem myself, and I'd like to offer up what I did as a workaround: I have to use a Github app to authenticate to internal Github, so that means having to do a token exchange. I combined the scripts here: https://gist.github.com/rajbos/8581083586b537029fe8ab796506bec3 to write out the JWT token and POST it to our internal Github API to get a valid token. I had to add jq and a statically built curl to the tools downloader/repo server. In addition to the scripts above, I also added
at the end. I wrote all of this out to a configmap which I mount into the plugin sidecar, finally, during the init phase, I run the script, which will grab a new token and write out the credentials so I'm able to auth into the internal repos. I hope this helps anyone who may come across this issue and hopefully there's a cleaner way to do this in the future. |
For the benefit of anyone else who comes across this: I had a similar problem that I thought was related to this, but wasn't using any plugins. I was specifying my base with a https:// format but needed to use a git@ format, matching the way that the repo that the application was derived from was configured. I missed this in the docs: https://argo-cd.readthedocs.io/en/stable/user-guide/kustomize/#private-remote-bases |
Wild. Me too. Thanks for mentioning it. |
In my case: I was getting below error:
I was having in my case the kubectl plugin thanks, |
I also hit the same issue.I avoided it by changing the configmap.
This way plugging will not hit for all the kustomization.yaml where no secret is defined. When I need to create secret ,I don't use the base config remote repo (Ideally secret should not be there in base config) `apiVersion: kustomize.config.k8s.io/v1beta1
|
Checklist:
argocd version
.Describe the bug
I have the successfully setup a plugin called argocd-vault-plugin and am using it with AWS Secrets and this is true when my Kustomize files all live in the same repo.
Following is the configManagementPlugin section, where you can see the first step is just to run
kustomize build .
before being passed into the vault plugin.I have an application where the overlays are in the same repo but within the overlays kustomization the resources point to another repo. This works fine without the plugin as I have added both repositories to Argocd so it can authenticate and pull the necessary files. Also builds fine locally when I run kustomize build path/to/app
Application implemented with the argocd-vault-plugin-kustomize
When I implement the plugin i then get
I believe it is down to the authentication not being used so it is not able to pull the other repo
Example kustomization.yaml file in overlays
To Reproduce
Add a path to another repo in the resources section of the
kustomization.yaml
fileAdd a plugin to the application sepc
Try and deploy the app
Expected behavior
For the app to build like it does when the plugin is not used
Version
The text was updated successfully, but these errors were encountered: