-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3d724f
commit 104283e
Showing
8 changed files
with
437 additions
and
2 deletions.
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,27 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,19 @@ | ||
--- | ||
name: Task 🔧 | ||
about: Internal things, technical debt, and to-do tasks to be performed. | ||
title: '' | ||
labels: 'kind/task' | ||
assignees: '' | ||
|
||
--- | ||
### Is your task related to a problem? Please describe. | ||
<!-- A clear and concise description of what the problem is.--> | ||
|
||
### Describe the solution you'd like | ||
<!-- A clear and concise description of what you want to happen. --> | ||
|
||
### Describe alternatives you've considered | ||
<!--A clear and concise description of any alternative solutions or features you've considered. --> | ||
|
||
### Additional context | ||
<!-- Add any other context or screenshots about the task here. --> |
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,29 @@ | ||
**What type of PR is this?** | ||
> Uncomment only one ` /kind` line, and delete the rest. | ||
> For example, `> /kind bug` would simply become: `/kind bug` | ||
> /kind bug | ||
> /kind cleanup | ||
> /kind failing-test | ||
> /kind enhancement | ||
> /kind documentation | ||
> /kind code-refactoring | ||
|
||
**What does this PR do / why we need it**: | ||
|
||
**Have you updated the necessary documentation?** | ||
|
||
* [ ] Documentation update is required by this PR. | ||
* [ ] Documentation has been updated. | ||
|
||
**Which issue(s) this PR fixes**: | ||
|
||
Fixes #? | ||
|
||
**Test acceptance criteria**: | ||
|
||
* [ ] Unit Test | ||
* [ ] E2E Test | ||
|
||
**How to test changes / Special notes to the reviewer**: |
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 quay.io/openshift/origin-must-gather:4.6 | ||
|
||
# Save original gather script | ||
RUN mv /usr/bin/gather /usr/bin/gather_original | ||
|
||
# Use our gather script in place of the original one | ||
COPY gather_gitops.sh /usr/bin/gather | ||
|
||
# Make it executable | ||
RUN chmod +x /usr/bin/gather | ||
|
||
# install jq to parse json within bash scripts | ||
RUN curl -o /usr/local/bin/jq http://stedolan.github.io/jq/download/linux64/jq && \ | ||
chmod +x /usr/local/bin/jq | ||
|
||
ENTRYPOINT /usr/bin/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,54 @@ | ||
## Copyright 2019 Red Hat, Inc. | ||
## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
|
||
default: build | ||
|
||
HUB ?= quay.io/redhat-developer | ||
TAG ?= latest | ||
|
||
lint: | ||
@if command -v shellcheck >/dev/null; then \ | ||
find . -name '*.sh' -print0 | xargs -0 -r shellcheck; \ | ||
else \ | ||
echo "shellcheck not found, installing it now..."; \ | ||
if command -v apt-get >/dev/null; then \ | ||
sudo apt-get install -y shellcheck; \ | ||
elif command -v yum >/dev/null; then \ | ||
sudo yum install -y shellcheck; \ | ||
elif command -v dnf >/dev/null; then \ | ||
sudo dnf install -y shellcheck; \ | ||
elif command -v pacman >/dev/null; then \ | ||
sudo pacman -S --noconfirm shellcheck; \ | ||
else \ | ||
echo "shellcheck not found and unable to install it automatically"; \ | ||
echo "Please install shellcheck manually and run the lint target again"; \ | ||
exit 1; \ | ||
fi; \ | ||
find . -name '*.sh' -print0 | xargs -0 -r shellcheck; \ | ||
fi | ||
|
||
image: | ||
@if command -v podman >/dev/null; then \ | ||
podman build -t ${HUB}/gitops-must-gather:${TAG} .; \ | ||
else \ | ||
docker build -t ${HUB}/gitops-must-gather:${TAG} .; \ | ||
fi | ||
|
||
push: image | ||
podman push ${HUB}/gitops-must-gather:${TAG} | ||
@if command -v podman >/dev/null; then \ | ||
podman push ${HUB}/gitops-must-gather:${TAG} .; \ | ||
else \ | ||
docker push ${HUB}/gitops-must-gather:${TAG} .; \ | ||
fi |
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 |
---|---|---|
@@ -1,2 +1,86 @@ | ||
# gitops-must-gather | ||
A client tool for gathering GitOps Operator information in a OpenShift cluster. | ||
# GitOps Operator Must-Gather | ||
================= | ||
|
||
`GitOps must-gather` is a tool to gather information about the gitop-operator. It is built on top of [OpenShift must-gather](https://github.com/openshift/must-gather). | ||
|
||
### Usage | ||
```sh | ||
oc adm must-gather --image=quay.io/redhat-developer/gitops-must-gather:latest | ||
``` | ||
|
||
The command above will create a local directory with a dump of the OpenShift GitOps state. Note that this command will only get data related to the GitOps Operator in your OpenShift cluster. | ||
|
||
You will get a dump of: | ||
- Information for the subscription of the gitops-operator | ||
- The GitOps Operator namespace (and its children objects) | ||
- All namespaces where ArgoCD objects exist in, plus all objects in those namespaces, such as ArgoCD, Applications, ApplicationSets, and AppProjects, and configmaps | ||
- No secrets will be collected | ||
- A list of list of the namespaces that are managed by gitops-operator identified namespaces and resources from those namespaces. | ||
- All GitOps CRD's objects and definitions | ||
- Operator logs | ||
- Logs of Argo CD | ||
- Warning and error-level Events | ||
|
||
In order to get data about other parts of the cluster (not specific to gitops-operator) you should run just `oc adm must-gather` (without passing a custom image). Run `oc adm must-gather -h` to see more options. | ||
|
||
An example of the GitOps must-gather output would be something like the following, where there are two argocd instances in namespaces `openshift-gitops` and `foo` and an additional namespace called `foo-managed` which is managed by namespace `foo`: | ||
``` | ||
cluster-gitops | ||
└── gitops | ||
├── appprojects.yaml | ||
├── crds.yaml | ||
├── namespace_openshift-gitops_resources | ||
│ ├── application_controller_logs.txt | ||
│ ├── applications | ||
│ ├── applicationsets | ||
│ ├── argocd.yaml | ||
│ ├── deployments | ||
│ │ ├── cluster.yaml | ||
│ │ └── kam.yaml | ||
│ ├── dex-server_logs.txt | ||
│ ├── error-events.txt | ||
│ ├── pods | ||
│ │ ├── cluster-5db4b95547-rdz2m.yaml | ||
│ │ └── kam-fff7f474f-d27c8.yaml | ||
│ ├── redis_logs.txt | ||
│ ├── replicasets | ||
│ │ ├── cluster-5db4b95547.yaml | ||
│ │ └── kam-fff7f474f.yaml | ||
│ ├── repo-server_logs.txt | ||
│ ├── routes | ||
│ │ └── kam.yaml | ||
│ ├── server_logs.txt | ||
│ ├── services | ||
│ │ ├── cluster.yaml | ||
│ │ └── kam.yaml | ||
│ ├── statefulsets | ||
│ └── warning-events.txt | ||
├── namespace_foo_resources | ||
│ ├── application_controller_logs.txt | ||
│ ├── applications | ||
│ │ └── guestbook.yaml | ||
│ ├── applicationsets | ||
│ │ └── guestbook.yaml | ||
│ ├── argocd.yaml | ||
│ ├── deployments | ||
│ ├── dex-server_logs.txt | ||
│ ├── error-events.txt | ||
│ ├── managedNamespace_foo-managed | ||
│ │ ├── deployments | ||
│ │ ├── pods | ||
│ │ ├── replicasets | ||
│ │ ├── routes | ||
│ │ ├── services | ||
│ │ └── statefulsets | ||
│ ├── pods | ||
│ ├── redis_logs.txt | ||
│ ├── replicasets | ||
│ ├── repo-server_logs.txt | ||
│ ├── routes | ||
│ ├── server_logs.txt | ||
│ ├── services | ||
│ ├── statefulsets | ||
│ └── warning-events.txt | ||
├── oc-version.txt | ||
└── subscription.yaml | ||
``` |
Oops, something went wrong.