LoginSignup
0
0

More than 3 years have passed since last update.

一定間隔で kubernetes Pods を更新する

Last updated at Posted at 2021-04-17

動機

Probesやlifecycleなど、Pod終了時の挙動を確認したかった。

方法

kubectl patch を使う場合

アプリケーションの振る舞いを変更する必要がないので、 date ラベルを更新して、 .spec.strategy の実行を期待する。最低待機時間は terminationGracePeriodSeconds + α で設定する。

$ while true; do date && kubectl patch deployment -n <namespace> <deployment_name> -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"; sleep 60;done

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0