Open Unb0rn opened 2 years ago
@Unb0rn Your JSON has structure:
{
"thanos-query-deployment": {
"apiVersion": "apps/v1",
"kind": "Deployment",
...
},
"thanos-store-statefulSet": {
"apiVersion": "apps/v1",
"kind": "StatefulSet",
...
},
...
}
ArgoCD expects array with plain Kubernetes resource definitions in JSON, like the following output for this jsonnet example:
[
{
"apiVersion": "v1",
"kind": "Service",
...
},
{
"apiVersion": "apps/v1",
"kind": "Deployment",
...
}
]
Instead of dumping named objects with your
{ ['thanos-query-' + name]: finalQ[name] for name in std.objectFields(finalQ) if finalQ[name] != null } +
{ ['thanos-store-' + name]: s[name] for name in std.objectFields(s) if s[name] != null }
, try dumping object fields directly, e.g.:
std.objectFields(finalQ) +
std.objectFields(s)
To get rid of ArgoCD trying to parse jsonnetfile.json
and jsonnetfile.lock.json
, add those files to exclude
list in ArgoCD Application
definition under directory
(doc link):
...
directory:
jsonnet:
libs:
- my-thanos/vendor
exclude: '{jsonnetfile.json,jsonnetfile.lock.json}'
Hope it helps.
Checklist:
argocd version
.Describe the bug I'm trying to deploy kube-thanos project with ArgoCD. I am able to render those manifests locally with something like
jsonnet -J vendor -m manifests 0-thanos-service.jsonnet
but argocd fails with ComparisonErrorTo Reproduce I've created the application manifest:
And jsonnet file describing my customizations:
Expected behavior
ArgoCD successfully renders manifests from jsonnet project and applies them to the cluster.
Screenshots
Version
Logs
kubectl describe application
It looks like valid JSON...