Hi @Rajesh Swarnkar ,
The Azure Python SDK, is used to manage the cluster. For fetching the pods' info you would need to use the Kubernetes package.
For example:
from kubernetes import client, config
config.load_kube_config()
v1 = client.CoreV1Api()
pods = v1.list_pod_for_all_namespaces().items
# Get the CPU and memory limits for each pod
for pod in pods:
print(f'Pod name: {pod.metadata.name}')
for container in pod.spec.containers:
print(f'\tContainer name: {container.name}')
if container.resources.limits:
if 'cpu' in container.resources.limits:
print(f'\tCPU limit: {container.resources.limits["cpu"]}')
else:
print("\tNo cpu resource limits defined")
if 'memory' in container.resources.limits:
print(f'\tMemory limit: {container.resources.limits["memory"]}')
else:
print("\tNo memory resource limits defined")
else:
print("\tNo resource limits defined")
I hope this helps.
Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.