1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
1
With an EKS cluster, you can gather information in the EKS level or in the Kubernetes level. In the EKS level, you can use eksctl
tool or the Boto EKS Client, but at this level, you can only look into cluster/nodegroup information. What you want is node information. So you have to query at Kubernetes level. You could use kubectl tool to create your query. For example:
# list all nodes in the cluster with their labels
kubectl get nodes --show-labels
# list all nodes in a specific nodegroup
kubectl get node --selector='eks.amazonaws.com/nodegroup=x86-br-spot-xl'
If you want to do this in Python, you could use Kubernetes Python Client.
from kubernetes import client, config
# Configs can be set in Configuration class directly or using helper utility
config.load_kube_config()
k8s_api = client.CoreV1Api()
logger.info("Getting k8s nodes...")
response = k8s_api.list_node()
You should look into Kubernetes documentation on how to get all the info you want with kubectl and then translate it later to Python.
répondu il y a 2 ans
Contenus pertinents
- Réponse acceptéedemandé il y a un an
- demandé il y a un an
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 7 mois
- AWS OFFICIELA mis à jour il y a 2 ans
This makes sense. I was hoping I would be able to query it from the AWS console as it is in there to view.
I'll deep dive into using kubectl and see what I can do.
Thanks!