open-telemetry / opentelemetry-helm-charts

OpenTelemetry Helm Charts
https://opentelemetry.io
Apache License 2.0
389 stars 468 forks source link

POD still trying to pull the Image from default location even though values for operator overridden for private registry #785

Closed sreejesh-radhakrishnan-db closed 1 year ago

sreejesh-radhakrishnan-db commented 1 year ago

I use private registry hence I overridden the below value in operator install for automatic instrumentation values image

https://github.com/open-telemetry/opentelemetry-helm-charts/blob/4fa9fb7be5afb929454494956e8a146358c24be0/charts/opentelemetry-operator/values.yaml#L39-L51

I can see kinds : instrument have correctly showing the Image path. instrumentation.opentelemetry.io/default-auto-instrumentation-java-image: artifactory.sdlc.ctl.gcp.db.com/dkr-all/dkr-ghr/open-telemetry/opentelemetry-operator/autoinstrumentation-java:1.25.1

but when I annotated the POD and whist its starting its still looking for ghcr.io/<> the default one? any idea what I am missing?

Error on POD- Back-off pulling image "ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:1.24.0"

TylerHelmuth commented 1 year ago

@sreejesh-radhakrishnan-db can you provide your values.yaml?

sreejesh-radhakrishnan-db commented 1 year ago

Sorry for horrible formatting I cannot upload file due to restrictions

sreejesh-radhakrishnan-db commented 1 year ago

manager: image: repository: artifactory.sdlc.ctl.gcp.db.com/dkr-all/dkr-ghr/open-telemetry/opentelemetry-operator/opentelemetry-operator tag: v0.75.0 collectorImage: repository: artifactory.sdlc.ctl.gcp.db.com/dkr-all/dkr-io/otel/opentelemetry-collector-contrib tag: 0.75.0 targetAllocatorImage: repository: "" tag: "" autoInstrumentationImage: java: repository: "artifactory.sdlc.ctl.gcp.db.com/dkr-all/dkr-ghr/open-telemetry/opentelemetry-operator/autoinstrumentation-java" tag: "1.25.1" nodejs: repository: "artifactory.sdlc.ctl.gcp.db.com/dkr-all/dkr-ghr/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs" tag: "0.38.0"

sreejesh-radhakrishnan-db commented 1 year ago

Just to add I am applyig the below manifest for Instrumentation

https://opentelemetry.io/docs/k8s-operator/automatic/#java

I can see in GKE objectrbowser this is having the right Image link

apiVersion: opentelemetry.io/v1alpha1 kind: Instrumentation

metadata:

annotations:

instrumentation.opentelemetry.io/default-auto-instrumentation-dotnet-image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet:0.6.0

instrumentation.opentelemetry.io/default-auto-instrumentation-java-image: artifactory.sdlc.ctl.gcp.db.com/dkr-all/dkr-ghr/open-telemetry/opentelemetry-operator/autoinstrumentation-java:1.25.1

instrumentation.opentelemetry.io/default-auto-instrumentation-nodejs-image: artifactory.sdlc.ctl.gcp.db.com/dkr-all/dkr-ghr/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs:0.38.0

instrumentation.opentelemetry.io/default-auto-instrumentation-python-image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:0.38b0

kubectl.kubernetes.io/last-applied-configuration: |

  {"apiVersion":"opentelemetry.io/v1alpha1","kind":"Instrumentation","metadata":{"annotations":{},"name":"care-optl-instrumentation","namespace":"cnap"},"spec":{"exporter":{"endpoint":"http://care-optl-collector:4317"},"java":{"image":"artifactory.sdlc.ctl.gcp.db.com/dkr-all/dkr-ghr/open-telemetry/opentelemetry-operator/autoinstrumentation-java"},"propagators":["tracecontext","baggage"],"sampler":{"argument":"1","type":"parentbased_traceidratio"}}}
sreejesh-radhakrishnan-db commented 1 year ago

After the above step I annotated the POD which is my JAVA application like this

kubectl patch deployment buildpack-java -p '{"spec": {"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-java":"true"}}}} }'

and there the annotation is correct and I can see on YAML its refering to ghrc link and not artifactory.

apiVersion: v1 kind: Pod

metadata:

annotations:

instrumentation.opentelemetry.io/inject-java: "true"

......

TylerHelmuth commented 1 year ago

@sreejesh-radhakrishnan-db can you confirm that you definitely only have 1 instrumentation resource created in the namespace of the app?

sreejesh-radhakrishnan-db commented 1 year ago

Yes - I have checked that image

sreejesh-radhakrishnan-db commented 1 year ago

just to check what is the source of image repo for autoinstrumentaion? when I annotate a pod? is it taken from Instrumentation ? I can try to delete and recreate and see what happens?

sreejesh-radhakrishnan-db commented 1 year ago

I removed and added annotation and it seems to work and picking up the correct image repo. hence clsoing the issue. thanks @TylerHelmuth for your time.