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

Create a must-gather for the operator #3150

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
56bacb5
Add must-gather tool to the operator image #3149
iblancasa Jul 18, 2024
769a3f3
Merge branch 'main' into feature/3149
iblancasa Jul 18, 2024
82bda69
Add some missing features
iblancasa Jul 19, 2024
b8d8ba0
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa Jul 19, 2024
9e4e9d4
Add operator logs
iblancasa Jul 26, 2024
b0c55e3
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa Jul 26, 2024
ec88261
Add changelog
iblancasa Jul 26, 2024
c16532f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa Aug 5, 2024
765fe87
Fix lint
iblancasa Aug 5, 2024
68a3d3b
Merge branch 'main' into feature/3149
iblancasa Aug 7, 2024
069c15a
Merge branch 'main' into feature/3149
iblancasa Aug 7, 2024
a26c876
Merge branch 'main' into feature/3149
iblancasa Aug 8, 2024
b8056d1
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa Aug 12, 2024
f28ce1f
Merge branch 'main' into feature/3149
iblancasa Aug 14, 2024
60fc1ed
Merge branch 'main' into feature/3149
iblancasa Aug 19, 2024
e6880dd
Merge branch 'main' into feature/3149
iblancasa Aug 20, 2024
3ab9168
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa Aug 21, 2024
6de3677
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa Aug 21, 2024
d11a6df
Add documentation
iblancasa Aug 21, 2024
501613f
Merge branch 'main' into feature/3149
iblancasa Aug 22, 2024
028a5b2
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa Aug 26, 2024
b2faf8f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa Aug 26, 2024
96947a8
Merge branch 'main' into feature/3149
iblancasa Aug 27, 2024
ddc230b
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa Aug 27, 2024
3c4ebd6
Clarify K8s compatibility
iblancasa Aug 27, 2024
eaddca1
Some fixes
iblancasa Aug 28, 2024
7ec756f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa Aug 30, 2024
abfdacf
Publish image
iblancasa Aug 30, 2024
475d2a4
Merge branch 'main' into feature/3149
iblancasa Aug 30, 2024
63b7e3f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa Sep 9, 2024
f458b9b
Fix release notes
iblancasa Sep 9, 2024
570e64a
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa Sep 9, 2024
ca059e5
Merge branch 'main' into feature/3149
iblancasa Sep 9, 2024
8af2a31
Merge branch 'main' into feature/3149
iblancasa Sep 13, 2024
6791b05
Merge branch 'main' into feature/3149
iblancasa Sep 16, 2024
9f58634
Merge branch 'main' into feature/3149
iblancasa Sep 17, 2024
532c103
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa Sep 17, 2024
75974db
Merge branch 'main' into feature/3149
iblancasa Sep 18, 2024
7f4641c
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa Sep 19, 2024
8fa48a7
Small improvements
iblancasa Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .chloggen/3149-add-must-gather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Add a must gather utility to help troubleshoot"

# One or more tracking issues related to the change
issues: [3149]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: "The new utility was added to the operator container so it can be run without adding any new container. It can be run from the /must-gather path"
iblancasa marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion .github/workflows/publish-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
for platform in $(echo $PLATFORMS | tr "," "\n"); do
arch=${platform#*/}
echo "Building manager for $arch"
make manager ARCH=$arch
make manager must-gather ARCH=$arch
done

- name: Docker meta
Expand Down
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ OPERATOROPAMPBRIDGE_IMG ?= ${IMG_PREFIX}/${OPERATOROPAMPBRIDGE_IMG_REPO}:$(addpr
BRIDGETESTSERVER_IMG_REPO ?= e2e-test-app-bridge-server
BRIDGETESTSERVER_IMG ?= ${IMG_PREFIX}/${BRIDGETESTSERVER_IMG_REPO}:ve2e

MUSTGATHER_IMG ?= ${IMG_PREFIX}/must-gather

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
Expand Down Expand Up @@ -143,6 +145,10 @@ ci: generate fmt vet test ensure-generate-is-noop
manager: generate
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(ARCH) go build -o bin/manager_${ARCH} -ldflags "${COMMON_LDFLAGS} ${OPERATOR_LDFLAGS}" main.go

.PHONY: must-gather
must-gather:
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(ARCH) go build -o bin/must-gather_${ARCH} -ldflags "${COMMON_LDFLAGS} ${OPERATOR_LDFLAGS}" ./cmd/gather/main.go

# Build target allocator binary
.PHONY: targetallocator
targetallocator:
Expand Down Expand Up @@ -362,6 +368,15 @@ container-bridge-test-server: GOOS = linux
container-bridge-test-server:
docker build --load -t ${BRIDGETESTSERVER_IMG} tests/test-e2e-apps/bridge-server

.PHONY: container-must-gather
container-must-gather: GOOS = linux
container-must-gather: must-gather
docker build -f cmd/gather/Dockerfile --load -t ${MUSTGATHER_IMG} .

.PHONY: container-must-gather-push
container-must-gather-push:
docker push ${MUSTGATHER_IMG}

.PHONY: start-kind
start-kind: kind
ifeq (true,$(START_KIND_CLUSTER))
Expand All @@ -388,7 +403,6 @@ else
$(MAKE) container-push
endif


.PHONY: load-image-target-allocator
load-image-target-allocator: container-target-allocator kind
ifeq (true,$(START_KIND_CLUSTER))
Expand Down
16 changes: 16 additions & 0 deletions cmd/gather/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM registry.access.redhat.com/ubi9-minimal:9.2

RUN INSTALL_PKGS=" \
rsync \
tar \
" && \
microdnf install -y $INSTALL_PKGS && \
microdnf clean all
WORKDIR /

ARG TARGETARCH
COPY bin/must-gather_${TARGETARCH} /usr/bin/must-gather

USER 65532:65532

ENTRYPOINT ["/usr/bin/must-gather"]
36 changes: 36 additions & 0 deletions cmd/gather/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# OpenTelemetry Operator Must-Gather
iblancasa marked this conversation as resolved.
Show resolved Hide resolved

The OpenTelemetry Operator `must-gather` tool is designed to collect comprehensive information about OpenTelemetry components within an OpenShift cluster. This utility extends the functionality of [OpenShift must-gather](https://github.com/openshift/must-gather) by specifically targeting and retrieving data related to the OpenTelemetry Operator, helping in diagnostics and troubleshooting.

Note that you can use this utility too to gather information about the objects deployed by the OpenTelemetry Operator if you don't use OpenShift.

## What is a Must-Gather?

The `must-gather` tool is a utility that collects logs, cluster information, and resource configurations related to a specific operator or application in an OpenShift cluster. It helps cluster administrators and developers diagnose issues by providing a snapshot of the cluster's state related to the targeted component. More information [in the official documentation](https://docs.openshift.com/container-platform/4.16/support/gathering-cluster-data.html).

## Usage

First, you will need to build and push the image:
```sh
make container-must-gather container-must-gather-push
iblancasa marked this conversation as resolved.
Show resolved Hide resolved
```

To run the must-gather tool for the OpenTelemetry Operator, use one of the following commands, depending on how you want to source the image and the namespace where the operator is deployed.

### Using the image from the Operator deployment

If you want to use the image in a running cluster, you need to run the following command:

```sh
oc adm must-gather --image=<must-gather-image> -- /usr/bin/must-gather --operator-namespace opentelemetry-operator-system
```

### Using it as a CLI

You only need to build and run:
```sh
make must-gather
./bin/must-gather --help
```

This is the recommended way to do it if you are not using OpenShift.
Loading
Loading