From 2f762a69a248d3f07a0fc56233121afd17598527 Mon Sep 17 00:00:00 2001 From: Ritikaa96 Date: Thu, 22 Feb 2024 14:56:45 +0530 Subject: [PATCH 1/3] Improving kubectl get output Adding namespace flag & examples Signed-off-by: Ritikaa96 Kubernetes-commit: 22186fafaf79d6eae8375b3d018e181a645a3d31 --- pkg/cmd/get/get.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/get/get.go b/pkg/cmd/get/get.go index 063fd3d94..6822ff5cb 100644 --- a/pkg/cmd/get/get.go +++ b/pkg/cmd/get/get.go @@ -92,7 +92,7 @@ var ( Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the desired resource type is namespaced you will only see results in your current - namespace unless you pass --all-namespaces. + namespace unless you pass --all-namespaces or --namespace(for specific namespace) By specifying the output as 'template' and providing a Go template as the value of the --template flag, you can filter the attributes of the fetched resources.`)) @@ -132,7 +132,13 @@ var ( kubectl get rc/web service/frontend pods/web-pod-13je7 # List the 'status' subresource for a single pod - kubectl get pod web-pod-13je7 --subresource status`)) + kubectl get pod web-pod-13je7 --subresource status + + # List all deployments in namespace - backend + kubectl get deployments.apps --namespace backend + + # List all pods existing in all namespaces + kubectl get pods --all-namspaces`)) ) const ( From 6c2c4510481f7da74a33de228f6fd848744036dd Mon Sep 17 00:00:00 2001 From: Ritikaa96 Date: Mon, 26 Feb 2024 11:05:01 +0530 Subject: [PATCH 2/3] adding suggested changes Signed-off-by: Ritikaa96 Kubernetes-commit: 6f4e60a6b7ce56a5e083330f2b8c2277f4a659f0 --- pkg/cmd/get/get.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/get/get.go b/pkg/cmd/get/get.go index 6822ff5cb..0db7cb754 100644 --- a/pkg/cmd/get/get.go +++ b/pkg/cmd/get/get.go @@ -91,8 +91,8 @@ var ( Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the - desired resource type is namespaced you will only see results in your current - namespace unless you pass --all-namespaces or --namespace(for specific namespace) + desired resource type is namespaced you will only see results in other namespaces + by passing --namespace(for specific namespace) or --all-namespaces. By specifying the output as 'template' and providing a Go template as the value of the --template flag, you can filter the attributes of the fetched resources.`)) @@ -134,11 +134,11 @@ var ( # List the 'status' subresource for a single pod kubectl get pod web-pod-13je7 --subresource status - # List all deployments in namespace - backend + # List all deployments in namespace 'backend' kubectl get deployments.apps --namespace backend # List all pods existing in all namespaces - kubectl get pods --all-namspaces`)) + kubectl get pods --all-namespaces`)) ) const ( From 24a31a929b5eb6c8a42e65dde8b5a7fe5d348823 Mon Sep 17 00:00:00 2001 From: Ritikaa96 Date: Thu, 30 May 2024 11:53:02 +0530 Subject: [PATCH 3/3] correcting description as per review Signed-off-by: Ritikaa96 Kubernetes-commit: b9ec8b3c4643c36491ba94e48e6b957828c850cb --- pkg/cmd/get/get.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/get/get.go b/pkg/cmd/get/get.go index 0db7cb754..a1bc13cb1 100644 --- a/pkg/cmd/get/get.go +++ b/pkg/cmd/get/get.go @@ -91,8 +91,8 @@ var ( Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the - desired resource type is namespaced you will only see results in other namespaces - by passing --namespace(for specific namespace) or --all-namespaces. + desired resource type is namespaced you will only see results in the current + namespace if you don't specify any namespace. By specifying the output as 'template' and providing a Go template as the value of the --template flag, you can filter the attributes of the fetched resources.`))