From b8be2e723c39846e7f9dcbc54ac07c25b7783435 Mon Sep 17 00:00:00 2001 From: Neha Viswanathan Date: Mon, 1 Mar 2021 16:25:50 -0800 Subject: [PATCH 1/2] use targetPort instead of containerPort --- .../docs/tasks/debug-application-cluster/debug-application.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/debug-application-cluster/debug-application.md b/content/en/docs/tasks/debug-application-cluster/debug-application.md index f665accb18..5c2e89a1c6 100644 --- a/content/en/docs/tasks/debug-application-cluster/debug-application.md +++ b/content/en/docs/tasks/debug-application-cluster/debug-application.md @@ -142,7 +142,7 @@ kubectl get pods --selector=name=nginx,type=frontend to list pods that match this selector. Verify that the list matches the Pods that you expect to provide your Service. If the list of pods matches expectations, but your endpoints are still empty, it's possible that you don't -have the right ports exposed. If your service has a `containerPort` specified, but the Pods that are +have the right ports exposed. If your service has a `targetPort` specified, but the Pods that are selected don't have that port listed, then they won't be added to the endpoints list. Verify that the pod's `containerPort` matches up with the Service's `targetPort` @@ -157,7 +157,7 @@ check: * Are your pods working correctly? Look for restart count, and [debug pods](#debugging-pods). * Can you connect to your pods directly? Get the IP address for the Pod, and try to connect directly to that IP. - * Is your application serving on the port that you configured? Kubernetes doesn't do port remapping, so if your application serves on 8080, the `containerPort` field needs to be 8080. + * Is your application serving on the port that you configured? If your application serves on 8080, the `targetPort` field needs to be 8080. ## {{% heading "whatsnext" %}} From 927b5af65f2a5264a17d86ceb0db5650d0665412 Mon Sep 17 00:00:00 2001 From: Neha Viswanathan Date: Fri, 26 Mar 2021 14:37:54 -0700 Subject: [PATCH 2/2] update --- .../debug-application.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/content/en/docs/tasks/debug-application-cluster/debug-application.md b/content/en/docs/tasks/debug-application-cluster/debug-application.md index 5c2e89a1c6..f927ba5e5b 100644 --- a/content/en/docs/tasks/debug-application-cluster/debug-application.md +++ b/content/en/docs/tasks/debug-application-cluster/debug-application.md @@ -140,24 +140,11 @@ kubectl get pods --selector=name=nginx,type=frontend ``` to list pods that match this selector. Verify that the list matches the Pods that you expect to provide your Service. - -If the list of pods matches expectations, but your endpoints are still empty, it's possible that you don't -have the right ports exposed. If your service has a `targetPort` specified, but the Pods that are -selected don't have that port listed, then they won't be added to the endpoints list. - Verify that the pod's `containerPort` matches up with the Service's `targetPort` #### Network traffic is not forwarded -If you can connect to the service, but the connection is immediately dropped, and there are endpoints -in the endpoints list, it's likely that the proxy can't contact your pods. - -There are three things to -check: - - * Are your pods working correctly? Look for restart count, and [debug pods](#debugging-pods). - * Can you connect to your pods directly? Get the IP address for the Pod, and try to connect directly to that IP. - * Is your application serving on the port that you configured? If your application serves on 8080, the `targetPort` field needs to be 8080. +Please see [debugging service](/docs/tasks/debug-application-cluster/debug-service.md) for more information. ## {{% heading "whatsnext" %}}