|
| 1 | + |
| 2 | +// Module included in the following assemblies: |
| 3 | +// |
| 4 | +// *mcp_gateway_config/mcp-gateway-troubleshooting.adoc |
| 5 | + |
| 6 | +:_mod-docs-content-type: PROCEDURE |
| 7 | +[id="proc-mcp-gateway-ts-gateway-listener-not-working_{context}"] |
| 8 | += Troubleshooting the gateway listener not working |
| 9 | + |
| 10 | +[role="_abstract"] |
| 11 | +If your MCP gateway cannot reach an MCP endpoint at configured hostname, the cause might be that the `Listener` custom resource (CR) you configured is not working. You can troubleshoot this situation by using a few commands and some insight. |
| 12 | + |
| 13 | +Use the following concepts in conjunction with the commands that follow to solve a non-functioning `Listener` CR: |
| 14 | + |
| 15 | +* Ensure that your `Gateway` object has `Accepted` and `Programmed` conditions set to `True`. |
| 16 | +* Verify that the `hostname` in the `Listener `CR matches your DNS or hosts configuration. |
| 17 | +
|
| 18 | +.Prerequisites |
| 19 | + |
| 20 | +* You installed {mcpg}. |
| 21 | +* You installed {prodname}. |
| 22 | +* You configured a `Gateway` object. |
| 23 | +* You configured an `HTTPRoute` object for the gateway. |
| 24 | +* You installed the {oc-first}. |
| 25 | +* You registered an MCP server. |
| 26 | +
|
| 27 | +.Procedure |
| 28 | + |
| 29 | +. Check the general `Gateway` object configuration by running the following command: |
| 30 | ++ |
| 31 | +[source,terminal] |
| 32 | +---- |
| 33 | +$ oc get gateway -A |
| 34 | +---- |
| 35 | ++ |
| 36 | +This command returns general information about all `Gateway` objects in the cluster. If the `Gateway` object you are troubleshooting does exist, the command returns the `gatewayClassName` is it using, whether or not it has an IP address or hostname assigned, and a `status`, such as `Ready`, `Programmed`, or `Pending`. |
| 37 | + |
| 38 | +. Check the full metadata and status history for one specific `Gateway` object by running the following command: |
| 39 | ++ |
| 40 | +[source,terminal,subs="+quotes"] |
| 41 | +---- |
| 42 | +$ oc describe gateway _<gateway_name>_ -n _<namespace>_ |
| 43 | +---- |
| 44 | ++ |
| 45 | +* Replace `_<gateway_name>_` with the name of the `Gateway` object. |
| 46 | +* Replace `_<namespace>_` with the namespace where it is applied. |
| 47 | +* This command can help you figure out why a `Gateway` object is stuck in `Pending` by checking for port conflicts and verifying that `SSL/TLS` certificates are correctly attached to `Listener` CRs. |
| 48 | +
|
| 49 | +. Verify the `Listener` CR configuration by running the following command: |
| 50 | ++ |
| 51 | +[source,terminal,subs="+quotes"] |
| 52 | +---- |
| 53 | +$ oc get gateway _<gateway_name>_ -n _<namespace>_ -o yaml | grep -A 10 listeners |
| 54 | +---- |
| 55 | ++ |
| 56 | +* Replace `_<gateway_name>_` with the name of the `Gateway` object. |
| 57 | +* Replace `_<namespace>_` with the namespace where the `Gateway object` is applied. |
| 58 | +
|
| 59 | +. Check all of your `Listener` CR configurations at the same time by running the following command: |
| 60 | ++ |
| 61 | +[source,terminal,subs="+quotes"] |
| 62 | +---- |
| 63 | +$ oc get gateway _<gateway_name>_ -n _<namespace>_ -o jsonpath='{range .spec.listeners[*]}{.name}{"\t"}{.hostname}{"\t"}{.port}{"\n"}{end}' | jq |
| 64 | +---- |
| 65 | +* Replace `_<gateway_name>_` with the name of the `Gateway` object. |
| 66 | +* Replace `_<namespace>_` with the namespace where your `Gateway` object is applied. |
| 67 | +* This command uses `jq` for formatting. |
| 68 | +
|
| 69 | +. Check that the Istio gateway pod is running by using the following command: |
| 70 | ++ |
| 71 | +[source,terminal,subs="+quotes"] |
| 72 | +---- |
| 73 | +$ oc get pods -n _<gateway_system>_ -l istio=ingressgateway |
| 74 | +---- |
| 75 | ++ |
| 76 | +* Replace `_<gateway_system>_` with the name of your `Gateway` object deployment. |
| 77 | +* This command checks the status of Envoy-proxy pods and returns pod, traffic flow, and policy errors. |
| 78 | +
|
| 79 | +. Verify that the port you are trying to use is not already in use by running the following command: |
| 80 | ++ |
| 81 | +[source,terminal] |
| 82 | +---- |
| 83 | +$ oc get gateway -A -o yaml | grep "port:" |
| 84 | +---- |
0 commit comments