2

kubectl get ns gives the following namespaces

communication-prod   Active   69d
custom-metrics       Active   164d
default              Active   218d
kube-node-lease      Active   218d
kube-public          Active   218d
kube-system          Active   218d
notification         Active   191d
notification-stock   Active   118d

However when I am running the following helm command

helm install instana-agent \
  --repo https://agents.instana.io/helm \
  --namespace instana-agent \
  --create-namespace \
  --set agent.key=foo\
  --set agent.downloadKey=bar \
  --set agent.endpointHost=ingress-green-saas.instana.io \
  --set agent.endpointPort=443 \
  --set cluster.name='communication-engine-prod' \
  --set zone.name='asia-south1' \
  instana-agent

I am getting the following error

Error: INSTALLATION FAILED: rendered manifests contain a resource that already 
exists. Unable to continue with install: ClusterRole "instana-agent" 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
"instana-agent"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "instana-agent"

can anyone point me to the reason why I might be getting the error?

isnvi23h4
  • 1,910
  • 1
  • 27
  • 45

2 Answers2

1

This looks like you installed the agent using kubectl and then deleted the namespace before trying helm. You need to delete all of the resources that were created in your first installation attempt. The easiest way to do this is to do:

kubectl delete -f configuration.yaml

using the same configuration file you used to install the agent (or you can generate a new one from the Instana dashboard if you didn't modify it). You could also use kubectl get clusterroles and kubectl get clusterrolebindings to get the entities that you will need to delete with kubectl delete

1

I had similar issue when trying to install using Instana operator. I had to clean up custom resources, like instana-agent, also clusterrole and clusterrolebinding. Then agent was successfully instantiated.

Gas
  • 17,601
  • 4
  • 46
  • 93