mertarmagansari
mertarmagansari

Reputation: 21

How to create a sidecar container in ArgoCD deployment yaml?

I am trying to create a sidecar container within ArgoCD itself. So far, I went with extraContainers field in an external values.yaml in order to configure ArgoCD.

extraContainers:
- name: artifactory-cache
     env:
       - name: NGINX_PORT
         value: "8080"
       - name: CACHE_TTL
         value: "20m"
       - name: ARTIFACTORY_HOST
         value: "$ARTIFACTORY_HOST"
     image: path/to/nginx/image
     imagePullPolicy: IfNotPresent
     resources:
       limits:
         cpu: 2
         memory: 2Gi
       requests:
         cpu: 200m
         memory: 200Mi
     volumeMounts:
       - name: artifactory-cache-data
         mountPath: /var/cache/nginx

Simply, I wanted to deploy an intermediate container which will be an nginx proxy cache between Argo and our artifactory. I could manage to cache the artifactory bits with this configuration but syncing apps fail because of a sidecar related error coming from ArgoCD.

The error coming from ArgoCD:

ComparisonError
Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = plugin sidecar failed. could not find plugin supporting the given repository

I think ArgoCD thinks our sidecar container is a plugin, where it should not be. Can you please explain me why ArgoCD fails with this configuration?

ArgoCD version: v2.12.4

I tried creating a sidecar for these; application-controller, repo-server, server, applicationset-controller, yet they all ended up in same result.

Upvotes: 2

Views: 189

Answers (0)

Related Questions