rolling-upgrade.sh 534 B

12345678910111213141516
  1. #!/bin/bash
  2. export DEPLOY=r2
  3. export NEW_VERSION=neo4j:4.1.0-enterprise
  4. # Update Strategies: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
  5. STRATEGY=RollingUpdate
  6. # STRATEGY=OnDelete
  7. for set in core replica ; do
  8. kubectl patch statefulset $DEPLOY-neo4j-$set -p '{"spec":{"updateStrategy":{"type":"'$STRATEGY'"}}}'
  9. done
  10. kubectl patch statefulset $DEPLOY-neo4j-core --type='json' \
  11. -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"'$NEW_VERSION'"}]'
  12. []