Difference between revisions of "Eksctl drain nodegroup"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
  #!/bin/bash
 
  #!/bin/bash
 
  K8S_VERSION=1.18.8-eks-7c9bda
 
  K8S_VERSION=1.18.8-eks-7c9bda
  nodes=$(kubectl get nodes -o jsonpath="{.items[? (@.status.nodeInfo.kubeletVersion==\"v$K8S_VERSION\")].metadata.name}")
+
  nodes=$(kubectl get nodes -o jsonpath="{.items[?(@.status.nodeInfo.kubeletVersion==\"v$K8S_VERSION\")].metadata.name}")
 
  for node in ${nodes[@]}
 
  for node in ${nodes[@]}
 
  do
 
  do
Line 12: Line 12:
 
     kubectl drain $node --ignore-daemonsets --delete-local-data
 
     kubectl drain $node --ignore-daemonsets --delete-local-data
 
  done
 
  done
 +
 +
 +
https://aws.amazon.com/premiumsupport/knowledge-center/eks-worker-node-actions/
 +
 +
 +
[[kubectl drain]]

Latest revision as of 00:25, 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


https://aws.amazon.com/premiumsupport/knowledge-center/eks-worker-node-actions/


kubectl drain

Advertising: