Skip to content

index node rollout strategy? #1072

Answered by bryanlb
autata asked this question in Q&A
Discussion options

You must be logged in to vote

@autata for indexers we have a deploy script that will delete up to 10% of pods in parallel, and then wait two mins before continuing onto the next phase. This looks something like the following:

#!/bin/bash

pods="$(kubectl --context=$cluster get pods -l app=$app -o name | cut -d '/' -f 2)"
# delete 10% of the pods in parallel
let max_not_running=$replicas/10
for pod in $pods; do
  kubectl --context=$cluster delete pod $pod &
  sleep 5
  
  not_running_pods="$(kubectl --context=$cluster get pods -l app=$app | grep -v STATUS | grep -v Running | wc -l)"
  while [[ $not_running_pods -gt $max_not_running ]]; do
    echo "Pausing till $not_running_pods pods get back to Running state before de…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by bryanlb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants