argocd-vault-plugin: FATA[0000] rpc error: code = Unknown desc = multiple application sources defined: Helm,Plugin
Is your feature request related to a problem? Please describe. Below is whats working
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: your-application-name
spec:
destination:
name: ''
namespace: default
server: 'https://kubernetes.default.svc'
source:
path: .
plugin:
name: argocd-vault-plugin
repoURL: http://your-repo/
targetRevision: HEAD
project: default
However, if we want to use source as helm type instead of plain yamls, ie argo application that is of helm source type, and we cant use the plugin together as there is only one type you can use.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ .name }}
namespace: argo-cd
spec:
destination:
namespace: {{ .namespace }}
server: {{ .api }}
project: {{ .argocdProject }}
source:
helm:
valueFiles:
- values.yaml
plugin:
name: argocd-vault-plugin
path: {{ .path }}
repoURL: {{ .repo }}
targetRevision: {{ .targetRevision }}
syncPolicy:
automated:
selfHeal: true
argocd app create argovault-test --config-management-plugin argocd-vault-plugin \
--repo https://github.com/test/test.git \
--path Cluster/test/cluster-resources \
--dest-server https://kubernetes.default.svc \
--dest-namespace default \
--values value.yaml
FATA[0000] rpc error: code = Unknown desc = multiple application sources defined: Helm,Plugin
Describe the solution you’d like
Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered.
Additional context Add any other context or screenshots about the feature request here.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (6 by maintainers)
@ira-gordin-sap That is really up to you on how you want to construct the
plugin
within the argocd-cm file. We do thishelm template $ARGOCD_APP_NAME -n $ARGOCD_APP_NAMESPACE $HELM_ARGS . | argocd-vault-plugin generate -
on my team and it works well.ARGOCD_APP_NAME
andARGOCD_APP_NAMESPACE
are Env Vars that come from Argo CD (https://argo-cd.readthedocs.io/en/stable/user-guide/build-environment/) you can find the helm template docs here https://helm.sh/docs/helm/helm_template/I think the “usage” page in the documentation should be updated to include an example with
-n $ARGOCD_APP_NAMESPACE
@werne2j We just found that
--include-crds
flag is required forhelm template
command. Thanks to my colleague @guymeron🧡🙏🏻 So it should behelm template --include-crds $ARGOCD_APP_NAME -n $ARGOCD_APP_NAMESPACE $BAS_APP_HELM_ARGS . | argocd-vault-plugin generate -
The solution described above or in the docs here (https://ibm.github.io/argocd-vault-plugin/v1.5.0/usage/#with-helm) is going to be the best bet. This is something we do in production and it works pretty well. There isn’t really much more that can be done because of limitations of Argo CD.
This issue https://github.com/argoproj/argo-cd/issues/7623 could make this easier once done but again that is something we can’t control