Kubernetes/GCP GKE Aspects: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
No edit summary
Line 14: Line 14:
  kubectl get node -l cloud.google.com/gke-nodepool=$i
  kubectl get node -l cloud.google.com/gke-nodepool=$i
  done
  done
</pre>
cordon one node pool:
<pre>
for i in `kns get no -l cloud.google.com/gke-nodepool=production-gcp-env-blue -o name`
do
echo $i
#kubectl node cordon $i
done
</pre>
</pre>

Revision as of 14:28, 28 April 2020

Show nodes in each node pool:


gcloud container clusters list

export CLUSTERNAME=mycluster
export LOCATION=us-central1

for i in `gcloud container node-pools list --cluster ${CLUSTERNAME} --region ${LOCATION} | grep -v NAME | awk '{print $1}'`
 do
 echo $i ;
 kubectl get node -l cloud.google.com/gke-nodepool=$i
 done

cordon one node pool:

for i in `kns get no -l cloud.google.com/gke-nodepool=production-gcp-env-blue -o name`
do
 echo $i
 #kubectl node cordon $i
done