Skip to content

Commit ac05729

Browse files
Andrew-Lees11GitHub Enterprise
authored andcommitted
Add Usage, Signing verification and Install instructions to docs (#83)
1 parent bb1b271 commit ac05729

File tree

5 files changed

+358
-14
lines changed

5 files changed

+358
-14
lines changed

README.md

Lines changed: 90 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,117 @@
44

55
A collection of tools for interacting with IBM® MQ queue managers running in containers.
66

7-
This repository currently includes the MQ MustGather tool, which simplifies the collection of diagnostic information from a running queue manager. Tools are provided as CLI commands, built from a Go binary, and are designed to be lightweight, container-friendly, and easy to integrate into automated environments.
7+
The following tools are currently available:
88

9-
Additional tools may be added over time to support broader inspection and interaction use cases.
9+
- [MustGather](#mustgather-usage) - Collect diagnostic information required when opening a support case with IBM® MQ containers Support.
10+
- [PVCTool](#pvctool-usage) - Provides access to the files on a queue manager PVC where a remote shell cannot be established to the queue manager pod. This might be because the pod is in an Error or CrashLoopBackOff state.
1011

11-
The full source code is available at https://github.com/ibm-messaging/mq-container-inspector
12+
## Install Instructions
1213

13-
## Build
14+
To use MQ container inspector, you must install it via one of the following options:
1415

15-
To build the MQ container inspector tools, simply run:
16+
- [Build Binary](#build-binary): Build the MQ container inspector binary from the source code
17+
- [Download Binary](#download-binary): Download the prebuilt MQ container inspector Binary
18+
- [Prebuilt MQ container inspector image](#prebuilt-mq-container-inspector-image): Use MQ container inspector via the CPFS MustGather Image
1619

17-
`go build`
20+
### Build Binary
1821

19-
This will produce a single binary containing all available CLI tools. No additional dependencies or setup steps are required.
22+
To build and install the MQ container inspector` tool, follow these steps:
23+
24+
1. Clone MQ container inspector GitHub repository, for example:
25+
26+
```bash
27+
git clone https://github.com/ibm-messaging/mq-container-inspector.git
28+
cd mq-container-inspector
29+
```
30+
31+
2. Build MQ container inspector:
32+
33+
```bash
34+
go build
35+
```
36+
37+
3. Add mq-container-inspector to your path, for example:
38+
39+
```
40+
sudo mv mq-container-inspector /usr/local/bin
41+
```
42+
43+
4. Verify the build was successful:
44+
45+
`mq-container-inspector version`
46+
47+
### Download Binary
48+
49+
#### Linux
50+
51+
1. Download the latest MQ container inspector tarball and signature for your architecture from the [releases page](https://github.com/ibm-messaging/mq-container-inspector/releases)
52+
2. Verify the tarball signature by following the instructions in [VerifyBinary.md](https://github.com/ibm-messaging/mq-container-inspector/tree/main/docs/VerifyBinary.md)
53+
3. Extract the tarball (e.g. for 1.0.0_mq-container-inspector_linux-amd64.tar.gz):
54+
`tar -xvzf ~/Downloads/1.0.0_mq-container-inspector_linux-amd64.tar.gz`
55+
4. Add mq-container-inspector to your path, for example:
56+
57+
```
58+
sudo mv 1.0.0_mq-container-inspector_linux-amd64 /usr/local/bin/mq-container-inspector
59+
```
60+
5. Verify the Installation:
61+
`mq-container-inspector version`
62+
63+
#### MacOS
64+
- Requires [Homebrew](https://brew.sh/)
65+
- Requires [Go](https://go.dev/)
66+
67+
An MQ container inspector tarball is not available for MacOS, however the binary is available for install via brew.
68+
69+
1. Add the MQ homebrew tap:
70+
`brew tap ibm-messaging/ibmmq`
71+
72+
2. Install MQ container inspector:
73+
`brew install ibm-messaging/ibmmq/mqcontainerinspector`
74+
75+
3. Verify the Installation:
76+
`mq-container-inspector version`
77+
78+
#### Windows
79+
80+
1. Download the latest MQ container inspector zip file and signature from the [releases page](https://github.com/ibm-messaging/mq-container-inspector/releases)
81+
2. Verify the zip file signature by following the instructions in [VerifyBinary.md](https://github.com/ibm-messaging/mq-container-inspector/tree/main/docs/VerifyBinary.md)
82+
3. Unzip the Tool, for example:
83+
- Locate the downloaded .zip file (e.g. 1.0.0_mq-container-inspector_windows-amd64.zip)
84+
- Right-click the file and choose Extract All...
85+
- Choose a destination folder and click Extract
86+
4. Add the executable to your system path:
87+
`setx PATH "%PATH%;C:\<Path-to-executable>\mq-container-inspector" /M`
88+
5. Verify the Installation:
89+
`mq-container-inspector version`
90+
91+
### Pre-built MQ container inspector image
92+
93+
The MQ container inspector binary is included in the IBM Cloud Pak foundational services MustGather image (icr.io/cpopen/cpfs/must-gather:latest). For usage instructions, see the [MQ Container troubleshooting docs](https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=troubleshooting-problems-mq-operator)
2094

2195
## Mustgather Usage
2296

23-
After building the binary, you can run the MustGather tool with the following command:
97+
After the binary has been built or installed, you can run the MustGather tool with the following command:
2498

25-
`./mq-container-inspector mustgather --qm-name <queue-manager-name> --qm-namespace <queue-manager-namespace>`
99+
`mq-container-inspector mustgather --qm-name <queue-manager-name> --qm-namespace <queue-manager-namespace>`
26100

27101
This command collects diagnostic data from the specified queue manager running in a Kubernetes or OpenShift environment.
28102

29103
By default, the output is saved inside a `Must_Gather_<timestamp>` folder in the current working directory.
30104

105+
For full usage and output, see the [Mustgather Usage Guide](https://github.com/ibm-messaging/mq-container-inspector/tree/main/docs/MustGatherUsage.md)
106+
31107
## PVCtool Usage
32108

33-
After building the binary, you can run the PVC tool with the following command:
109+
After the binary has been built or installed, you can use the PVC tool to perform a [runmqras](https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=reference-runmqras-collect-mq-troubleshooting-information) must gather against a failing queue manager, with the following command:
34110

35-
`./mq-container-inspector pvctool --qm-name <queue-manager-name> --qm-namespace <queue-manager-namespace>`
111+
`mq-container-inspector pvctool --qm-name <queue-manager-name> --qm-namespace <queue-manager-namespace> --runmqras --cleanup`
36112

37-
This command creates pods attached to the queue manager PVCs for inspecting the PVCs in a Kubernetes or OpenShift environment.
113+
This command creates kubernetes pods attached to the queue manager PVCs. It then execs into the pvctool pod, runs runmqras and deletes the pods.
38114

39-
To delete the pvctool pods, run the same command with the --cleanup flag:
115+
By default, the output is saved inside a `PVC_Inspector_<timestamp>` folder in the current working directory.
40116

41-
`./mq-container-inspector pvctool --qm-name <queue-manager-name> --qm-namespace <namespace> --cleanup`
117+
For full usage and output, see the [PVCTool Usage Guide](https://github.com/ibm-messaging/mq-container-inspector/tree/main/docs/PVCToolUsage.md)
42118

43119
## Issues and contributions
44120

certificates/mq-public.gpg

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
3+
mQINBGP3eKsBEADesGAGhDZL/IVcB48Y/68Lcp/thTLp44WDcTGQ0fVXAtNWzW+X
4+
1iTW/sn+2XAQv1NoN1bTVsatfvFNKKW7WKSYSi4qnz942yjEAb7wRyylOtb3aMlL
5+
zlTISHFRwhl98K6J+555vToxK2iGeuTv0CvzGB+2KF4mrB3VlIhHm8JK+QQsD9O6
6+
IDcar+GzLkd3ZBx5zN7ivEvDcZ/qxiEeFnFIQ2jknqoZ+gsDkpYfHOQtNDR45+WN
7+
Y3VGkUVPYdAHWbU8uJeGcfhT87pdeMx6zQ+mrkFM2eptsL7muQF66Q5PLvIDWGXs
8+
N1eCbOAITgXdd1CbhkM11U2pgYZ7ONyAJp22dUJP+43UC3aQt3IVGhDJa2LryUVT
9+
HfsoJ84T38lH/GQHAxjw7a/0Sq8xy0iEtA81lukiK9D50796mbs25kanxslfDBoX
10+
5a2UQrX45Grq1h5+vR3QVx/wRmfHCyAo0sMImnHG2SVDZpVhJWChYxWwQOgIDZDE
11+
scxa+QU3bPy0bNKJdsSBb/4rW4mCYbX5K1119VrtTr0tRHU7ItkW21uzz5oxb9eb
12+
LsGsM9hwKbQXCaU83UAJy/V7JtJk3nJ+JihLpaUhszoMPgiuvXu+jH3uqoHhLjwc
13+
SzfSX3aXLzsIvYcDPiKWWrYK5JxWx/AWGP8o1QCflobS4MaAH5UXHBOBCwARAQAB
14+
tD5JbnRlcm5hdGlvbmFsIEJ1c2luZXNzIE1hY2hpbmVzIENvcnBvcmF0aW9uIDxw
15+
c2lydEB1cy5pYm0uY29tPokCOgQTAQgAJAUCY/d4qwIbDwULCQgHAgYVCgkICwIE
16+
FgIDAQIeAQUJAAAAAAAKCRCVFASm54U5I/ThEACDegHJz7Dl4aAz2XHC6c/C5ZrJ
17+
7W++tckc3tX3wFg2Ux8AWUwc/3oaT63nG3J7JsF0y+FmD2Loi5grReKRIE7IAAga
18+
aA6y/S73VOm7sApIz4hRvQ8DoWYcuu/pFMZaQKLKh3d7n0Uhlg+IxcnDWYT/xKvn
19+
1RrCOLhokEu22zRDg+VGClmmiyQ8qZdyA8c6OqjT9U2RFwSUnNPkLsdoCU5KVT5l
20+
1znNG5gEovgxIRBbeJuoYXBRIlUO7bH0w3poTZ8dPFzOSLTfG5hLF1sZVMfGBlCf
21+
c94rtLUJyU5LBBe7Py2y0q89v9L1a/BwNRe1ron39PLsmXPUFqV5f796wAnMif9l
22+
5FI1HDHpkjn3RRHjPMUQSeMOJP9HMLjhEIg9I0bDxsbqCg4XW2xfk8J0YE3GhF2p
23+
X5BKFThsMQWAKwwCRrD2EMW3YMv7/E385m3QA3xTU4z2SFEyp/KaoTxFw+Z9Z6ta
24+
7tzdE4NqmcEcVSrOvktIQ3xi9UlngOp7OACe10WhmJiDkAfaTOExHfRLVzvo3ryA
25+
5pNJ6FkV+eJVljBMUzRSkyyGrnesh6c6ViBcV0rZpiE1f7T4gp9tg2YQaOMaoI6P
26+
M9LfRKfyxSklz/aX811eRfmJRPkA9pF0DlCV6j9XJwFaSKZhxoVQVu2/pIGzQwuu
27+
uBfw3hQI0oUbrt3dIw==
28+
=yKDk
29+
-----END PGP PUBLIC KEY BLOCK-----

docs/MustGatherUsage.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
## MQ container inspector mustgather command
2+
3+
The MQ container inspector `mustgather` command collects diagnostic data from the specified queue manager running in a Kubernetes or OpenShift environment. This data is required when opening a case with IBM® MQ containers Support.
4+
5+
### MustGather usage examples
6+
7+
1. Gather diagnostics data using --qm-name:
8+
9+
`mq-container-inspector mustgather --qm-name <queue-manager-name> --qm-namespace <queue-manager-namespace>`
10+
11+
In this example, MQ container inspector uses the `app.kubernetes.io/instance: <queue-manager-name>` label to identify queue manager resources in the specified namespace. When deploying using the MQ Operator, this label is set to the queue manager custom resource `metadata.name`. When deploying using an mq sample helm chart, this label is set to the helm release name.
12+
13+
2. Gather diagnostics data using --pod-name:
14+
15+
`mq-container-inspector mustgather --pod-name <pod-name> --qm-namespace <queue-manager-namespace>`
16+
17+
In this example, MQ container inspector gets the Kubernetes pod with the specified `<pod-name>` and identifies any resources such as as services, statefulset or other queue manager pods which are connected to the specified pod. Using `--pod-name` is recommended if the queue manager is not deployed via the MQ operator or an mq sample helm chart.
18+
19+
### Kubernetes permissions required for mustgather
20+
21+
- The user requires "get" permissions for the resources listed in the [Example files gathered](#example-files-gathered). If the user doesn't have permissions for any resource, they will not be gathered, but the tool will continue to gather other resources where it does have permissions.
22+
- The user requires "create" for "pods/exec" to run runmqras on the queue manager and to gather queue manager log files. Gathering these files can be disabled using the `--skip-exec` flag.
23+
24+
### full mustgather usage options
25+
26+
Below is the full usage options of the must gather tool. This is equivent to the output of the `--help` command
27+
28+
```
29+
Usage of mustgather:
30+
--help
31+
show help message
32+
--kubeconfig
33+
path to the kubeconfig file. Ignored when running via mustgather image (default: ~/.kube/config)
34+
--operator-namespace
35+
namespace where the MQ operator is deployed (default: --qm-namespace)
36+
--output-dir
37+
directory where the must-gather output folder will be created. Ignored when running via mustgather image (default: current working directory)
38+
--pod-name
39+
name of a queue manager pod in the target queue manager instance (exactly one of --qm-name or --pod-name are required)
40+
--qm-name
41+
QueueManager custom resource metadata.name (exactly one of --qm-name or --pod-name are required)
42+
--qm-namespace
43+
namespace where the queue manager is deployed (required)
44+
--skip-exec
45+
skip gathering diagnostic data that require container exec access, e.g. runmqras, webconsole logs (default: false)
46+
--skip-tar
47+
skip compressing the must-gather output into a tar.gz file (default: false)
48+
```
49+
50+
### Example files gathered
51+
52+
#### Root Files
53+
- runmqras-&lt;qm-name&gt;-ibm-mq-0.zip
54+
- must-gather-logs.log
55+
56+
#### mq-operator/
57+
- ibm-mq-operator-current-pod-log.txt
58+
- ibm-mq-operator-previous-pod-log.txt
59+
- ibm-mq-operator-deployment.yaml
60+
- ibm-mq.&lt;version&gt;-csv.yaml
61+
62+
#### queue-managers/
63+
- &lt;qm-name&gt;.yaml
64+
- queue-manager-crd.yaml
65+
66+
#### routes/
67+
- &lt;qm-name&gt;-ibm-mq-qm-routes-to-qm.yaml
68+
- &lt;qm-name&gt;-ibm-mq-qm-routes.yaml
69+
- &lt;qm-name&gt;-ibm-mq-web-routes-to-qm.yaml
70+
- &lt;qm-name&gt;-ibm-mq-web-routes.yaml
71+
72+
#### services/
73+
- &lt;qm-name&gt;-ibm-mq-metrics-service.yaml
74+
- &lt;qm-name&gt;-ibm-mq-service.yaml
75+
76+
#### pods/
77+
- &lt;qm-name&gt;-ibm-mq-0-current-pod-log.txt
78+
- &lt;qm-name&gt;-ibm-mq-0-describe-log.txt
79+
- &lt;qm-name&gt;-ibm-mq-0-pod-events.txt
80+
- &lt;qm-name&gt;-ibm-mq-0.yaml
81+
- pod-details.txt
82+
83+
#### statefulsets/
84+
- &lt;qm-name&gt;-ibm-mq-statefulset-events.txt
85+
- &lt;qm-name&gt;-ibm-mq-statefulset-revisions.yaml
86+
- &lt;qm-name&gt;-ibm-mq-statefulset.yaml
87+
88+
#### pvcs/
89+
- data-&lt;qm-name&gt;-ibm-mq-0-pvc.yaml
90+
91+
#### webconsole/
92+
- web-&lt;qm-name&gt;-ibm-mq-0-console.log
93+
- web-&lt;qm-name&gt;-ibm-mq-0-messages.log

docs/PVCToolUsage.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
## PVCTool Usage
2+
3+
The MQ container inspector PVC tool creates pod(s) the the same nodes as the queue manager pod(s) attached to the queue manager PVCs. You can then exec into the pvc pods to investigate the pvcs manually or run the tool with the `--runmqras` flag to run the runmqras must gather on the pod.
4+
5+
### PVCTool usage examples
6+
7+
1. Create pvctool pods using --qm-name:
8+
9+
`mq-container-inspector pvctool --qm-name <queue-manager-name> --qm-namespace <queue-manager-namespace>`
10+
11+
This command creates pods attached to the queue manager PVCs. You can exec into these pods to manually inspect the PVCs in a Kubernetes or OpenShift environment.
12+
13+
**Note**: If you exec into a pvctool pod, any changes to the PVC will affect the corresponding queue manager and could result in a corrupted queue manager or lost messages.
14+
15+
To delete the pvctool pods, run the same command with the --cleanup flag:
16+
17+
`mq-container-inspector pvctool --qm-name <queue-manager-name> --qm-namespace <namespace> --cleanup`
18+
19+
2. Perform a runmqras must gather using the pvc tool:
20+
21+
`mq-container-inspector pvctool --qm-name <queue-manager-name> --qm-namespace <queue-manager-namespace> --runmqras --cleanup`
22+
23+
This command creates pods attached to the queue manager PVCs. It then execs into the pvctool pod, runs runmqras and deletes the pvctool pods.
24+
25+
By default, the output is saved inside a `PVC_Inspector_<timestamp>` folder in the current working directory.
26+
27+
### Kubernetes permissions required for pvctool
28+
29+
- The user requires "get" permissions for "pods" and "configmaps".
30+
- The user requires "create" permissions for "pods" and "configmaps" and will create these resources when it is run.
31+
- The user requires "create" for "pods/exec" to run runmqras on the pods created by pvctool.
32+
33+
34+
## full pvctool usage options
35+
36+
Below is the full usage options of the must gather tool. This is equivent to the output of the `--help` command
37+
38+
```
39+
Usage of pvctool:
40+
--cleanup
41+
delete the pvc-inspector pods at the end of the tool run (default: false)
42+
--dry-run
43+
run without creating the pvc-inspector pods (default: false)
44+
--help
45+
show help message
46+
--kubeconfig
47+
path to the kubeconfig file. Ignored when running via mustgather image. (default: ~/.kube/config)
48+
--output-dir
49+
directory where the must-gather output folder will be created. Ignored when running via mustgather image. (default: current working directory)
50+
--pod-name
51+
name of a queue manager pod in the target queue manager instance (exactly one of --qm-name or pod-name are required)
52+
--qm-name
53+
QueueManager custom resource metadata.name (exactly one of --qm-name or pod-name are required)
54+
--qm-namespace
55+
namespace where the queue manager is deployed (required)
56+
--runmqras
57+
execute runmqras on the pvc-inspector pods (default: false)
58+
--skip-tar
59+
skip compressing the pvctool output into a tar.gz file (default: false)
60+
```
61+
62+
### Example tool output
63+
64+
If you use the `--runmqras` flag, the pvctool command will create a folder called `PVC_Inspector_<timestamp>` in the `--output-dir` (defaults to current working directory). This will contain a [runmqras](https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=reference-runmqras-collect-mq-troubleshooting-information) tarball for each queue manager and a logfile for the tool.
65+
66+
The tool will also create a tarball of the PVC_Inspector_<timestamp> folder which should be uploaded to the support case.

0 commit comments

Comments
 (0)