helm-charts
helm-charts copied to clipboard
The first installation prompts that crd resources already exist
In a new kubernetes cluster, the first installation of victoria-metrics-k8s-stack prompts that a crd resource already exists and cannot continue with the installation
helm install victoria-metrics-k8s-stack vm/victoria-metrics-k8s-stack -f values-local-test.yaml -n monitoring --create-namespace
Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "vmagents.operator.victoriametrics.com" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "victoria-metrics-k8s-stack"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "monitoring"
I have the same problem.
W0401 11:15:34.308771 581303 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+ Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "vmagents.operator.victoriametrics.com" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "vmstack"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "monitoring" helm.go:84: [debug] CustomResourceDefinition "vmagents.operator.victoriametrics.com" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "vmstack"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "monitoring" rendered manifests contain a resource that already exists. Unable to continue with install helm.sh/helm/v3/pkg/action.(*Install).RunWithContext helm.sh/helm/v3/pkg/action/install.go:295 main.runInstall helm.sh/helm/v3/cmd/helm/install.go:264
Have the same problem. Have anyone found a solution?
The name of the helm release is the problem. You have to use a very short one like "vm" otherwise the config names are truncated and then there are two with the same truncated name.
you can disable CRDs for victoria-metrics-operator in the values.yaml:
victoria-metrics-operator:
createCRD: false
they will be created here https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-k8s-stack/crds/crd.yaml
kubectl get crd
Find the CRD name you just added and delete it,eg:
kubectl delete crd xxx
Hello all!
It will be a problem when you already have k8s chart installed under one namespace, and reinstalled under other namespace.
Because helm will add key "meta.helm.sh/release-name" and "meta.helm.sh/release-namespace" to resources and check them.
Try uninstall and clean the crds first or use createCRD: false.
Close this now, feel free to reopen if you got further question)