Configure CMP via sidecar: error="Manifest generation error: plugin sidecar failed. Couldn't find cmp-server plugin supporting repository .env/dev/workloads/my-app" #9384
-
Hi, In my case, I also had my plugin working using the ConfigMap option. Now I need to change this and configure my CMP via a sidecar like this. The plugin is in this case a tool developed by us that needs to access the code in the git repository to work properly. I have done several tests trying to make this sidecar approach work but I keep getting the following error:
DetailsVersions:
Plugin configuration. As you can see, I've used the same trick of "touching" a file in /tmp to see if the plugin is called, and returning always a non-error code as mentioned in the documentation. apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
name: configurator-plugin
spec:
version: v1.0.1
generate:
command: [sh, -c, 'configurator generate --all -o yaml']
discover:
find:
command: ["touch", "/tmp/plugin-discover-has-run"]
allowConcurrency: true
lockRepo: false The file in /tmp it's created and everything looks good to me. Here some relevant log entries in the sidecar container (cmp) logs:
Here the sidecar definition added repo server deployment: repoServer:
extraContainers:
- name: cmp
command: [/var/run/argocd/argocd-cmp-server] # Entrypoint should be Argo CD lightweight CMP server i.e. argocd-cmp-server
image: my-registry.url/configurator-plugin:v1.0
securityContext:
runAsNonRoot: true
runAsUser: 999
volumeMounts:
- mountPath: /var/run/argocd
name: var-files
- mountPath: /home/argocd/cmp-server/plugins
name: plugins
- mountPath: /tmp
name: tmp-dir And finally an application using the plugin: project: config-management
source:
repoURL: '[email protected]:myorg/repo-config.git'
path: env/dev/workloads/my-app
targetRevision: HEAD
plugin: {}
destination:
server: 'https://XXXXXXXX.xxx.eu-central-1.eks.amazonaws.com'
namespace: monitoring
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- Validate=false
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m I'm following the documentation to the letter and I can't find a solution for this situation. Something that is calling my attention is that all the examples (I couldn't find many) use an echo instruction to generate the manifests, so they are almost useless in real life, where the plugin binary will probably depend on the source code in the cloned repository. Can anybody help with this issue? Maybe we can use this discussion to get a more complete example that other people can use in case of a need to use a sidecar for configuring a CMP. (I read that this could be the only option in the future). Thanks in advance. Last-minute update: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
The docs are incomplete in the stable version. The latest docs include this line:
The |
Beta Was this translation helpful? Give feedback.
-
Hi @crenshaw-dev. About your second point related to the /tmp volume. Yes, I had it configured and I kept it for the test above. Once everything was in green in ArgoCD, I removed the volume mount and then I started having this errors in the sidecar:
and this in the repo server container:
Looks like I need to restore the volume. You mentioned using a different volume for the sidecar. Is this mandatory or using the file system inside the container should be enough? |
Beta Was this translation helpful? Give feedback.
-
I was having the same error and it was very annoying to troubleshoot. In case it helps people, I noticed that sometimes argocd caches the result of the |
Beta Was this translation helpful? Give feedback.
The docs are incomplete in the stable version. The latest docs include this line:
The
find
command has to have non-empty output.echo hi
should work.