Write a Python script that retrieves the status of Kubernetes pods in a specified namespace.
Sigiloso
from kubernetes import client, config def get_pod_status(namespace): try: config.load_kube_config() # Loads kube config from default location v1 = client.CoreV1Api() pods = v1.list_namespaced_pod(namespace) for pod in pods.items: print(f"Pod Name: {pod.metadata.name}, Status: {pod.status.phase}") except Exception as e: print(f"Error retrieving pod status: {e}") if __name__ == "__main__": namespace = input("Enter the namespace: ") get_pod_status(namespace)