Difference between revisions of "Eksctl drain nodegroup"

From wikieduonline
Jump to navigation Jump to search
(Created page with " eksctl scale nodegroup")
 
Line 2: Line 2:
  
 
  [[eksctl scale nodegroup]]
 
  [[eksctl scale nodegroup]]
 +
 +
 +
#!/bin/bash
 +
K8S_VERSION=1.18.8-eks-7c9bda
 +
nodes=$(kubectl get nodes -o jsonpath="{.items[? (@.status.nodeInfo.kubeletVersion==\"v$K8S_VERSION\")].metadata.name}")
 +
for node in ${nodes[@]}
 +
do
 +
    echo "Draining $node"
 +
    kubectl drain $node --ignore-daemonsets --delete-local-data
 +
done

Revision as of 00:22, 23 May 2022


eksctl scale nodegroup


#!/bin/bash
K8S_VERSION=1.18.8-eks-7c9bda
nodes=$(kubectl get nodes -o jsonpath="{.items[? (@.status.nodeInfo.kubeletVersion==\"v$K8S_VERSION\")].metadata.name}")
for node in ${nodes[@]}
do
    echo "Draining $node"
    kubectl drain $node --ignore-daemonsets --delete-local-data
done

Advertising: