From 0d46e7171b8aed815fb9e3f13cecd01c6eb597dc Mon Sep 17 00:00:00 2001 From: Kevin NZUGUEM Date: Fri, 27 Dec 2024 20:40:37 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Upgrade=20version=20of?= =?UTF-8?q?=20OTelcol=20Operator=20and=20Install=20Krew?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/.devcontainer/devcontainer.json | 4 +++- .../features/krew/devcontainer-feature.json | 16 ++++++++++++++++ .github/.devcontainer/features/krew/install.sh | 18 ++++++++++++++++++ observability/otel/otelcol.daemonset.yml | 8 +++++--- observability/otel/otelcol.deployment.yml | 4 +++- observability/otel/otelcol.sidecar.yml | 5 ++++- observability/tasks.yml | 2 +- 7 files changed, 50 insertions(+), 7 deletions(-) create mode 100755 .github/.devcontainer/features/krew/devcontainer-feature.json create mode 100755 .github/.devcontainer/features/krew/install.sh diff --git a/.github/.devcontainer/devcontainer.json b/.github/.devcontainer/devcontainer.json index 1f63abe..1ea9f25 100755 --- a/.github/.devcontainer/devcontainer.json +++ b/.github/.devcontainer/devcontainer.json @@ -24,7 +24,9 @@ "ghcr.io/devcontainers-contrib/features/vault-asdf:2": {}, "ghcr.io/devcontainers/features/go:1": {}, "./features/grpcurl": {}, + "./features/krew": {}, "ghcr.io/devcontainers-contrib/features/temporal-cli:1": {}, - "ghcr.io/guiyomh/features/vim": {} + "ghcr.io/guiyomh/features/vim": {}, + "ghcr.io/dhoeric/features/stern:1": {} } } diff --git a/.github/.devcontainer/features/krew/devcontainer-feature.json b/.github/.devcontainer/features/krew/devcontainer-feature.json new file mode 100755 index 0000000..2232810 --- /dev/null +++ b/.github/.devcontainer/features/krew/devcontainer-feature.json @@ -0,0 +1,16 @@ +{ + "id": "krew", + "name": "krew", + "description": "Install krew - the plugin manager for kubectl command-line tool..", + "documentationURL": "https://krew.sigs.k8s.io/", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Select or enter a version." + } + } +} diff --git a/.github/.devcontainer/features/krew/install.sh b/.github/.devcontainer/features/krew/install.sh new file mode 100755 index 0000000..80ab431 --- /dev/null +++ b/.github/.devcontainer/features/krew/install.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -eux + +KREW_VERSION="${VERSION:-"latest"}" + +set -x; cd "$(mktemp -d)" +OS="$(uname | tr '[:upper:]' '[:lower:]')" +ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" +KREW="krew-${OS}_${ARCH}" +curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/$KREW_VERSION/download/${KREW}.tar.gz" +tar zxvf "${KREW}.tar.gz" +./"${KREW}" install krew + +cat <> $HOME/.bashrc +export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" +EOF +source $HOME/.bashrc diff --git a/observability/otel/otelcol.daemonset.yml b/observability/otel/otelcol.daemonset.yml index 18dadca..5eda9c1 100755 --- a/observability/otel/otelcol.daemonset.yml +++ b/observability/otel/otelcol.daemonset.yml @@ -11,8 +11,8 @@ spec: hostPath: path: /var/log/pods - name: varlibdockercontainers - hostPath: - path: /var/lib/docker/containers + hostPath: + path: /var/lib/docker/containers volumeMounts: - name: varlogpods mountPath: /var/log/pods @@ -32,7 +32,9 @@ spec: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 processors: memory_limiter: check_interval: 1s @@ -51,4 +53,4 @@ spec: logs: receivers: [filelog] processors: [] - exporters: [debug] \ No newline at end of file + exporters: [debug] diff --git a/observability/otel/otelcol.deployment.yml b/observability/otel/otelcol.deployment.yml index 11d7fca..6091594 100755 --- a/observability/otel/otelcol.deployment.yml +++ b/observability/otel/otelcol.deployment.yml @@ -11,7 +11,9 @@ spec: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 processors: memory_limiter: check_interval: 1s @@ -30,4 +32,4 @@ spec: traces: receivers: [otlp] processors: [batch] - exporters: [debug] \ No newline at end of file + exporters: [debug] diff --git a/observability/otel/otelcol.sidecar.yml b/observability/otel/otelcol.sidecar.yml index 4754c35..9b38cbe 100755 --- a/observability/otel/otelcol.sidecar.yml +++ b/observability/otel/otelcol.sidecar.yml @@ -11,10 +11,13 @@ spec: jaeger: protocols: thrift_compact: + endpoint: 0.0.0.0:6831 otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 processors: memory_limiter: check_interval: 1s @@ -33,4 +36,4 @@ spec: traces: receivers: [otlp, jaeger] processors: [batch] - exporters: [debug] \ No newline at end of file + exporters: [debug] diff --git a/observability/tasks.yml b/observability/tasks.yml index a41188e..f610ec6 100755 --- a/observability/tasks.yml +++ b/observability/tasks.yml @@ -6,7 +6,7 @@ tasks: cmds: - helm repo add otel https://open-telemetry.github.io/opentelemetry-helm-charts - helm repo update otel - - helm upgrade --install --version 0.60.0 + - helm upgrade --install --version 0.75.1 --create-namespace --namespace otel-system otel otel/opentelemetry-operator --set admissionWebhooks.certManager.enabled=false