1. ์ด์
Statefulset ์ผ๋ก ๊ตฌ์ฑ๋ Elasticsearch ํ๋๋ฅผ ์ ๋ฐ์ดํธํ๋ ค๊ณ ํ๋ ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค.
Error: UPGRADE FAILED: cannot patch โelasticsearch-masterโ with kind StatefulSet: StatefulSet.apps โelasticsearch-masterโ is invalid: spec: Forbidden: updates to statefulset spec for fields other than โreplicasโ, โtemplateโ, โupdateStrategyโ, โpersistentVolumeClaimRetentionPolicyโ and โminReadySecondsโ are forbidden
๋ด์ฉ์ธ ์ฆ โreplicasโ, โtemplateโ, โupdateStrategyโ, โpersistentVolumeClaimRetentionPolicyโ, โminReadySecondsโ ๊ฐ์ ์ ์ธํ ํ๋๋ update ๊ฐ ๋ถ๊ฐ๋ฅํ๋ค๋ ์๋ฏธ๋ค.
2. ํด๊ฒฐ
์์ ์ ์ํด์๋ Statefulset ์ ์ญ์ ํ๊ณ ๋ค์ ์์ฑํ๋ ๋ฐฉ๋ฒ์ด ์๋ค๊ณ ํ๋ค. ์ด๋ --cascade=orphan ์ต์
์ด ํต์ฌ์ด๋ค. StatefulSet ๋ฆฌ์์ค๋ง ์ญ์ ํ๊ณ ๊ทธ ์๋ ํ๋์ PVC๋ ๊ทธ๋๋ก ๋จ๊ฒจ๋๊ธฐ ๋๋ฌธ์, ์คํ ์ค์ธ ํ๋๋ฅผ ๊ฑด๋๋ฆฌ์ง ์๊ณ ๋ช
์ธ๋ง ๊ต์ฒดํ ์ ์๋ค.
## 3. ํ์ฌ ๊ตฌ์ฑ์ yaml ํ์ผ๋ก ์ ์ฅ
kubectl get statefulset some-statefulset -o yaml > statefulset.yaml
## 4. ํ์ผ ๋ด์ฉ ์์
vim statefulset.yaml
## 5. ํ๋๋ฅผ ์ ๊ฑฐํ์ง ์๊ณ Statefulset ์ญ์
kubectl delete statefulset some-statefulset --cascade=orphan
## 6. ๋ณ๊ฒฝ๋ StorageClass ๋ก Statefulset ๋ค์ ์์ฑ
kubectl apply -f statefulset.yaml