-
Notifications
You must be signed in to change notification settings - Fork 494
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
Merged
Merged
Changes from 54 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
56bacb5
Add must-gather tool to the operator image #3149
iblancasa 769a3f3
Merge branch 'main' into feature/3149
iblancasa 82bda69
Add some missing features
iblancasa b8d8ba0
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa 9e4e9d4
Add operator logs
iblancasa b0c55e3
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa ec88261
Add changelog
iblancasa c16532f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa 765fe87
Fix lint
iblancasa 68a3d3b
Merge branch 'main' into feature/3149
iblancasa 069c15a
Merge branch 'main' into feature/3149
iblancasa a26c876
Merge branch 'main' into feature/3149
iblancasa b8056d1
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa f28ce1f
Merge branch 'main' into feature/3149
iblancasa 60fc1ed
Merge branch 'main' into feature/3149
iblancasa e6880dd
Merge branch 'main' into feature/3149
iblancasa 3ab9168
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa 6de3677
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa d11a6df
Add documentation
iblancasa 501613f
Merge branch 'main' into feature/3149
iblancasa 028a5b2
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa b2faf8f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
iblancasa 96947a8
Merge branch 'main' into feature/3149
iblancasa ddc230b
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
iblancasa 3c4ebd6
Clarify K8s compatibility
iblancasa eaddca1
Some fixes
iblancasa 7ec756f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
abfdacf
Publish image
475d2a4
Merge branch 'main' into feature/3149
iblancasa 63b7e3f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
f458b9b
Fix release notes
570e64a
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
ca059e5
Merge branch 'main' into feature/3149
8af2a31
Merge branch 'main' into feature/3149
6791b05
Merge branch 'main' into feature/3149
9f58634
Merge branch 'main' into feature/3149
532c103
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
75974db
Merge branch 'main' into feature/3149
7f4641c
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
8fa48a7
Small improvements
2723852
Merge branch 'main' into feature/3149
a119f53
Merge branch 'main' into feature/3149
9321953
Merge branch 'main' into feature/3149
75d4c4d
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
c7dc6b6
Add unit tests
350db12
Merge branch 'main' into feature/3149
c0e0d50
Merge branch 'main' into feature/3149
b431240
Merge branch 'main' into feature/3149
c0d9585
Merge branch 'main' into feature/3149
8fa0f59
Merge branch 'main' into feature/3149
f95e6e4
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
d83ead8
Apply changes requested in code review
7a494b9
Merge branch 'main' into feature/3149
a47d28d
Merge branch 'main' into feature/3149
d39fa5d
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-ope…
215ee9c
Fix typo
5182d32
Merge branch 'main' into feature/3149
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 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: instrumentation, collector | ||
|
||
# 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 is available as part of a new container image. | ||
|
||
To use the image in a running OpenShift cluster, you need to run the following command: | ||
|
||
```sh | ||
oc adm must-gather --image=ghcr.io/open-telemetry/opentelemetry-operator/must-gather -- /usr/bin/must-gather --operator-namespace opentelemetry-operator-system | ||
``` | ||
|
||
See the [README](https://github.com/open-telemetry/opentelemetry-operator/blob/main/cmd/gather/README.md) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: "Publish must-gather image" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: [ 'v*' ] | ||
|
||
workflow_dispatch: | ||
|
||
env: | ||
PLATFORMS: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le | ||
|
||
jobs: | ||
publish: | ||
name: Publish must-gather container image | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '~1.22.4' | ||
|
||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
|
||
- name: Build the binary for each supported architecture | ||
run: | | ||
for platform in $(echo $PLATFORMS | tr "," "\n"); do | ||
arch=${platform#*/} | ||
echo "Building must-gather for $arch" | ||
make must-gather ARCH=$arch | ||
done | ||
|
||
- name: Docker meta | ||
id: docker_meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
iblancasa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ghcr.io/open-telemetry/opentelemetry-operator/must-gather | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{raw}} | ||
type=ref,event=branch | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v4 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
|
||
- name: Log into Docker.io | ||
uses: docker/login-action@v3 | ||
if: ${{ github.event_name == 'push' }} | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Login to GitHub Package Registry | ||
uses: docker/login-action@v3 | ||
if: ${{ github.event_name == 'push' }} | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push must-gather image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./cmd/gather/Dockerfile | ||
platforms: ${{ env.PLATFORMS }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
This is the recommended way to do it if you are not using OpenShift. | ||
|
||
If you want to use the image in a running cluster, you need to run the following command: | ||
|
||
```sh | ||
oc adm must-gather --image=ghcr.io/open-telemetry/opentelemetry-operator/must-gather -- /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_$(go env GOARCH) --help | ||
``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto-instrumentation