1 2 | $ kubectl --context hoge -n hoge logs hoge-0 --tail=10 ts=2023-07-13-xxxxxxxxx caller=main.go:1112 level=error err="opening storage failed: open /hoge/wal/xxxxx: no space left on device" |
1 2 3 4 5 6 7 8 9 | $ kubectl --context hoge -n hoge get statefulsets $ kubectl --context hoge -n hoge get pvc $ kubectl --context hoge -n hoge delete pvc hoge-0 $ kubectl --context hoge -n hoge get pvc $ kubectl --context hoge -n hoge delete pods hoge-0 $ kubectl --context hoge -n hoge get pods $ kubectl --context hoge -n hoge logs hoge-0 --tail=10 |
https://kubernetes.io/ja/docs/concepts/workloads/controllers/statefulset/
https://kubernetes.io/ja/docs/tasks/run-application/scale-stateful-set/
ちなみにstatefulsetsのレプリカを0にするとpodが作られるので注意。
1 2 3 4 5 | $ kubectl --context hoge -n hoge scale statefulsets hoge --replicas=0 statefulset.apps/hoge scaled $ kubectl --context hoge -n hoge describe statefulsets |grep create Normal SuccessfulCreate 97s statefulset-controller create Pod hoge-0 in StatefulSet hoge successful |
こうならないように retentionSize
を設定すればOK。
Was this helpful?
0 / 0
1989年生まれのSRE。ホスティングから大規模なアドテクなどのインフラエンジニアとして携わる。現在はサービスの信頼性向上、DevOps、可用性、レイテンシ、パフォーマンス、モニタリング、オブザーバビリティ、緊急対応、AWS/Azureでのインフラ構築、Docker開発環境の提供、Kubernetes保守、インフラコード化、新技術の検証、リファクタリング、セキュリティ強化などを担当している。個人開発では「夫婦、パートナー向け家事管理サービス/famii」をCakePHPで開発中。個人事業主では数社サーバー保守とベンチャー企業のインフラコンサルティングやMENTAで未経験者にインフラのコーチング/コミュニティの運用を実施している。また、「脆弱性スキャナVuls」のOSS活動もしており、自称エバンジェリスト/技術広報/テクニカルサポート/コントリビュータでもある。