Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(instrumentation): replace tools image with kubectl #3373

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/3373.fixed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix(instrumentation): replace tools image with kubectl
4 changes: 2 additions & 2 deletions deploy/helm/sumologic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ The following table lists the configurable parameters of the Sumo Logic chart an
| `opentelemetry-operator.manager.resources.requests.cpu` | Used to set requested CPU for OpenTelemetry-Operator Manager. | `150m` |
| `opentelemetry-operator.manager.resources.requests.memory` | Used to set requested Memory for OpenTelemetry-Operator Manager. | `256Mi` |
| `opentelemetry-operator.instrumentationNamespaces` | Used to create `Instrumentation` resources in specified namespaces. | `Nil` |
| `opentelemetry-operator.instrumentationJobImage.image.repository` | Name of the image repository used to apply Instrumentation resource | `sumologic/kubernetes-tools` |
| `opentelemetry-operator.instrumentationJobImage.image.tag` | Name of the image tag used to apply Instrumentation resource | `2.14.0` |
| `opentelemetry-operator.instrumentationJobImage.image.repository` | Name of the image repository used to apply Instrumentation resource | `public.ecr.aws/sumologic/kubernetes-tools-kubectl` |
| `opentelemetry-operator.instrumentationJobImage.image.tag` | Name of the image tag used to apply Instrumentation resource | `2.20.0` |
| `opentelemetry-operator.admissionWebhooks` | Admission webhooks make sure only requests with correctly formatted rules will get into the Operator. They also enable the sidecar injection for OpenTelemetryCollector and Instrumentation CR's. | See [values.yaml] |
| `opentelemetry-operator.manager.env` | Additional environment variables for opentelemetry-operator helm chart. | `{"ENABLE_WEBHOOKS": "true"}` |
| `otelcolInstrumentation.enabled` | Enables Sumo Otel Distro Collector StatefulSet to collect telemetry data. [See docs for more information.](/docs/opentelemetry-collector/traces.md) | `true` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,17 @@ spec:
- name: instrumentation-cr-configmap
mountPath: /tmp/instrumentation-cr.yaml
subPath: instrumentation.cr.yaml
command: ["/bin/bash", "-c"]
command: ["/usr/local/bin/bash", "-c"]
args:
- |
max_wait=180
sleep_interval=5
counter=0
ready=false
while [[ ready != "false" ]]
while ! kubectl apply -f /tmp/instrumentation-cr.yaml
do
is_ready=$(curl -s -o /dev/null -m 3 -L -w ''%{http_code}'' {{ template "opentelemetry-operator.controller.manager.metrics.service.url" . }})

if [[ is_ready -eq "200" ]]
then
ready=true
break
else
echo "Waiting for {{ .Release.Name }}-opentelemetry-operator"
sleep $sleep_interval
counter=$(($counter + $sleep_interval))
fi
echo "Waiting for {{ .Release.Name }}-opentelemetry-operator"
sleep $sleep_interval
counter=$(($counter + $sleep_interval))

if [[ "$counter" -gt "$max_wait" ]]
then
Expand All @@ -55,12 +46,9 @@ spec:
fi
done

if [[ $ready == true ]]
then
echo "Applying Instrumentation resources"
kubectl apply -f /tmp/instrumentation-cr.yaml
exit $?
fi
kubectl apply -f /tmp/instrumentation-cr.yaml || exit 1
echo "Successfully applied Instrumentation resources"
exit $?
volumes:
- name: instrumentation-cr-configmap
configMap:
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2416,8 +2416,8 @@ opentelemetry-operator:
## Specific for Sumo Logic chart - Instrumentation resource creation
instrumentationJobImage:
image:
repository: sumologic/kubernetes-tools
tag: 2.14.0
repository: public.ecr.aws/sumologic/kubernetes-tools-kubectl
tag: 2.20.0

createDefaultInstrumentation: false
instrumentationNamespaces: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,22 @@ spec:
serviceAccountName: RELEASE-NAME-sumologic
containers:
- name: instrumentation-cr-applier
image: sumologic/kubernetes-tools:2.14.0
image: public.ecr.aws/sumologic/kubernetes-tools-kubectl:2.20.0
volumeMounts:
- name: instrumentation-cr-configmap
mountPath: /tmp/instrumentation-cr.yaml
subPath: instrumentation.cr.yaml
command: ["/bin/bash", "-c"]
command: ["/usr/local/bin/bash", "-c"]
args:
- |
max_wait=180
sleep_interval=5
counter=0
ready=false
while [[ ready != "false" ]]
while ! kubectl apply -f /tmp/instrumentation-cr.yaml
do
is_ready=$(curl -s -o /dev/null -m 3 -L -w ''%{http_code}'' http://RELEASE-NAME-opentelemetry-operator.sumologic:8080/metrics)

if [[ is_ready -eq "200" ]]
then
ready=true
break
else
echo "Waiting for RELEASE-NAME-opentelemetry-operator"
sleep $sleep_interval
counter=$(($counter + $sleep_interval))
fi
echo "Waiting for RELEASE-NAME-opentelemetry-operator"
sleep $sleep_interval
counter=$(($counter + $sleep_interval))

if [[ "$counter" -gt "$max_wait" ]]
then
Expand All @@ -53,12 +44,9 @@ spec:
fi
done

if [[ $ready == true ]]
then
echo "Applying Instrumentation resources"
kubectl apply -f /tmp/instrumentation-cr.yaml
exit $?
fi
kubectl apply -f /tmp/instrumentation-cr.yaml || exit 1
echo "Successfully applied Instrumentation resources"
exit $?
volumes:
- name: instrumentation-cr-configmap
configMap:
Expand Down