{"id":20138,"date":"2023-10-04T05:58:17","date_gmt":"2023-10-04T09:58:17","guid":{"rendered":"https:\/\/qxf2.com\/blog\/?p=20138"},"modified":"2023-10-04T05:58:17","modified_gmt":"2023-10-04T09:58:17","slug":"kubernetes-app-debug","status":"publish","type":"post","link":"https:\/\/qxf2.com\/blog\/kubernetes-app-debug\/","title":{"rendered":"Investigation of the application deployed on Kubernetes"},"content":{"rendered":"<p>As a tester, we work with applications deployed on Kubernetes. That means, we need to know how to interact with various components of Kubernetes. But most online tutorials start with stuff that applies mostly to developers and DevOps engineers like install, writing deploy scripts, etc. Those are not really useful to testers, at least not directly. So, in this blog, I have tried to cover most of the components of Kubernetes that testers need to know and explore. To gain practical hands-on experience, you can deploy our Todo list app, which is available <a href=\"https:\/\/github.com\/qxf2\/Todo-List-App-Deployment-on-Kubernetes\" rel=\"noopener\" target=\"_blank\">here<\/a>, on Kubernetes platforms like Minikube, Kind, or any cloud platform such as EKS, AKS, GKS. At <a href=\"https:\/\/qxf2.com\/contact?utm_source=kubernetes_app_debug&#038;utm_medium=click&#038;utm_campaign=From%20blog\">Qxf2<\/a>, we deployed the Todo list app on Minikube and captured screenshots for this blog. You can also try it with your own app.<\/p>\n<hr>\n<h4>Check Nodes: <\/h4>\n<p>&#8220;Nodes&#8221; in Kubernetes are the individual worker machines that make up a cluster. They are responsible for running containers, hosting Pods, and executing the workloads managed by the Kubernetes control plane. Nodes provide the computing and networking resources needed to run applications.<\/p>\n<p>Use the following command to check all Nodes:<\/p>\n<pre lang=\"python\"> kubectl get nodes <\/pre>\n<p>This command provides all available nodes along with their status, roles, age, and version. Look at the screenshot below.<br \/>\n<figure id=\"attachment_20268\" aria-describedby=\"caption-attachment-20268\" style=\"width: 450px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-nodes.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-nodes.png\" alt=\"Get nodes\" width=\"450\" height=\"58\" class=\"size-full wp-image-20268\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-nodes.png 450w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-nodes-300x39.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><figcaption id=\"caption-attachment-20268\" class=\"wp-caption-text\">Get Nodes<\/figcaption><\/figure><\/p>\n<p>To get more details about nodes, you can use the following command:<\/p>\n<pre lang=\"python\"> kubectl get nodes -o wide <\/pre>\n<p>The above command provides additional information about internal IP address, external IP address, OS image, Kernel version, and readiness container runtime. Look at the screenshot below.<br \/>\n<figure id=\"attachment_20269\" aria-describedby=\"caption-attachment-20269\" style=\"width: 1255px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-with-wide-option.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-with-wide-option.png\" alt=\"Get nodes with wide option\" width=\"1255\" height=\"59\" class=\"size-full wp-image-20269\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-with-wide-option.png 1255w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-with-wide-option-300x14.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-with-wide-option-1024x48.png 1024w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-with-wide-option-768x36.png 768w\" sizes=\"auto, (max-width: 1255px) 100vw, 1255px\" \/><\/a><figcaption id=\"caption-attachment-20269\" class=\"wp-caption-text\">Get Nodes with Wide option<\/figcaption><\/figure><\/p>\n<p>To see even more details of any node, you can use the following command. It will provide all information about a specific node. Look at the screenshot below.<br \/>\n<figure id=\"attachment_20270\" aria-describedby=\"caption-attachment-20270\" style=\"width: 1485px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-and-describe-copy.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-and-describe-copy.png\" alt=\"Node details\" width=\"1485\" height=\"923\" class=\"size-full wp-image-20270\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-and-describe-copy.png 1485w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-and-describe-copy-300x186.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-and-describe-copy-1024x636.png 1024w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-node-and-describe-copy-768x477.png 768w\" sizes=\"auto, (max-width: 1485px) 100vw, 1485px\" \/><\/a><figcaption id=\"caption-attachment-20270\" class=\"wp-caption-text\">Node details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check Pods:<\/h4>\n<p>In Kubernetes, a &#8220;Pod&#8221; is the smallest deployable unit that can hold one or multiple containers. Pods are the basic building blocks of applications in a Kubernetes cluster. Containers within a Pod share the same network namespace, which means they can communicate with each other using localhost, and they can also share storage volumes.<\/p>\n<p>Use the following command to check all Pods:<\/p>\n<pre lang=\"python\"> kubectl get pods <\/pre>\n<p>This command provides all available pod names along with their status, readiness, how many times they have restarted, and age. You can check the status, readiness, and the number of restarts to decide if there is any problem with the pod. Look at the screenshot below.<br \/>\n<figure id=\"attachment_20231\" aria-describedby=\"caption-attachment-20231\" style=\"width: 842px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods.png\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods.png\" alt=\"Get Pods\" width=\"842\" height=\"202\" class=\"size-full wp-image-20231\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods.png 842w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-300x72.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-768x184.png 768w\" sizes=\"auto, (max-width: 842px) 100vw, 842px\" \/><\/a><figcaption id=\"caption-attachment-20231\" class=\"wp-caption-text\">Get Pods<\/figcaption><\/figure><\/p>\n<p>If you want even more details about pods, you can use the following command:<\/p>\n<pre lang=\"python\">kubectl get pods -o wide <\/pre>\n<p>The above command provides additional information such as IP address, the node where the pod is deployed, the nominated node, and readiness gates. Refer to the screenshot below.<br \/>\n<figure id=\"attachment_20233\" aria-describedby=\"caption-attachment-20233\" style=\"width: 1392px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-with-wide-option.png\" data-rel=\"lightbox-image-4\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-with-wide-option.png\" alt=\"get pods with wide option\" width=\"1392\" height=\"202\" class=\"size-full wp-image-20233\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-with-wide-option.png 1392w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-with-wide-option-300x44.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-with-wide-option-1024x149.png 1024w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-with-wide-option-768x111.png 768w\" sizes=\"auto, (max-width: 1392px) 100vw, 1392px\" \/><\/a><figcaption id=\"caption-attachment-20233\" class=\"wp-caption-text\">Get Pods with Wide option<\/figcaption><\/figure><\/p>\n<p>Usually, the pod&#8217;s status, readiness, and restart fields help to find problems with the pods. If you notice a problem with a pod or you want to see more details, you can use the following command:<\/p>\n<pre lang=\"python\">kubectl describe <pod name> <\/pre>\n<p>The above command provides complete details about the pod, including its namespace, status, IPs, container details, volumes, node selectors, conditions, events, etc. Refer to the screenshot below.<br \/>\n<figure id=\"attachment_20234\" aria-describedby=\"caption-attachment-20234\" style=\"width: 773px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/pod-describe.png\" data-rel=\"lightbox-image-5\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/pod-describe.png\" alt=\"Pod Details\" width=\"773\" height=\"934\" class=\"size-full wp-image-20234\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/pod-describe.png 773w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/pod-describe-248x300.png 248w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/pod-describe-768x928.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/a><figcaption id=\"caption-attachment-20234\" class=\"wp-caption-text\">Pod Details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check deployments:<\/h4>\n<p>In Kubernetes, a &#8220;Deployment&#8221; is a resource that defines and manages the desired state of a set of Pods. Deployments ensure that a specified number of replica Pods are running at all times, and they can handle updates and rollbacks of application versions. Deployments are a key component for managing and scaling applications in Kubernetes.<\/p>\n<p>Use the command below to list the available deploy resources in Kubernetes.<\/p>\n<pre lang=\"python\">kubectl get deploy <\/pre>\n<p>The above command lists out all deploy names along with their readiness, availability, update status, and age. Look at the screenshot below:<br \/>\n<figure id=\"attachment_20236\" aria-describedby=\"caption-attachment-20236\" style=\"width: 665px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-1.png\" data-rel=\"lightbox-image-6\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-1.png\" alt=\"Get deploy\" width=\"665\" height=\"147\" class=\"size-full wp-image-20236\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-1.png 665w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-1-300x66.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/a><figcaption id=\"caption-attachment-20236\" class=\"wp-caption-text\">Get Deploy<\/figcaption><\/figure><\/p>\n<p>If you want to see more details like containers and images, you can run the command along with the &#8220;-o wide&#8221; option.<\/p>\n<pre lang=\"python\">kubectl get deploy -o wide <\/pre>\n<p>Now it provides additional container, image, and selector details used for deployment.<br \/>\n<figure id=\"attachment_20237\" aria-describedby=\"caption-attachment-20237\" style=\"width: 1838px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-with-wide-option.png\" data-rel=\"lightbox-image-7\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-with-wide-option.png\" alt=\"Get deploy with wide option\" width=\"1838\" height=\"273\" class=\"size-full wp-image-20237\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-with-wide-option.png 1838w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-with-wide-option-300x45.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-with-wide-option-1024x152.png 1024w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-with-wide-option-768x114.png 768w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-with-wide-option-1536x228.png 1536w\" sizes=\"auto, (max-width: 1838px) 100vw, 1838px\" \/><\/a><figcaption id=\"caption-attachment-20237\" class=\"wp-caption-text\">Get deploy with Wide option<\/figcaption><\/figure><\/p>\n<p>If you want to check even further details, you can use the &#8220;describe&#8221; command:<\/p>\n<pre lang=\"python\">kubectl describe deploy <deploy_name> <\/pre>\n<p>Look at the below screenshot.<br \/>\n<figure id=\"attachment_20238\" aria-describedby=\"caption-attachment-20238\" style=\"width: 784px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-describe.png\" data-rel=\"lightbox-image-8\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-describe.png\" alt=\"Deploy details\" width=\"784\" height=\"596\" class=\"size-full wp-image-20238\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-describe.png 784w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-describe-300x228.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/deploy-describe-768x584.png 768w\" sizes=\"auto, (max-width: 784px) 100vw, 784px\" \/><\/a><figcaption id=\"caption-attachment-20238\" class=\"wp-caption-text\">Deploy details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check StatefulSet:<\/h4>\n<p>A &#8220;StatefulSet&#8221; is a Kubernetes resource used for managing stateful applications, such as databases, where each pod has a stable and unique identity. It ensures ordered, stable deployment and scaling of Pods, making it suitable for applications that require persistent network identifiers and storage.<\/p>\n<p>Use the command below to list the available StatefulSet resources in Kubernetes.<\/p>\n<pre lang=\"python\">kubectl get statefulset <\/pre>\n<p>The above command lists all the StatefulSet names along with their readiness and age. Please refer to the screenshot below. <figure id=\"attachment_20240\" aria-describedby=\"caption-attachment-20240\" style=\"width: 344px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset.png\" data-rel=\"lightbox-image-9\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset.png\" alt=\"Get StatefulSet\" width=\"344\" height=\"75\" class=\"size-full wp-image-20240\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset.png 344w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-300x65.png 300w\" sizes=\"auto, (max-width: 344px) 100vw, 344px\" \/><\/a><figcaption id=\"caption-attachment-20240\" class=\"wp-caption-text\">Get StatefulSet<\/figcaption><\/figure><\/p>\n<p>If you want to see more details, such as containers and images, you can run the command with the &#8220;-o wide&#8221; option.<\/p>\n<pre lang=\"python\">kubectl get statefulset -o wide <\/pre>\n<p>Now it provides additional information about containers and images used.<br \/>\n<figure id=\"attachment_20241\" aria-describedby=\"caption-attachment-20241\" style=\"width: 853px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-with-wide.png\" data-rel=\"lightbox-image-10\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-with-wide.png\" alt=\"StatefulSet with wide option\" width=\"853\" height=\"74\" class=\"size-full wp-image-20241\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-with-wide.png 853w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-with-wide-300x26.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-with-wide-768x67.png 768w\" sizes=\"auto, (max-width: 853px) 100vw, 853px\" \/><\/a><figcaption id=\"caption-attachment-20241\" class=\"wp-caption-text\">StatefulSet with wide option<\/figcaption><\/figure><\/p>\n<p>If you want to check even further details, you can use the &#8220;describe&#8221; command:<\/p>\n<pre lang=\"python\">kubectl describe statefulset <StatefulSet_name> <\/pre>\n<p>Please refer to the screenshot below.<br \/>\n<figure id=\"attachment_20242\" aria-describedby=\"caption-attachment-20242\" style=\"width: 613px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-describe.png\" data-rel=\"lightbox-image-11\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-describe.png\" alt=\"StatefulSet details\" width=\"613\" height=\"579\" class=\"size-full wp-image-20242\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-describe.png 613w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/statefulset-describe-300x283.png 300w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/a><figcaption id=\"caption-attachment-20242\" class=\"wp-caption-text\">StatefulSet details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check Replicaset:<\/h4>\n<p>A &#8220;ReplicaSet&#8221; is a Kubernetes resource used for ensuring a specified number of replica Pods are running at all times. It helps maintain the desired number of identical Pods, making it useful for achieving high availability and load balancing in Kubernetes.<\/p>\n<p>Use the following command to list out the replica sets:<\/p>\n<pre lang=\"python\">kubectl get rs<\/pre>\n<p>The above command provides a list of available replica sets along with desired, current, and ready state details. Please refer to the screenshot below:<br \/>\n<figure id=\"attachment_20244\" aria-describedby=\"caption-attachment-20244\" style=\"width: 713px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset.png\" data-rel=\"lightbox-image-12\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset.png\" alt=\"Get ReplicaSet\" width=\"713\" height=\"147\" class=\"size-full wp-image-20244\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset.png 713w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-300x62.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/a><figcaption id=\"caption-attachment-20244\" class=\"wp-caption-text\">Get ReplicaSet<\/figcaption><\/figure><\/p>\n<p>You can run the above command with the &#8220;-o wide&#8221; option to get container, image, and selector details.<br \/>\n<figure id=\"attachment_20245\" aria-describedby=\"caption-attachment-20245\" style=\"width: 1843px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-wide.png\" data-rel=\"lightbox-image-13\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-wide.png\" alt=\"Get ReplicaSet with wide option\" width=\"1843\" height=\"274\" class=\"size-full wp-image-20245\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-wide.png 1843w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-wide-300x45.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-wide-1024x152.png 1024w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-wide-768x114.png 768w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-wide-1536x228.png 1536w\" sizes=\"auto, (max-width: 1843px) 100vw, 1843px\" \/><\/a><figcaption id=\"caption-attachment-20245\" class=\"wp-caption-text\">Get ReplicaSet with wide option<\/figcaption><\/figure><\/p>\n<p>If you want to know more details, you can use the following describe command:<\/p>\n<pre lang=\"python\"> kubectl describe rs <replica set name> <\/pre>\n<p>Please refer to the screenshot below.<br \/>\n<figure id=\"attachment_20246\" aria-describedby=\"caption-attachment-20246\" style=\"width: 645px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-describe.png\" data-rel=\"lightbox-image-14\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-describe.png\" alt=\"ReplicaSet Details\" width=\"645\" height=\"526\" class=\"size-full wp-image-20246\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-describe.png 645w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/replicaset-describe-300x245.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/a><figcaption id=\"caption-attachment-20246\" class=\"wp-caption-text\">ReplicaSet Details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check Service:<\/h4>\n<p>A &#8220;Service&#8221; in Kubernetes is a resource that defines a stable network endpoint for accessing a set of Pods. It enables load balancing, service discovery, and abstracts the network details, allowing other Pods to access a set of Pods using a single, consistent hostname or IP address.<\/p>\n<p>To check the list of all available services, use the following command:<\/p>\n<pre lang=\"python\"> kubectl get svc <\/pre>\n<p>This command lists all available services along with their type, cluster IP, external IP, port, and age. Look at the screenshot below.<br \/>\n<figure id=\"attachment_20247\" aria-describedby=\"caption-attachment-20247\" style=\"width: 921px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service.png\" data-rel=\"lightbox-image-15\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service.png\" alt=\"Get Service\" width=\"921\" height=\"276\" class=\"size-full wp-image-20247\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service.png 921w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-300x90.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-768x230.png 768w\" sizes=\"auto, (max-width: 921px) 100vw, 921px\" \/><\/a><figcaption id=\"caption-attachment-20247\" class=\"wp-caption-text\">Get Service<\/figcaption><\/figure><\/p>\n<p>You can use the &#8220;-o wide&#8221; option to get selector details.<\/p>\n<figure id=\"attachment_20248\" aria-describedby=\"caption-attachment-20248\" style=\"width: 1848px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-with-wide.png\" data-rel=\"lightbox-image-16\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-with-wide.png\" alt=\"Get Service with Wide option\" width=\"1848\" height=\"311\" class=\"size-full wp-image-20248\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-with-wide.png 1848w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-with-wide-300x50.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-with-wide-1024x172.png 1024w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-with-wide-768x129.png 768w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-with-wide-1536x258.png 1536w\" sizes=\"auto, (max-width: 1848px) 100vw, 1848px\" \/><\/a><figcaption id=\"caption-attachment-20248\" class=\"wp-caption-text\">Get Service with Wide option<\/figcaption><\/figure>\n<p>If you want to know more details about a service, you can use the &#8220;describe&#8221; command for that specific service:<\/p>\n<pre lang=\"python\"> kubectl describe svc <service name> <\/pre>\n<p>Please refer to the screenshot below.<br \/>\n<figure id=\"attachment_20249\" aria-describedby=\"caption-attachment-20249\" style=\"width: 478px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-describe.png\" data-rel=\"lightbox-image-17\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-describe.png\" alt=\"Service Details\" width=\"478\" height=\"328\" class=\"size-full wp-image-20249\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-describe.png 478w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/service-describe-300x206.png 300w\" sizes=\"auto, (max-width: 478px) 100vw, 478px\" \/><\/a><figcaption id=\"caption-attachment-20249\" class=\"wp-caption-text\">Service Details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check ConfigMap:<\/h4>\n<p>A &#8220;ConfigMap&#8221; in Kubernetes is a resource for storing configuration data as key-value pairs or as plain text in a centralized and reusable manner. It allows you to decouple configuration from application code, making it easier to manage and update configuration settings for Pods and other resources in the cluster.<\/p>\n<p>To check the list of all ConfigMaps, use the following command:<\/p>\n<pre lang=\"python\"> kubectl get configmap <\/pre>\n<p>This command lists all available ConfigMaps along with the number of data it consists of. Please refer to the screenshot below.<br \/>\n<figure id=\"attachment_20251\" aria-describedby=\"caption-attachment-20251\" style=\"width: 331px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/configmap.png\" data-rel=\"lightbox-image-18\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/configmap.png\" alt=\"Get Config\" width=\"331\" height=\"129\" class=\"size-full wp-image-20251\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/configmap.png 331w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/configmap-300x117.png 300w\" sizes=\"auto, (max-width: 331px) 100vw, 331px\" \/><\/a><figcaption id=\"caption-attachment-20251\" class=\"wp-caption-text\">Get Config<\/figcaption><\/figure><\/p>\n<p>If you want to know more details about a ConfigMap, you can use the &#8220;describe&#8221; command:<\/p>\n<pre lang=\"python\"> kubectl describe configmap <configmap name> <\/pre>\n<p>Please refer to the screenshot below for ConfigMap details.<br \/>\n<figure id=\"attachment_20252\" aria-describedby=\"caption-attachment-20252\" style=\"width: 357px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/configmap-describe.png\" data-rel=\"lightbox-image-19\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/configmap-describe.png\" alt=\"Config details\" width=\"357\" height=\"288\" class=\"size-full wp-image-20252\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/configmap-describe.png 357w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/configmap-describe-300x242.png 300w\" sizes=\"auto, (max-width: 357px) 100vw, 357px\" \/><\/a><figcaption id=\"caption-attachment-20252\" class=\"wp-caption-text\">Config details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check Secrets:<\/h4>\n<p>A &#8220;Secret&#8221; in Kubernetes is a resource for storing sensitive data, such as API keys, passwords, or certificates, securely within the cluster. Secrets are base64-encoded and can be mounted into Pods as files or exposed as environment variables, providing a way to manage and access sensitive information in a more secure manner.<\/p>\n<p>To check the list of all secrets, use the command below:<\/p>\n<pre lang=\"python\"> kubectl get secrets <\/pre>\n<p>This command lists all available secrets along with the number of data it consists of. Look at the screenshot below.<br \/>\n<figure id=\"attachment_20254\" aria-describedby=\"caption-attachment-20254\" style=\"width: 605px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-secrets.png\" data-rel=\"lightbox-image-20\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-secrets.png\" alt=\"Get Secrets\" width=\"605\" height=\"112\" class=\"size-full wp-image-20254\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-secrets.png 605w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-secrets-300x56.png 300w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/a><figcaption id=\"caption-attachment-20254\" class=\"wp-caption-text\">Get Secrets<\/figcaption><\/figure><\/p>\n<p>If you want to know more details about secrets, you can use the &#8220;describe&#8221; command:<\/p>\n<pre lang=\"python\"> kubectl describe secrets <secrets name> <\/pre>\n<p>Look at the screenshot below; it shows secret keys along with their value sizes.<br \/>\n<figure id=\"attachment_20255\" aria-describedby=\"caption-attachment-20255\" style=\"width: 330px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/secrets-details.png\" data-rel=\"lightbox-image-21\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/secrets-details.png\" alt=\"Secrets details\" width=\"330\" height=\"238\" class=\"size-full wp-image-20255\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/secrets-details.png 330w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/secrets-details-300x216.png 300w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/a><figcaption id=\"caption-attachment-20255\" class=\"wp-caption-text\">Secrets details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check Ingress:<\/h4>\n<p>&#8220;Ingress&#8221; in Kubernetes is a resource that manages external access to services within the cluster. It acts as an API gateway and load balancer, routing incoming HTTP and HTTPS traffic to specific services based on rules defined in the Ingress resource.<\/p>\n<p>To check the list of all Ingress, use the following command:<\/p>\n<pre lang=\"python\"> kubectl get ingress <\/pre>\n<p>This command lists all available Ingress along with hosts and addresses. Look at the screenshot below.<br \/>\n<figure id=\"attachment_20256\" aria-describedby=\"caption-attachment-20256\" style=\"width: 656px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-ingress.png\" data-rel=\"lightbox-image-22\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-ingress.png\" alt=\"Get Ingress\" width=\"656\" height=\"80\" class=\"size-full wp-image-20256\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-ingress.png 656w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-ingress-300x37.png 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/a><figcaption id=\"caption-attachment-20256\" class=\"wp-caption-text\">Get Ingress<\/figcaption><\/figure><\/p>\n<p>If you want to know more details about Ingress, you can use the &#8220;describe&#8221; command:<\/p>\n<pre lang=\"python\"> kubectl describe ingress <ingress name> <\/pre>\n<p>Look at the screenshot below; it shows additional information about the Ingress class, rules, etc.<br \/>\n<figure id=\"attachment_20257\" aria-describedby=\"caption-attachment-20257\" style=\"width: 755px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/describe-ingress.png\" data-rel=\"lightbox-image-23\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/describe-ingress.png\" alt=\"Ingress details\" width=\"755\" height=\"312\" class=\"size-full wp-image-20257\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/describe-ingress.png 755w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/describe-ingress-300x124.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/a><figcaption id=\"caption-attachment-20257\" class=\"wp-caption-text\">Ingress details<\/figcaption><\/figure><\/p>\n<hr>\n<h4>Check Egress:<\/h4>\n<p>In Kubernetes, &#8220;egress&#8221; refers to the network traffic that originates from within a Kubernetes cluster and is destined for resources outside of the cluster. Egress traffic typically includes requests made by pods to external services, APIs, databases, or the internet as a whole. <\/p>\n<p>You can check Egress policies using the following command:<\/p>\n<pre lang=\"python\"> kubectl get networkpolicy <\/pre>\n<p>Note: No egress policy is set in our example available here, so no screenshot is provided.<\/p>\n<hr>\n<h4>How to check logs:<\/h4>\n<p>If your application generates logs, then you can view them using the following command:<\/p>\n<pre lang=\"python\"> kubectl logs <pod name> <\/pre>\n<p>Please refer to the screenshot below.<br \/>\n<figure id=\"attachment_20259\" aria-describedby=\"caption-attachment-20259\" style=\"width: 1519px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-logs.png\" data-rel=\"lightbox-image-24\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-logs.png\" alt=\"Get Pod logs\" width=\"1519\" height=\"331\" class=\"size-full wp-image-20259\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-logs.png 1519w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-logs-300x65.png 300w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-logs-1024x223.png 1024w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/get-pods-logs-768x167.png 768w\" sizes=\"auto, (max-width: 1519px) 100vw, 1519px\" \/><\/a><figcaption id=\"caption-attachment-20259\" class=\"wp-caption-text\">Get Pod logs<\/figcaption><\/figure><\/p>\n<hr>\n<h4>How to enter inside the containers:<\/h4>\n<p>For further debugging, sometimes we need to enter a pod or run a specific command. To do that, use the following command:<\/p>\n<pre lang=\"python\"> kubectl exec -it <podname> -- <command> <\/pre>\n<p>To enter the container and investigate its contents, you can use \/bin\/bash or \/sh depending on the container&#8217;s design:<\/p>\n<pre lang=\"python\"> kubectl exec -it <podname> -- \/bin\/bash <\/pre>\n<p>Please refer to the screenshot below.<br \/>\n<figure id=\"attachment_20266\" aria-describedby=\"caption-attachment-20266\" style=\"width: 657px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/kubectl-exec-binbash.png\" data-rel=\"lightbox-image-25\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/kubectl-exec-binbash.png\" alt=\"Enter inside pod\/container\" width=\"657\" height=\"86\" class=\"size-full wp-image-20266\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/kubectl-exec-binbash.png 657w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/kubectl-exec-binbash-300x39.png 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/a><figcaption id=\"caption-attachment-20266\" class=\"wp-caption-text\">Enter inside pod\/container<\/figcaption><\/figure><\/p>\n<hr>\n<h4>How to check if ConfigMap or Secrets have been applied correctly or not:<\/h4>\n<p>To verify whether ConfigMaps or Secrets have been applied correctly to a pod, you need to run the &#8220;printenv&#8221; command on the respective pod and check if your ConfigMaps or Secrets were set correctly or not. Please refer to the screenshot below.<br \/>\n<figure id=\"attachment_20258\" aria-describedby=\"caption-attachment-20258\" style=\"width: 731px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/run-command.png\" data-rel=\"lightbox-image-26\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/run-command.png\" alt=\"Run command inside the pod\/container\" width=\"731\" height=\"634\" class=\"size-full wp-image-20258\" srcset=\"https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/run-command.png 731w, https:\/\/qxf2.com\/blog\/wp-content\/uploads\/2023\/09\/run-command-300x260.png 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/a><figcaption id=\"caption-attachment-20258\" class=\"wp-caption-text\">Run command inside the pod\/container<\/figcaption><\/figure><\/p>\n<hr>\n<p>We hope our blog is helpful for you in investigating your Kubernetes cluster.<\/p>\n<hr>\n<h4>Hire technical testers from Qxf2<\/h4>\n<p>Hire Qxf2&#8217;s technical testers for in-depth testing expertise that uncovers critical software issues, elevating your project&#8217;s quality and reliability. With diverse technical skills, we dive deep to deliver robust testing solutions. <a href=\"https:\/\/qxf2.com\/contact?utm_source=kubernetes_app_debug&#038;utm_medium=click&#038;utm_campaign=From%20blog\">Contact us<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a tester, we work with applications deployed on Kubernetes. That means, we need to know how to interact with various components of Kubernetes. But most online tutorials start with stuff that applies mostly to developers and DevOps engineers like install, writing deploy scripts, etc. Those are not really useful to testers, at least not directly. So, in this blog, [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,150],"tags":[],"class_list":["post-20138","post","type-post","status-publish","format-standard","hentry","category-how-to","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/20138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/comments?post=20138"}],"version-history":[{"count":44,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/20138\/revisions"}],"predecessor-version":[{"id":20307,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/20138\/revisions\/20307"}],"wp:attachment":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/media?parent=20138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/categories?post=20138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/tags?post=20138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}