helm ์ ๊ทธ๋ ์ด๋๋ฅผ ์คํํ๋ฉด ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ํ์๋ฉ๋๋ค. ( "my-service"๊ฐ "clusterIP : ์์"์์ "type : LoadBalancer"ํ๋ clusterIP์์ด ๋ณ๊ฒฝ๋จ)
Error: UPGRADE FAILED: Service "my-service" is invalid: spec.clusterIP: Invalid value: "": field is immutable
๊ทธ๋ฌ๋ "my-service"์ ํ์ด ์ ์ ํ "LoadBalancer"๋ก ๋ณ๊ฒฝ๋์ง ์๋๋ค๋ ์ ์ ์ ์ธํ๊ณ ๋ ์ ๋ฒ์ ์ด์๋ ๋ค๋ฅธ ๋ชจ๋ ํฌ๋๋ ๊ณ์ ๋ค์ ์์๋ฉ๋๋ค.
Helm์ด ์ผ๋ถ ํน์ ํ๋์ ๋ณ๊ฒฝ์ ์ง์ํ์ง ์๊ธฐ ๋๋ฌธ์ ์ ๊ทธ๋ ์ด๋๊ฐ ์คํจํ ์ด์ ๋ฅผ ์ดํดํฉ๋๋ค. ๊ทธ๋ฌ๋ helm์ด ๋ค์ ์์ํ์ฌ ๋ค๋ฅธ ์๋น์ค / pod๋ฅผ ์ ๊ทธ๋ ์ด๋ํ๋ ์ด์ ๋ ๋ฌด์์ ๋๊น? helm์ ์ ๊ทธ๋ ์ด๋ ์ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด ์๋ฌด ์์ ๋ ์ํํ์ง ์์์ผํฉ๋๊น? ๋๋ ์ ์ฒด ์๋น์ค ์ธํธ๋ฅผ ๋ชจ๋ ์ ๊ทธ๋ ์ด๋ํ๊ฑฐ๋ ์ ํ ์ ๊ทธ๋ ์ด๋ํ์ง ์๋ ํจํค์ง๋ก ์ทจ๊ธํ๋ helm์ ์ ์ธํ์ง๋ง ๋ด ๊ธฐ๋๊ฐ ์๋ชป๋ ๊ฒ ๊ฐ์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ ์ฐ๋ฆฌ๊ฐ ๊ทธ๋ฐ ์ํฉ์ ์ฒํ๊ฒ๋๋ค๋ฉด ๊ทธ ์ํฉ์์ ๋ฒ์ด๋๋ ค๋ฉด ๋ฌด์์ํด์ผํ ๊น์? "my-service"๋ฅผ ์๋ก์ด ์ ํ์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ๋ ๋ฐฉ๋ฒ์ ์ข์ํ์ญ๋๊น?
๊ทธ๋ฆฌ๊ณ --dry-run ์ต์ ์ ์ฌ์ฉํ๋ฉด helm์ ์ค๋ฅ๊ฐ ํ์๋์ง ์์ต๋๋ค.
์ด๋ ๋ฒ๊ทธ ๋๋ ์์ ๋ ๊ฒ์ผ๋ก ๊ฐ์ฃผ๋ฉ๋๊น? ์ฆ, ์ ๊ทธ๋ ์ด๋์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง๋ง ์ผ๋ถ ์๋น์ค๋ ์ฌ์ ํ ์ ๊ทธ๋ ์ด๋๋ฉ๋๋ค.
helm version
:
Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
kubectl version
์ถ๋ ฅ :
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.10-gke.27", GitCommit:"145f9e21a4515947d6fb10819e5a336aff1b6959", GitTreeState:"clean", BuildDate:"2020-02-21T18:01:40Z", GoVersion:"go1.12.12b4", Compiler:"gc", Platform:"linux/amd64"}
ํด๋ผ์ฐ๋ ์ ๊ณต ์
์ฒด / ํ๋ซํผ (AKS, GKE, Minikube ๋ฑ) :
GKE ๋ฐ Minkube
์ฌ์์ฐํ๊ธฐ์ ์ถฉ๋ถํ ์ ๋ณด๊ฐ ์ ๊ณต๋์ง ์์์ต๋๋ค. ์ฌํ ๊ฐ๋ฅํ ์ฐจํธ๋ฅผ ๋ง๋๋ ๋ฐฉ๋ฒ๊ณผ ์ฌ์ฉํ Helm ๋ช ๋ น์ ์๋ ค์ฃผ์ธ์.
์๋
ํ์ธ์, ์ฌํ ๋จ๊ณ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
์๋์ ๊ฐ์ด ๋ ๊ฐ์ ์๋น์ค yaml ํ์ผ์ด ์์ต๋๋ค.
nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
prometheus.yaml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: prometheus
spec:
template:
metadata:
labels:
app: prometheus
spec:
containers:
- image: prom/prometheus
name: prometheus
ports:
- containerPort: 9090
imagePullPolicy: Always
hostname: prometheus
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: prometheus
spec:
selector:
app: prometheus
clusterIP: None
ports:
- name: headless
port: 9090
targetPort: 0
๊ทธ๋ฐ ๋ค์ helm1 / templates /์ ๋ ๊ฐ์ ํ์ผ์ ๋ฃ๊ณ ์ค์นํฉ๋๋ค. prometheus ์๋น์ค๊ฐ clusterIP๋ฅผ ์ฌ์ฉํ๊ณ nginx ๋ฒ์ ์ด 1.14.2์์ ๋ณด์ฌ์ค๋๋ค.
# helm upgrade --install test helm1
Release "test" does not exist. Installing it now.
NAME: test
LAST DEPLOYED: Tue Apr 21 20:42:55 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 35d
prometheus ClusterIP None <none> 9090/TCP 7s
# kubectl describe deployment nginx |grep Image
Image: nginx:1.14.2
์ด์ nginx.yaml ์น์ ์ ์ ๋ฒ์ 1.16์ผ๋ก ์ ๋ฐ์ดํธํ์ญ์์ค.
image: nginx:1.16
๊ทธ๋ฆฌ๊ณ prometheus.yaml์ LoadBalancer๋ก ๋ณ๊ฒฝํฉ๋๋ค.
spec:
selector:
app: prometheus
ports:
- name: "9090"
port: 9090
protocol: TCP
targetPort: 9090
type: LoadBalancer
์ด์ helm2๋ก ์ค์ ํ๊ณ ์ ๊ทธ๋ ์ด๋๋ฅผ ์ํํ์ญ์์ค. ๊ทธ๋ฐ ๋ค์ ์ ๊ทธ๋ ์ด๋์์ ์ฝ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง๋ง nginx ์๋น์ค๋ ์ ๋ฒ์ ์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ์ฌ ์งํ๋์ง๋ง prometheus๋ ์ฌ์ ํ ํด๋ฌ์คํฐ IP๋ฅผ ์ฌ์ฉํ๊ณ ์์ผ๋ฏ๋ก ์ ๊ทธ๋ ์ด๋๋์ง ์์ต๋๋ค.
# helm upgrade --install test helm2
Error: UPGRADE FAILED: cannot patch "prometheus" with kind Service: Service "prometheus" is invalid: spec.clusterIP: Invalid value: "": field is immutable
# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 35d
prometheus ClusterIP None <none> 9090/TCP 5m34s
# kubectl describe deployment nginx |grep Image
Image: nginx:1.16
์กฐํ ๋ชฉ๋ก ์ผ
# helm list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
test default 2 2020-04-21 20:48:20.133644429 -0700 PDT failed
ํค ์ญ์ฌ
# helm history test
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
1 Tue Apr 21 20:42:55 2020 deployed helm-helm 1.0.0.6 Install complete
2 Tue Apr 21 20:48:20 2020 failed helm-helm 1.0.0.6 Upgrade "test" failed: cannot patch "prometheus" with kind Service: Service "prometheus" is invalid: spec.clusterIP: Invalid value: "": field is immutable
v3.2.0์์๋ ๋์ผํ ๋์์ด ๋ฐ์ํฉ๋๋ค. v3.1.3์ผ๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํ๋ ๊ฒ์ด ์์ ์์ ์ ๋๋ค.
Helm 2-> 3 ๋ง์ด๊ทธ๋ ์ด์ ์ผ๋ก ๋ง์ ๊ฒ์ ์ป์์ต๋๋ค. ๋ณํ ๋ ๋ฆด๋ฆฌ์ค๋ฅผ ์ฒ์์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ๋ ค๊ณ ํ ๋ ๋ง์ ๊ฒ์ ์ป์ต๋๋ค. ์ด๊ฒ์ ์ง๊ธ๊น์ง Nginx Ingress, Prometheus Operator, Graylog ๋ฐ Jaeger ์ฐจํธ๋ฅผ์ํ ๊ฒ์ ๋๋ค. ๋๋ถ๋ถ์ ์๋น์ค๋ฅผ ์ญ์ ํ๊ณ Helm์ด ๋ค์ ์์ฑํ๋๋กํ๋ ๋ฐ ๋ง์กฑํ์ง๋ง Nginx Ingress์ ๊ฒฝ์ฐ ์ด๊ฒ์ ์ต์ ์ด ์๋๋๋ค ...
๋ฐฉ๊ธ ๋ด ๊ฒฝ์ฐ์ ๋ฌธ์ ๋ฅผ ์ค๋ช ํ๋ https://github.com/helm/helm/issues/6378#issuecomment -557746499๋ฅผ ์ฐพ์์ต๋๋ค.
# 6378์ ๋ณต์ ๋ณธ์ผ๋ก ๋ซ์ต๋๋ค. @cablespaghetti ๋์ด ๋์์ ๋ํ ๋ ๊น์ ์ค๋ช ์ ์ฐพ์์ต๋๋ค.
๊ทธ๊ฒ์ด ๋น์ ์๊ฒ ํจ๊ณผ๊ฐ ์๋ค๋ฉด ์ ํฌ์๊ฒ ์๋ ค์ฃผ์ญ์์ค.
@GaramNick ์ ๋ค์ด ๊ทธ๋ ์ด๋๊ฐ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํฉ๋๊น? ๋ค์ด ๊ทธ๋ ์ด๋๋ก ํด๊ฒฐ ๋ "๋ฌด์"์ ๋ํด ์์ธํ ์ค๋ช ํด ์ฃผ์๊ฒ ์ต๋๊น?
@bacongobbler ๋น์ ์ด ์ฌ๊ธฐ์๋ ๋์. ๋ฆด๋ฆฌ์ค๋ฅผ ์ญ์ ํ๊ณ ๋ค์ ๋ฐฐํฌํ์ง ์๊ณ ์ด ์ํฉ์ ํด๊ฒฐํ ์์๋ ๋ฐฉ๋ฒ์ด ์์ต๋๊น? Helm์ clusterIP๊ฐ ํญ์ ์๋ต๋์ด ์์ผ๋ฏ๋ก ํจ์น๊ฐ ํ์ํ์ง ์๋ค๊ณ ์๊ฐํ๋๋ก ๊ธฐ์กด ๋ฆด๋ฆฌ์ค ๋ฐ์ดํฐ๋ฅผ ํดํนํ๊ณ ์ถ์ต๋๋ค.
kubectl edit
์ฌ์ฉํด ๋ณด์
จ์ต๋๊น?
๋์ผํ ๋ฌธ์ ๊ฐ ์์ผ๋ฉฐ 3.1.3
๋ค์ด ๊ทธ๋ ์ด๋ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค. ๋ด ์๊ฐ ์ ๊ทธ๊ฒ์ ์๋ก์ด ๋ก์ง๊ณผ ๊ด๋ จ์ด ์๋ค๋ ๊ฒ์
๋๋ค https://github.com/helm/helm/pull/7649/commits/d829343c1514db17bee7a90624d06cdfbffde963 ์ด ๊ณ ๋ ค Create
์๋ ์
๋ฐ์ดํธ๋ ๋ฐ๋ผ์ ๋น ์ค์ ํ๋ ค๊ณ IP ๋ฐ ์ฑ์์ง ๊ฒ์ ์ฌ์ฌ์ฉํ์ง ์์
ํฅ๋ฏธ๋ก์ด ๋ฐ๊ฒฌ. ์กฐ์ฌํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.
@jlegrone ํน์ ์ด๊ฑธ ์กฐ์ฌ ํ ์๊ฐ์ด ์์ผ์ ๊ฐ์?
@bacongobbler CI / CD ํ์ดํ ๋ผ์ธ์ Helm์ ์ฌ์ฉํ์ฌ ClusterIP ์ ํ์ ์๋น์ค๋ฅผ ํฌํจํ๋ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ ๋ฐ์ดํธํฉ๋๋ค. ๋ช ๋ น :
helm upgrade --install --force \
--wait \
--set image.repository="$CI_REGISTRY_IMAGE" \
--set image.tag="$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA" \
--set image.pullPolicy=IfNotPresent \
--namespace="$KUBE_NAMESPACE" \
"$APP_NAME" \
./path/to/charts/
v3.2.0์์์ด ๋ช
๋ น์ Service "service-name" is invalid: spec.clusterIP: Invalid value: "": field is immutable
์ ํจ๊ป ์คํจํฉ๋๋ค.
v3.1.3์์๋ ์ ๋๋ก ์๋ํฉ๋๋ค.
๋ ๋ง์ ์ ๋ณด๋ฅผ ์ํ์๋ฉด ์๋ ค์ฃผ์ธ์.
์ฌ๊ธฐ๋ ๋ง์ฐฌ๊ฐ์ง์
๋๋ค. ์ฐ๋ฆฌ๋ ์๊ฐ์ ๋์ helm2์ ํจ๊ป ๋ค์ service.yaml์ด ์ ์๋ํ์ต๋๋ค.
๋ง์ด๊ทธ๋ ์ด์
ํ helm 3.2 helm upgrade
๋ช
๋ น์ด ์์ ๊ฐ์ ์ ์ฅ ์ค๋ฅ์ ํจ๊ป ์คํจํ์ต๋๋ค. 3.1.3์ผ๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.global.name }}
namespace: {{ index .Values.global.namespace .Values.global.env }}
labels:
microservice: {{ .Values.global.name }}
spec:
type: ClusterIP
ports:
- port: 8080
selector:
microservice: {{ .Values.global.name }}
์ฐ๋ฆฌ๋ ๋์ผํ ๋ฌธ์ ๊ฐ ์์ผ๋ฉฐ 3.1.3์ผ๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํ๋ฉด ์ฐ๋ฆฌ์๊ฒ๋ ํด๊ฒฐ๋์์ต๋๋ค. ๋ด ์๊ฐ ์ d829343์ ์๋ก์ด ๋ ผ๋ฆฌ์ ๊ด๋ จ์ด ์๋ค๋ ๊ฒ์ ๋๋ค.์ด๋ฅผ ์ ๋ฐ์ดํธ๊ฐ ์๋ Create๋ก ๊ฐ์ฃผํ์ฌ ๋น IP๋ฅผ ์ค์ ํ๊ณ ์ฑ์์ง IP๋ฅผ ์ฌ์ฌ์ฉํ์ง ์์ผ๋ ค ๊ณ ํฉ๋๋ค.
@ n1koo ์ด๊ฒ์ด ๋ฌธ์ ๋ฅผ ์ผ์ผํค๋ ์ฝ๋๋ผ๊ณ ์๊ฐํ๋ ์ด์ ๋ฅผ ์ค๋ช
ํด ์ฃผ์๊ฒ ์ต๋๊น? ์ด๊ฒ์ ์ค์น์ด๊ณ ์
๊ทธ๋ ์ด๋ ์ฝ๋๊ฐ ์๋๊ธฐ ๋๋ฌธ์ 3.1 ์ create
์ด๊ณ ์๋ํฉ๋๋ค.
@adamreese ๋ฌธ์ ๋ฅผ ๊ฒํ @ n1koo๊ฐ ์๋ณ ํ ํจ์น๋ผ๊ณ
์ฐ๋ฆฌ๋ ์ฌ์ ํ ์ด๊ฒ์ ์กฐ์ฌํ๊ณ ์์ผ๋ฉฐ ๋ ๋ง์ ๊ฒ์ ๋ฐฐ์ฐ๋ฉด ์ ๋ฐ์ดํธ ํ ๊ฒ์ ๋๋ค.
๋ฐ๋ผ์ https://github.com/helm/helm/issues/6378#issuecomment -557746499๊ฐ ์ ํํฉ๋๋ค. ์ด ๋ฌธ์ ๋ฅผ ๊ณ์ํ๊ธฐ ์ ์ ์ฝ์ด๋ณด์ญ์์ค. clusterIP: ""
๊ฐ ์ค์ ๋ ๊ฒฝ์ฐ Kubernetes๋ IP๋ฅผ ํ ๋นํฉ๋๋ค. ๋ค์ Helm ์
๊ทธ๋ ์ด๋์์ clusterIP:""
๋ค์ ๋ํ๋๋ฉด ์์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. _Kubernetes์ _ IP๋ฅผ ์ฌ์ค์ ํ๋ ค๋ ๊ฒ์ผ๋ก ๋ํ๋๊ธฐ ๋๋ฌธ์
๋๋ค. (์, Kubernetes๋ ์๋น์ค์ spec:
์น์
์ ์์ ํฉ๋๋ค!)
Create
๋ฉ์๋๊ฐ 3-way diff๋ฅผ ์ฐํํ๋ฉด Kubernetes๊ฐ ํ ๋น ํ IP ์ฃผ์๋ก ์ค์ ํ๋ ๋์ clusterIP: ""
๋ฅผ ์ค์ ํฉ๋๋ค.
์ฌํํ๋ ค๋ฉด :
$ helm create issue7956
$ # edit issue7956/templates/service.yaml and add `clusterIP: ""` under `spec:`
$ helm upgrade --install issue7956 issue7956
...
$ helm upgrade issue7956 issue7956
Error: UPGRADE FAILED: cannot patch "issue-issue7956" with kind Service: Service "issue-issue7956" is invalid: spec.clusterIP: Invalid value: "": field is immutable
๋ ๋ฒ์งธ๋ก ์ ๊ทธ๋ ์ด๋๋ฅผ ์คํํ๋ฉด ์คํจํฉ๋๋ค.
master
์์ @IdanAdar ์ ๊ฒฝ์ฐ๋ฅผ ์ฌํ ํ ์ ์์ต๋๋ค.
@GaramNick ์ ๊ทํ์ ์ค๋ฅ๋ฅผ ์ฌํํ๊ธฐ ์ํด ๊ทํ๊ฐ ์ฌ์ฉํ๋ ์๋น์ค์ ๋ํ ์ ๋ณด๊ฐ ์ถฉ๋ถํ์ง ์์ต๋๋ค.
๋ด ์ํฉ :
version.BuildInfo{Version:"v3.2.0", GitCommit:"e11b7ce3b12db2941e90399e874513fbd24bcb71", GitTreeState:"clean", GoVersion:"go1.13.10"}
๋ํ
version.BuildInfo{Version:"v3.2.1", GitCommit:"fe51cd1e31e6a202cba7dead9552a6d418ded79a", GitTreeState:"clean", GoVersion:"go1.13.10"}
๋ค์ ์๋น์ค ํ ํ๋ฆฟ์ด ์ ๊ณต๋ฉ๋๋ค.
apiVersion: v1
kind: Service
metadata:
name: {{ include "app.fullname" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v1
kind: Mapping
name: {{ include "app.fullname" . }}_mapping
prefix: /{{ include "app.fullname" . }}
host: "^{{ include "app.fullname" . }}.*"
host_regex: true
service: {{ include "app.fullname" . }}.{{ .Release.Namespace }}
rewrite: ""
timeout_ms: 60000
bypass_auth: true
cors:
origins: "*"
methods: POST, GET, OPTIONS
headers:
- Content-Type
- Authorization
- x-client-id
- x-client-secret
- x-client-trace-id
- x-flow-proto
---
apiVersion: ambassador/v1
kind: Mapping
name: {{ include "app.fullname" . }}_swagger_mapping
ambassador_id: corp
prefix: /swagger
host: "^{{ include "app.fullname" . }}.corp.*"
host_regex: true
service: {{ include "app.fullname" . }}.{{ .Release.Namespace }}
rewrite: ""
bypass_auth: true
cors:
origins: "*"
methods: POST, GET, OPTIONS
headers:
- Content-Type
- x-client-id
- x-client-secret
- Authorization
- x-flow-proto
namespace: {{ .Release.Namespace }}
spec:
type: {{ .Values.service.type }}
selector:
{{- include "app.selectorLabels" . | nindent 4 }}
ports:
- port: {{ .Values.service.port }}
name: http-rest-hub
targetPort: http-rest
- port: {{ .Values.service.healthPort }}
name: http-health
targetPort : http-health
upgrade --install
๋ค์ ๋ค์๊ณผ ๊ฐ์ ๊ฒฐ๊ณผ๊ฐ ๋ํ๋ฉ๋๋ค.
apiVersion: v1
kind: Service
metadata:
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v1
kind: Mapping
name: hub-alt-bor_mapping
prefix: /hub-alt-bor
host: "^hub-alt-bor.*"
host_regex: true
service: hub-alt-bor.brett
rewrite: ""
timeout_ms: 60000
bypass_auth: true
cors:
origins: "*"
methods: POST, GET, OPTIONS
headers:
- Content-Type
- Authorization
- x-client-id
- x-client-secret
- x-client-trace-id
- x-flow-proto
---
apiVersion: ambassador/v1
kind: Mapping
name: hub-alt-bor_swagger_mapping
ambassador_id: corp
prefix: /swagger
host: "^hub-alt-bor.corp.*"
host_regex: true
service: hub-alt-bor.brett
rewrite: ""
bypass_auth: true
cors:
origins: "*"
methods: POST, GET, OPTIONS
headers:
- Content-Type
- x-client-id
- x-client-secret
- Authorization
- x-flow-proto
meta.helm.sh/release-name: alt-bor
meta.helm.sh/release-namespace: brett
creationTimestamp: ...
labels:
app: hub
app.kubernetes.io/instance: alt-bor
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: hub
app.kubernetes.io/version: v1.6.0-rc.26
deploy.xevo.com/stackname: bor-v0.1-test
helm.sh/chart: hub-0.0.4
owner: gateway
ownerSlack: TODOunknown
name: hub-alt-bor
namespace: brett
resourceVersion: ...
selfLink: ...
uid: ...
spec:
clusterIP: 172.20.147.13
ports:
- name: http-rest-hub
port: 80
protocol: TCP
targetPort: http-rest
- name: http-health
port: 90
protocol: TCP
targetPort: http-health
selector:
app.kubernetes.io/instance: alt-bor
app.kubernetes.io/name: hub
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
๊ทธ๋ฐ ๋ค์ 0.0.5 ๋ฒ์ ๋ฐ upgrade --install
์ ๋๊ฐ์ ์ฐจํธ๋ฅผ ๋ค์ ์
๋ก๋ํ๋ฉด ๋ค์๊ณผ ๊ฐ์ ๊ฒฐ๊ณผ๊ฐ ๋ํ๋ฉ๋๋ค.
Error: UPGRADE FAILED: failed to replace object: Service "hub-alt-bor" is invalid: spec.clusterIP: Invalid value: "": field is immutable
์ ์ผํ ์ฐจ์ด์ ์ ์ด์ hub-0.0.5
์ ๊ฐ์ด์๋ helm.sh/chart
๋ ์ด๋ธ์ ๊ฐ์
๋๋ค.
์ด๊ฒ์ ๊ฑฐ๋ํ ์ฐจ๋จ์ ์ ๋๋ค.
@GaramNick ์ ๊ทํ์ ์ค๋ฅ๋ฅผ ์ฌํํ๊ธฐ ์ํด ๊ทํ๊ฐ ์ฌ์ฉํ๋ ์๋น์ค์ ๋ํ ์ ๋ณด๊ฐ ์ถฉ๋ถํ์ง ์์ต๋๋ค.
@technosophos ๋ฌด์์ด ํ์ํฉ๋๊น? ์์ธํ ์ ๋ณด๋ฅผ ์ ๊ณตํด ๋๋ฆฌ๊ฒ ์ต๋๋ค.
์ต์ ์ ๋ณด! helm upgrade --install
w / --force
์ฌ์ฉํ๋ ๊ฒฝ์ฐ์๋ง ์
๋ฐ์ดํธ๊ฐ ์คํจํฉ๋๋ค. ์ด์ ์ฐจ๋จ์ ๊ฐ ์ ์ต๋๋ค.
์ค! ๊ทธ๊ฒ ์ฐธ ํฅ๋ฏธ ๋กญ๋ค. ๊ทธ๋ฌ๋ฉด ์ค๋ฅ๋ฅผ ์ฝ๊ฒ ์ถ์ ํ ์ ์์ต๋๋ค.
์๋ ํ์ธ์ @technosophos @bacongobbler ์ฐ๋ฆฌ๋ ๋์ผํ ๋ ๊ฐ์ง ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
version.BuildInfo{Version:"v3.2.1", GitCommit:"fe51cd1e31e6a202cba7dead9552a6d418ded79a", GitTreeState:"clean", GoVersion:"go1.13.10"}
clusterIP
์์ด Service
ํ
ํ๋ฆฟ์ด ์์ง๋ง kubernetes๋ ์๋์ผ๋ก clusterIP
ํ ๋นํฉ๋๋ค.apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
labels:
app: {{ .Values.image.name }}
release: {{ .Release.Name }}
spec:
type: ClusterIP
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}
protocol: TCP
name: http
selector:
app: {{ .Values.image.name }}
release: {{ .Release.Name }}
helm 2to3 convert
๋ก helm 3์ผ๋ก ๋ง์ด๊ทธ๋ ์ด์
ํ ํ ๋์ผํ ๋ฆด๋ฆฌ์ค helm3 upgrade --install --force
์
๊ทธ๋ ์ด๋๋ฅผ ์๋ํ์ญ์์ค.
failed to replace object: Service "dummy-stage" is invalid: spec.clusterIP: Invalid value: "": field is immutable
--force
-> helm3 upgrade --install
์์ด ๋๊ฐ์ดํ๋ฉด ์ค๋ฅ์์ด ์ ์๋ํฉ๋๋ค.
--force
์์ด ๋ณ๊ฒฝ ๋ถ๊ฐ๋ฅํ ํ๋ ์ธ Deployment์์ spec.selector.matchLabels
๋ฅผ ๋ณ๊ฒฝํ๋ ค๋ฉด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.cannot patch "dummy-stage" with kind Deployment: Deployment.apps "dummy-stage" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/name":"web-nerf-dummy-app"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
--force
๋๊ฐ์ด ํ ๊ฒฝ์ฐ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
failed to replace object: Deployment.apps "dummy-stage" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/name":"web-nerf-dummy-app"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
๊ทธ๊ฒ์์์ํ ๋์ผํ ๋์ ๊ตฌํ ๊ฐ๋ฅ --force
๊ฐ์ด helm 2
์ฐ๋ฆฌ๊ฐ ์ด๋ค ์ค๋ฅ์์ด ๋ถ๋ณ ์
๊ทธ๋ ์ด๋ ํ ์ ์๊ธฐ ๋๋ฌธ์ ์ ์ฒญ์?
apiVersion: v1
kind: Service
metadata:
name: zipkin-proxy
namespace: monitoring
spec:
ports:
- port: 9411
targetPort: 9411
selector:
app: zipkin-proxy
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: zipkin-proxy
namespace: monitoring
spec:
replicas: {{ .Values.zipkinProxy.replicaCount }}
template:
metadata:
labels:
app: zipkin-proxy
annotations:
prometheus.io/scrape: 'true'
spec:
containers:
- image: {{ .Values.image.repository }}/zipkin-proxy
name: zipkin-proxy
env:
- name: STORAGE_TYPE
value: stackdriver
helm upgrade -i --debug --force --namespace monitoring zipkin-proxy --values ./values.yaml.tmp .
๊ฐ์ ์ต์ ์ ์ ๊ฑฐํ๋ ค๊ณ ์๋ํ์ต๋๋ค. v3.1.3, v3.2.0 ๋ฐ v3.2.1๋ก ์๋ํ์ง๋ง ์ฌ์ ํ ๋์ผํ ๋ฌธ์ ์ ๋๋ค.
์คํ ์ถ์
history.go:52: [debug] getting history for release zipkin-proxy
upgrade.go:84: [debug] preparing upgrade for zipkin-proxy
upgrade.go:92: [debug] performing update for zipkin-proxy
upgrade.go:234: [debug] creating upgraded release for zipkin-proxy
client.go:163: [debug] checking 2 resources for changes
client.go:195: [debug] error updating the resource "zipkin-proxy":
cannot patch "zipkin-proxy" with kind Service: Service "zipkin-proxy" is invalid: spec.clusterIP: Invalid value: "": field is immutable
client.go:403: [debug] Looks like there are no changes for Deployment "zipkin-proxy"
upgrade.go:293: [debug] warning: Upgrade "zipkin-proxy" failed: cannot patch "zipkin-proxy" with kind Service: Service "zipkin-proxy" is invalid: spec.clusterIP: Invalid value: "": field is immutable
Error: UPGRADE FAILED: cannot patch "zipkin-proxy" with kind Service: Service "zipkin-proxy" is invalid: spec.clusterIP: Invalid value: "": field is immutable
helm.go:75: [debug] cannot patch "zipkin-proxy" with kind Service: Service "zipkin-proxy" is invalid: spec.clusterIP: Invalid value: "": field is immutable
helm.sh/helm/v3/pkg/kube.(*Client).Update
/home/circleci/helm.sh/helm/pkg/kube/client.go:208
helm.sh/helm/v3/pkg/action.(*Upgrade).performUpgrade
/home/circleci/helm.sh/helm/pkg/action/upgrade.go:248
helm.sh/helm/v3/pkg/action.(*Upgrade).Run
/home/circleci/helm.sh/helm/pkg/action/upgrade.go:93
main.newUpgradeCmd.func1
/home/circleci/helm.sh/helm/cmd/helm/upgrade.go:137
github.com/spf13/cobra.(*Command).execute
/go/pkg/mod/github.com/spf13/[email protected]/command.go:826
github.com/spf13/cobra.(*Command).ExecuteC
/go/pkg/mod/github.com/spf13/[email protected]/command.go:914
github.com/spf13/cobra.(*Command).Execute
/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main
/home/circleci/helm.sh/helm/cmd/helm/helm.go:74
runtime.main
/usr/local/go/src/runtime/proc.go:203
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1357
UPGRADE FAILED
main.newUpgradeCmd.func1
/home/circleci/helm.sh/helm/cmd/helm/upgrade.go:139
github.com/spf13/cobra.(*Command).execute
/go/pkg/mod/github.com/spf13/[email protected]/command.go:826
github.com/spf13/cobra.(*Command).ExecuteC
/go/pkg/mod/github.com/spf13/[email protected]/command.go:914
github.com/spf13/cobra.(*Command).Execute
/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main
/home/circleci/helm.sh/helm/cmd/helm/helm.go:74
runtime.main
/usr/local/go/src/runtime/proc.go:203
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1357
Helm ์ฐจํธ ๋ฒ์ ์ด ๋ณ๊ฒฝ๋๊ณ ๊ธฐ์กด ๋ฐฐํฌ๊ฐ์๋ ๊ฒฝ์ฐ์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
Helm v3.2.0 ์ฌ์ฉ
3.1.2๋ก ๋ค์ด ๊ทธ๋ ์ด๋๊ฐ ์๋ ํจ์ ํ์ธํ ์ ์์ต๋๋ค.
@ gor181 ์ด๋ป๊ฒ ์ฌํ ํ ์ ์์ต๋๊น? 3.2์์ ๊นจ์ก์ง๋ง 3.1์์ ์๋ ํ ๊ฒ์ ๋ฌด์์ ๋๊น? ์ฐจํธ (๋๋ ์ต์ํ svc ํ ํ๋ฆฟ)์ ๋ช ๋ น์ ๋ณ๊ฒฝ๋ ๋ด์ฉ์ ํ์ ํ๋ ๋ฐ ํ์ํ ๊ฒ์ ๋๋ค.
@azarudeena @ alexandrsemak- ๋ ์ฌ๋ ๋ชจ๋์๊ฒ --force
ํ๋๊ทธ๊ฐ ์์ธ์
๋๋ค. --force
๋ฅผ ์ ๊ฑฐํ๋ฉด ์
๊ทธ๋ ์ด๋๊ฐ ์๋ํฉ๋๊น?
@technosophos ๋ ํ์์ด ์๋ํ์ง๋ง ์๋ํ์ง ์์์ต๋๋ค. 3.1.2๋ก ์๋ ํ ๊ณํ
@azarudeena ๋ฌธ์ ๋ฅผ ์ฌํํ๊ธฐ์ํ ์ง์นจ์ ์ ๊ณตํด ์ฃผ์๊ฒ ์ต๋๊น? ์๋น์ค ๋ฐ ๋ฐฐํฌ ํ
ํ๋ฆฟ์ ์ผ๋ถ ์ถ๋ ฅ์ ๋ณด์ฌ ์ฃผ์์ง๋ง ๊ฒฐ๊ณผ๋ฅผ ์์ง ๋ชปํ๋ values.yaml.tmp
๋ ์ฐธ์กฐํ๊ฑฐ๋ Chart.yaml๋ ์ฐธ์กฐํ์ต๋๋ค.
๋ฌธ์ ๋ฅผ ์ฌํํ๋ ๋ฐ ์ฌ์ฉํ ์์๋ ์ํ ์ฐจํธ๋ฅผ ์ ๊ณตํด ์ฃผ์๊ฒ ์ต๋๊น?
@bacongobbler ๊ตฌ์กฐ๋ฅผ ๊ณต์ ํ๊ณ ์์ต๋๋ค.
Chart.yaml
apiVersion: v1
description: Deploys Stackdriver Trace Zipkin Proxy
name: zipkin-proxy
version: 1.0.0
์์ ํ ํ๋ฆฟ yaml์ ๋ฃ์์ต๋๋ค.
๋ด ๊ฐ์น yaml.tmp๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
zipkinProxy:
replicaCount: 1
image:
repository: openzipkin/zipkin
๋๋ ๊ทธ๊ฒ์ helm ํจํค์ง --version์ผ๋ก ํจํค์งํฉ๋๋ค.
3.1.2 ๋ฐ 3.1.1๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํ์ฌ ์๋ํ์ต๋๋ค. ์ฌ์ ํ์ด ํจ์น๋ฅผ๋ฐ์ ์ ์์ต๋๋ค.
๋๋ ๊ฐ์ ๋ฌธ์ ์ ์ง๋ฉดํ์ง๋ง terraform helm ๊ณต๊ธ์๋ฅผ ํตํด helm ์ฐจํธ๋ฅผ ์
๊ทธ๋ ์ด๋ํ์ต๋๋ค.
force_update = true
์ force_update = false
๋ก ๋ณ๊ฒฝ ํ ํ ์ค๋ฅ๊ฐ ์ฌ๋ผ์ก์ต๋๋ค.
Helm ์ฐจํธ ๋ฒ์ ์ด ๋ณ๊ฒฝ๋๊ณ ๊ธฐ์กด ๋ฐฐํฌ๊ฐ์๋ ๊ฒฝ์ฐ์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
Helm v3.2.0 ์ฌ์ฉ
--force ํ๋๊ทธ๋ฅผ ๋นํ์ฑํํ๋ฉด ์๋ํ์ต๋๋ค.
@technosophos --force
helm 2๋ก ๋ง์ด๊ทธ๋ ์ด์
ํ ๋ ClusterIP ๋ฌธ์ ๋ฅผ ํด๊ฒฐํฉ๋๋ค Helm 3์ด ์ํ ํ ๋ ClusterIP๋ฅผ ์
๊ทธ๋ ์ด๋ํ์ง ๋ง์ญ์์ค.
Helm 3์์ matchLabels
๋ก ์ ์ถ ๋ ๋ณ๊ฒฝ ๋ถ๊ฐ๋ฅํ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์
Kubernetes๋ ์๋น์ค์
spec:
์น์ ์ ์์ ํฉ๋๋ค.
์ด๊ฒ์ด ์ฟ ๋ฒ๋ค ํฐ์ค์ ๊ทผ๋ณธ์ ์ธ ์ค๊ณ ๊ฒฐํจ์ผ๋ก ๊ฐ์ฃผ๋์ด์ผํฉ๋๊น? https://kubernetes.io/docs/concepts/services-networking/service/#choosing -your-own-ip-address๋์ด ๋์์ ๋ํด ์ธ๊ธํ์ง ์์ต๋๋ค. status
์น์
์ ํ ๋น ๋ ๊ฐ์ด ๋ฐฐ์น ๋ ๊ฒ์ผ๋ก ์์ํ์ ๊ฒ์
๋๋ค.
(A ๋น์ทํ ๋์์ ์กด์ฌ .spec.nodeName
(A)์ Pod
,ํ์ง๋ง ํฌ๊ตฌ ์ฌ์ฉ์์ ์ํฅ์ ๋ฏธ์น์ง ์์ ์ ์์ต๋๋ค.)
v3.2.3 : --force๋ก ์คํจํ๊ณ --force์์ด ํต๊ณผํฉ๋๋ค. ์ฐจํธ ํ
ํ๋ฆฟ์ ClusterIP:
์์ต๋๋ค. https://github.com/helm/helm/pull/8000/files ๊ฐ ์์ ํด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
upgrade.go:121: [debug] preparing upgrade for eos-eve-srv-d1
upgrade.go:129: [debug] performing update for eos-eve-srv-d1
upgrade.go:308: [debug] creating upgraded release for eos-eve-srv-d1
client.go:173: [debug] checking 6 resources for changes
client.go:432: [debug] Replaced "eos-eve-srv-d1-fsnode" with kind ServiceAccount for kind ServiceAccount
client.go:432: [debug] Replaced "eos-eve-srv-d1-fsnode-imagepullsecret" with kind Secret for kind Secret
client.go:432: [debug] Replaced "eos-eve-srv-d1-fsnode-config" with kind ConfigMap for kind ConfigMap
client.go:205: [debug] error updating the resource "eos-eve-srv-d1-fsnode":
failed to replace object: Service "eos-eve-srv-d1-fsnode" is invalid: spec.clusterIP: Invalid value: "": field is immutable
client.go:432: [debug] Replaced "eos-eve-srv-d1-fsnode" with kind Deployment for kind Deployment
client.go:432: [debug] Replaced "eos-eve-srv-d1-fsnode" with kind Ingress for kind Ingress
upgrade.go:367: [debug] warning: Upgrade "eos-eve-srv-d1" failed: failed to replace object: Service "eos-eve-srv-d1-fsnode" is invalid: spec.clusterIP: Invalid value: "": field is immutable
Error: UPGRADE FAILED: failed to replace object: Service "eos-eve-srv-d1-fsnode" is invalid: spec.clusterIP: Invalid value: "": field is immutable
helm.go:84: [debug] failed to replace object: Service "eos-eve-srv-d1-fsnode" is invalid: spec.clusterIP: Invalid value: "": field is immutable
helm.sh/helm/v3/pkg/kube.(*Client).Update
/private/tmp/helm-20200608-50972-gq0j1j/src/helm.sh/helm/pkg/kube/client.go:218
helm.sh/helm/v3/pkg/action.(*Upgrade).performUpgrade
/private/tmp/helm-20200608-50972-gq0j1j/src/helm.sh/helm/pkg/action/upgrade.go:322
helm.sh/helm/v3/pkg/action.(*Upgrade).Run
/private/tmp/helm-20200608-50972-gq0j1j/src/helm.sh/helm/pkg/action/upgrade.go:130
main.newUpgradeCmd.func1
/private/tmp/helm-20200608-50972-gq0j1j/src/helm.sh/helm/cmd/helm/upgrade.go:144
github.com/spf13/cobra.(*Command).execute
/private/tmp/helm-20200608-50972-gq0j1j/pkg/mod/github.com/spf13/[email protected]/command.go:842
github.com/spf13/cobra.(*Command).ExecuteC
/private/tmp/helm-20200608-50972-gq0j1j/pkg/mod/github.com/spf13/[email protected]/command.go:950
github.com/spf13/cobra.(*Command).Execute
/private/tmp/helm-20200608-50972-gq0j1j/pkg/mod/github.com/spf13/[email protected]/command.go:887
main.main
/private/tmp/helm-20200608-50972-gq0j1j/src/helm.sh/helm/cmd/helm/helm.go:83
runtime.main
/usr/local/Cellar/[email protected]/1.13.12/libexec/src/runtime/proc.go:203
runtime.goexit
/usr/local/Cellar/[email protected]/1.13.12/libexec/src/runtime/asm_amd64.s:1357
UPGRADE FAILED
main.newUpgradeCmd.func1
/private/tmp/helm-20200608-50972-gq0j1j/src/helm.sh/helm/cmd/helm/upgrade.go:146
github.com/spf13/cobra.(*Command).execute
/private/tmp/helm-20200608-50972-gq0j1j/pkg/mod/github.com/spf13/[email protected]/command.go:842
github.com/spf13/cobra.(*Command).ExecuteC
/private/tmp/helm-20200608-50972-gq0j1j/pkg/mod/github.com/spf13/[email protected]/command.go:950
github.com/spf13/cobra.(*Command).Execute
/private/tmp/helm-20200608-50972-gq0j1j/pkg/mod/github.com/spf13/[email protected]/command.go:887
main.main
/private/tmp/helm-20200608-50972-gq0j1j/src/helm.sh/helm/cmd/helm/helm.go:83
runtime.main
/usr/local/Cellar/[email protected]/1.13.12/libexec/src/runtime/proc.go:203
runtime.goexit
/usr/local/Cellar/[email protected]/1.13.12/libexec/src/runtime/asm_amd64.s:1357
์ด ๋ฌธ์ ๋ 3.2.3
์์ ๊ด์ฐฐ๋์ง๋ง 3.2.0
๊ด์ฐฐ๋์ง ์์ต๋๋ค. ๊ฐ์ ๋ก ๋นํ์ฑํํ๋ ๊ฒ๋ ์ ์ฉํ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด์์ต๋๋ค.
์ฐธ๊ณ ๋ก OP๊ฐ ์ ๊ธฐ ํ ๋ฌธ์ ์ --force
์ ๋ํด ์ฌ๊ธฐ์์ ์ ๊ธฐ ๋ ์๊ฒฌ์ ๋ณ๊ฐ์ ๊ฐ๋ณ ๋ฌธ์ ์
๋๋ค. ์ฌ๊ธฐ์์ OP์ ๋ฌธ์ ์ ์ง์ค ํด ๋ณด๊ฒ ์ต๋๋ค.
๋ช ํํํ๊ธฐ ์ํด OP๊ฐ ์ค๋ช ํ๋ ๋ฌธ์ ๋ https://github.com/helm/helm/issues/7956#issuecomment -620749552์์ ํ์ธ ๋ ์ ์ฌ์ ํ๊ท @ n1koo์ ๋๋ค. ํฉ๋ฒ์ ์ธ ๋ฒ๊ทธ ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
--force
์ ๊ฑฐ์ ๋ํด ์ธ๊ธ ํ ๋ค๋ฅธ ์๊ฒฌ์ Kubernetes์ ๊ด์ ์์ ์๋์ ์ด๊ณ ์์ ๋ ๋์์
๋๋ค. --force
๋ฅผ ์ฌ์ฉํ๋ฉด Helm์ Kubernetes์ ๋ํ PUT ์์ฒญ์ ์์ฒญํฉ๋๋ค. ์ค์ ๋ก๋ Kubernetes์๊ฒ ๋์ ๋งค๋ํ์คํธ ( helm upgrade
์์ ์ฐจํธ์ ๋ ๋๋ง ๋ ํ
ํ๋ฆฟ)๋ฅผ ์ง์ค์ ์์ค๋ก ์ฌ์ฉํ๊ณ ๋ ๋๋ง ๋ ๋งค๋ํ์คํธ๋ก ํด๋ฌ์คํฐ์ ๋ฆฌ์์ค๋ฅผ ๋ฎ์ด ์ฐ๋๋ก ์์ฒญํฉ๋๋ค. kubectl apply --overwrite
๋์ผํฉ๋๋ค.
๋๋ถ๋ถ์ ๊ฒฝ์ฐ ํ
ํ๋ฆฟ์ ํด๋ฌ์คํฐ IP๋ฅผ ์ง์ ํ์ง ์์ต๋๋ค. ์ฆ, helm upgrade --force
์์ ์๋น์ค์ ํด๋ฌ์คํฐ IP๋ฅผ ์ ๊ฑฐ (๋๋ ๋ณ๊ฒฝ)ํ๋๋ก ์์ฒญํฉ๋๋ค. ์ด๊ฒ์ Kubernetes์ ๊ด์ ์์ ๋ณผ ๋ ๋ถ๋ฒ์ ์ธ ์์
์
๋๋ค.
์ด๊ฒ์ # 7082์๋ ๋ฌธ์ํ๋์ด ์์ต๋๋ค.
์ด๊ฒ์ด --force
์ ๊ฑฐ๊ฐ ์๋ํ๋ ์ด์ ์ด๊ธฐ๋ํฉ๋๋ค. Helm์ ๋ผ์ด๋ธ ์ํ์ ๋น๊ตํ์ฌ ํด๋ฌ์คํฐ IP๋ฅผ ํจ์น ๋ ๋งค๋ํ์คํธ๋ก ๋ณํฉํ์ฌ ์
๊ทธ๋ ์ด๋ ๋์ ํด๋ฌ์คํฐ IP๋ฅผ ๋ณด์กดํ๋ PATCH ์์
์ ์ํํฉ๋๋ค.
Helm 2์์ ์ํ ํ ๊ฒ์ฒ๋ผ ๊ฐ์ฒด๋ฅผ ๊ฐ์ ๋ก ์ ๊ฑฐํ๊ณ ๋ค์ ๋ง๋ค๊ณ ์ถ๋ค๋ฉด # 7431์ ์ดํด๋ณด์ธ์.
์ด๊ฒ์ด ์ํฉ์ ๋ช ํํํ๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
์์ผ๋ก ์ฌ๊ธฐ์ OP ๋ฌธ์ ์ ์ง์ค ํด ๋ณด๊ฒ ์ต๋๋ค.
์๋ ค์ง ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์์ต๋๊น? https://github.com/helm/charts/tree/master/stable/rabbitmq-ha ๋ฅผ 1.34.1์์ 1.46.4๋ก ์
๊ทธ๋ ์ด๋ํ๋ ค๊ณ ํ ๋ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. ๋ถ๋ช
ํ --force
๋๋ 3.1.3
๋ก์ helm ๋ค์ด ๊ทธ๋ ์ด๋๋ ๋์์ด๋์ง ์์์ต๋๋ค. ๋ฌธ์ ์ ์๋น์ค๋ฅผ ์ญ์ ํ๊ณ helm upgrade
๊ฐ ๋์์ด๋์์ต๋๋ค.
@EvgeniGordeev ์ด๊ฒ์ ์์ ๋ค์ด ํ์์ผ๋ก ๋๋ฅผ ์ํด ์ผํ ์กฐ์กํ ์๋ฃจ์ ์ด ๋ ๊ฒ์ ๋๋ค. ์ฐจํธ๋ฅผ ์ ๊ฑฐ / ๋ค์ ์ค์นํฉ๋๋ค.
nginxinc ์ธ ๊ทธ๋ ์ค ์ฐจํธ์์๋์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค. ์ผ๋ฐ์ ์ผ๋ก --force
ํฉ๋๋ค.
์ด ๋ฌธ์ ๊ฐ ์์ง ์ด๋ ค ์๊ธฐ ๋๋ฌธ์์ด๋ฅผ ํด๊ฒฐํ๊ธฐ์ํ ์ผ์ข
์ ์์ ๊ณํ์ด ์์ต๋๊น, ์๋๋ฉด ์ค๊ณ๋๋๋ก ์๋ํ๋ ๊ฒ์ผ๋ก ๊ฐ์ฃผ๋ฉ๋๊น (์ด + ๋์ผํ ๋์์ผ๋ก ์ด๋ฆฐ ๋ค๋ฅธ ๋ฌธ์ ์ ๊ตฌ๋ณํ๊ธฐ ์ด๋ ต์ต๋๋ค)? ๋๋ ์ด๊ฒ์ด ์ฐจํธ ์์ฒด์ clusterIP: ""
ํด์๋ ์๋๋ฉฐ ๋์ ๊ฐ์ ์์ ํ ์๋ตํด์ผํ๋ค๋ ์ค๋ช
์ ์ฝ์์ต๋๋ค.
์ด๊ฒ์ด ์ฐ๋ฆฌ๊ฐ ์ฐจํธ ๊ฐ๋ฐ์๋ค๊ณผ ํจ๊ป ์ซ์ ์ผ ํ ๊ฒ์ ๋๊น?
@cdunford - https: //github.com/helm/helm/issues/7956#issuecomment -643432099์ ์ ์ ๋๋๋ก --force
์ฌ์ฉ์ ์ค์งํ๋๋ก ์ ์ ๋ ์์ ์ฌํญ์
๋๋ค.
์ด PR์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์๋ ์์ต๋๋ค. # 7431 (ํด๋น ์๊ฒฌ์์ ์ ์๋จ) ...
์ด ๋ฌธ์ ๋ N ๋ฒ ๋ฐ์ํ์ผ๋ฉฐ ํ์ดํ ๋ผ์ธ์์๋ --force
ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
์๋ ๋ฌธ์ ๋ helm2์ ํจ๊ป ์ ๊ณต๋์์ผ๋ฏ๋ก helm2์์๋ ์์ ๋ฉ๋๊น? ๋ฟก ๋นต๋จ
@bacongobbler ์ ๊ฑฐํ๊ฑฐ๋ ๋ค์ด ๊ทธ๋ ์ด๋ํ๋ ๊ฒ์ด ๋์์ด๋๋ค๋ฉด "๊ฐ์ "๋ฅผ ์ ๊ณตํ๋ ๊ฒ์ด ๋ฌธ์ ์ ๋ค๋ฅธ ์ด์ ๋ ๋ฌด์์ ๋๊น?
๋ด ๋ง์, Helm 3.3.4, https://artifacthub.io/packages/helm/bitnami/nginx ์ฐจํธ์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ผ๋ฉฐ ๊ฐ์ด ๋ณ๊ฒฝ๋์ง ์์์ต๋๋ค. GCP / GKE, Azure / AKS ๋ฐ AWS / EKS์ ์ธ ๊ฐ์ง ๋ค๋ฅธ ํด๋ผ์ฐ๋์์ ํ ์คํธ๋์์ผ๋ฉฐ ์ธ ๊ฐ์ง ๋ชจ๋์์ ์คํจํ์ต๋๋ค.
Helm์ 3.1.3์ผ๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํ๊ณ "--force"ํ๋๊ทธ์์ด 3.3.4์์ ์์ ํ ์งํ์ ์์ ํ์ต๋๋ค.
์ฌ์ฉ์๊ฐ์ด ์ค๋ฅ๋ฅผ ๋ณผ ์์๋ ๋ ๊ฐ์ง ๊ณ ์ ํ ๊ฒฝ์ฐ๊ฐ ์์์ ์ด์ ์๊ฒฌ์์ ์๋นํ ๋ถ๋ช ํ ๋ฐํ์ต๋๋ค. ํ๋๋ OP์ ๊ฒฝ์ฐ์ ๋๋ค. ๋ค๋ฅธ ํ๋๋ --force์ ์ฌ์ฉ์ ๋๋ค. ์ฌ๊ธฐ์๋ OP ๋ฌธ์ ์ ์ด์ ์ ๋ง์ถ๊ณ ์์ต๋๋ค.
OP์ ๋์ผํ ๋ฌธ์ ๋ฅผ ๊ฒช๊ณ ์๋ ์ฌ๋๋ค์ ์กด์คํ๊ธฐ ์ํด์ด ์ค๋ ๋๋ฅผ ํ์ทจํ์ฌ --force์ ๋ํด ์ด์ผ๊ธฐํ๋ ๊ฒ์ ์ค์งํ์ญ์์ค. OP ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ์ ๋ ผ์ ์ค์ ๋๋ค. OP์์ ์ค๋ช ํ ๋ฌธ์ ์ ๊ด๋ จ์ด์๋ ์ฃผ์ ์ ๋ํด ์ด์ผ๊ธฐํ๊ณ ์ถ๋ค๋ฉด ์ ํฐ์ผ์ ์ด๊ฑฐ ๋ ์ด์ ์ ์ ์ํ ์ ์์ ์ดํด๋ณด์ธ์.
Helm 2์ ๋ํ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ๊ฒ๊ณผ ๊ด๋ จํ์ฌ @tibetsam : ์๋์. Helm 2์ ๋ํ ๋ฒ๊ทธ ์์ ์ ๋ ์ด์ ์ ๊ณตํ์ง ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ https://helm.sh/blog/helm-v2-deprecation-timeline/ ์ ์ฐธ์กฐ
jupytherhub helm chart๋ก OP์ ๋ฌธ์ ๋ฅผ ์ฌํํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
์๋ ์ง์นจ์ ๋ฐ๋ผ ๋ฌธ์ ๋ฅผ ์ฌํ ํ ์ ์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
์ค๋ํ
Jupyterhub helm ์ฐจํธ๋ ์๋น์ค ์ฌ์์ spec.clusterIP
ํ๋๋ฅผ ํฌํจํ์ง ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ์ฌ๊ธฐ์์ ๋ณผ ์ ์์ต๋๋ค. https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/c0a43af12a89d54bcd6dcb927fdcc2f623a14aca /jupyterhub/templates/hub/service.yaml#L17 -L29
๋๋ ๋ฌธ์ ๋ฅผ ์ฌํํ๊ธฐ ์ํด ํค์ ์น์ ์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
โ helm version
version.BuildInfo{Version:"v3.4.0", GitCommit:"7090a89efc8a18f3d8178bf47d2462450349a004", GitTreeState:"clean", GoVersion:"go1.14.10"}
โ kind version
kind v0.9.0 go1.15.2 linux/amd64
โ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.1", GitCommit:"206bcadf021e76c27513500ca24182692aabd17e", GitTreeState:"clean", BuildDate:"2020-09-14T07:30:52Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
์ฌ์์ฐ ๋ฐฉ๋ฒ
kind create cluster
proxy:
secretToken: "3a4bbf7405dfe1096ea2eb9736c0df299299f94651fe0605cfb1c6c5700a6786"
์ฐธ๊ณ ๋ก Helm ํ์ผ ์ค์น ์ง์นจ์ ๋ฐ๋ฅด๊ณ ์์ต๋๋ค ( ๋งํฌ ).
helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
helm repo update
--force
์ต์
์ฌ์ฉ)RELEASE=jhub
NAMESPACE=jhub
helm upgrade --cleanup-on-fail --force \
--install $RELEASE jupyterhub/jupyterhub \
--namespace $NAMESPACE \
--create-namespace \
--version=0.9.0 \
--values config.yaml
์ค๋ฅ:
Error: UPGRADE FAILED: failed to replace object: PersistentVolumeClaim "hub-db-dir" is invalid: spec: Forbidden: spec is immutable after creation except resources.requests for bound claims
ย ย core.PersistentVolumeClaimSpec{
ย ย AccessModes: []core.PersistentVolumeAccessMode{"ReadWriteOnce"},
ย ย Selector: nil,
ย ย Resources: core.ResourceRequirements{Requests: core.ResourceList{s"storage": {i: resource.int64Amount{value: 1073741824}, s: "1Gi", Format: "BinarySI"}}},
-ย VolumeName: "",
+ย VolumeName: "pvc-c614de5c-4749-4755-bd3a-6e603605c44e",
-ย StorageClassName: nil,
+ย StorageClassName: &"standard",
ย ย VolumeMode: &"Filesystem",
ย ย DataSource: nil,
ย ย }
&& failed to replace object: Service "hub" is invalid: spec.clusterIP: Invalid value: "": field is immutable && failed to replace object: Service "proxy-api" is invalid: spec.clusterIP: Invalid value: "": field is immutable && failed to replace object: Service "proxy-public" is invalid: spec.clusterIP: Invalid value: "": field is immutable
๋๋ helm 3.3.4์ ์์ผ๋ฉฐ ์ด๊ฒ์ ์ฌ์ ํ โโ๋ฌธ์ ์ ๋๋ค.
Helm 2.14.1 ๋ฌธ์ ๊ฐ --force
ํด๊ฒฐ ๋ฐฉ๋ฒ : type.spec: NodePort
์ ํํ์ฌ helmchart ์
๊ทธ๋ ์ด๋๋ฅผ ์์ ํ์ต๋๋ค.
--force ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ์ฌ v3.4.1์์ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
@bacongobbler ๋๋ ๋น์ ์ด OP์ ๋ฌธ์ (# 6378๊ณผ๋ ๋ณ๋๋ก)๊ฐ ๋ฉ์น ๋นํ์ง ์๋๋ก ์กฐ์ฌ์ค๋ฝ๊ฒ ๋ ธ๋ ฅํ๊ณ ์๋ค๋ ๊ฒ์ ์๊ณ ์์ต๋๋ค. ๊ฒ์ํ๋ ์ฌ๋๋ค์ด ์ค๋ฅ ๋ฉ์์ง๋ฅผ ๊ฒํ ํ์ฌ์ด ์ค๋ ๋๊ฐ ์์ ์์ํ ๊ฒ์ธ์ง ์๋์ง ํ์ธํ๋ ๋ฐ ๋์์ด ๋ ๊ฒ์ด๋ผ๊ณ ์๊ฐํ์ต๋๋ค.
์ค๋ฅ ๋ฉ์์ง "์ค๋ฅ : ์ ๊ทธ๋ ์ด๋ ์คํจ : _replace_ ... ์คํจ"์ด๊ณ ๋ช ๋ น์์ --force๋ฅผ _did use_ ํ์ต๋๊น? ์ด๋ # 6378
"์ค๋ฅ : ์ ๊ทธ๋ ์ด๋ ์คํจ : _patch_ ... ํ ์ ์์ต๋๋ค"๋ผ๋ ์ค๋ฅ ๋ฉ์์ง๊ฐ _ ๋ช ๋ น์ _ --force๋ฅผ ์ฌ์ฉํ์ง ์์ ์ต๋๊น? ์ด ๋ฌธ์ ๋ฅผ ์ด๋ป๊ฒ ์ฌํํ๋์ง ๊ฒ์ ํด์ฃผ์ธ์.
๋ฟก ๋นต๋จ
helm3 upgrade concourse concourse/concourse -f temp.yaml --force
Error: UPGRADE FAILED: failed to replace object: Service "concourse-web" is invalid: spec.clusterIP: Invalid value: "None": field is immutable && failed to replace object: Service "concourse-web-prometheus" is invalid: spec.clusterIP: Invalid value: "": field is immutable && failed to replace object: Service "concourse-web-worker-gateway" is invalid: spec.clusterIP: Invalid value: "": field is immutable
helm3 upgrade concourse concourse/concourse -f temp.yaml
Error: UPGRADE FAILED: cannot patch "concourse-web" with kind Service: Service "concourse-web" is invalid: spec.clusterIP: Invalid value: "None": field is immutable
Helm 3.4.2์์ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค. ๋ฐฐํฌ, ์๋น์ค ๊ณ์ ๋ฐ ์๋น์ค๋ฅผ ๋ง๋๋ helm-chart๋ฅผ ์คํํฉ๋๋ค. ๋ฐฐํฌ์ ์ฐจํธ์ ๊ธฐ์กด ๋ ์ด๋ธ ์งํฉ์ ๋ ์ด๋ธ์ ์ถ๊ฐํ๋๋ฐ ์ด์ ์ ๊ทธ๋ ์ด๋๋ฅผ ๊ฑฐ๋ถํฉ๋๋ค.
helm upgrade test-whale charts/app-template/ --install --values values.yaml --namespace whale --force
Error: UPGRADE FAILED: failed to replace object: Service "test-whale" is invalid: spec.clusterIP: Invalid value: "": field is immutable && failed to replace object: Deployment.apps "test-whale-canary" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"test-whale", "app-id":"302040", "environment":"test", "version":"latest"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable && failed to replace object: Deployment.apps "test-whale" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"test-whale", "app-id":"302040", "environment":"test", "version":"latest"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
๊ธฐ๋ณธ์ ์ผ๋ก ์ด๊ธฐ helm ๋ฐฐํฌ ์ดํ์๋ ๋ ์ด๋ธ์ ์ถ๊ฐ ํ ์์๋ ๊ฒ ๊ฐ์ต๋๋ค.
๋์ฐํ๊ฒ ๋ค๋ฆฌ์ง๋ง Helm์ด ํน๋ณํ ๋์ฐ๋ฅผ๋ฐ์ "๋ถ๋ณ ํ๋"๋ชฉ๋ก์ ๊ตฌํํ ์ ์์ต๋๊น?
์ด ๊ฒฝ์ฐ "๋ถ๋ณ ํ๋"๋ ์๋น์ค ๊ฐ์ฒด์ spec.clusterIP
. Helm์์ด๋ฅผ ๋ถ๋ณ์ผ๋ก ๊ฐ์ฃผํ๊ณ a) ๊ต์ฒด๋ฅผ ์๋ํ์ง ์๊ณ b) ์ ๊ฑฐ๋ฅผ ์๋ํ์ง ์๋ ์ด๋ฌํ API ์์ฒญ์ ์์ฑํฉ๋๋ค. , c) ์
๋ฐ์ดํธํ์ง ๋ง์ญ์์ค.
์ค์ ๋ก Helm์ ๋ณ๊ฒฝ ๋ถ๊ฐ๋ฅํ ํ๋์ ํ์ฌ ๊ฐ์ ์ฐพ๊ณ API ์์ฒญ์ ํ์ด๋ก๋์ ํด๋น ๊ฐ์ ํฌํจํฉ๋๋ค. ๊ฒฐ๊ณผ์ ์ผ๋ก k8s API ์๋ฒ๋ Helm์ ์์ฒญ์ "ํ์ธ,์ด ํ๋๋ฅผ ์์ ํ๋ ค๊ณ ํ์ง ์์ต๋๋ค"๋ก ๊ฐ์ฃผํฉ๋๋ค.
ํ์ฌ ์ํฉ์ Helm์ด ํน์ ๋ฆฌ์์ค์ ์ง์ค์ ๋ณด์ ํ๊ณ ์๋ค๊ณ ๊ฐ์ ํ๊ธฐ ๋๋ฌธ์ ํนํ ์๋น์ค ๋ฆฌ์์ค์์ Helm์ด ๋งค์ฐ ์ ๋ขฐํ ์ ์๋ค๋ ๊ฒ์ ๋๋ค. ์ด๊ฒ์ ์์์ด Helm์ด ์ธ์ํ์ง ๋ชปํ๋ ์๋ก์ด ํน์ฑ์ ์๋ฒ ์ธก์ ์์ ํ์ ์ ์์ผ๋ฏ๋ก์ด ๋ฌธ์ ์์ ๋ฌธ์ ๋ฅผ ์ผ์ผํค๋ ์๋ชป๋ ๊ฐ์ ์ ๋๋ค. ๋ฐ๋ผ์ Helm์ ์ ํฉํ k8s ์๋ฏผ์ด๋๊ธฐ ์ํด ํน๋ณํ ์ฒ๋ฆฌ๊ฐ ํ์ํ ํ๋๋ฅผ ์์์ผํฉ๋๋ค.
์ถ์ . ๋ํ kubectl
๋ ๋ง์ ๋
ผ๋ฆฌ ํด๋ผ์ด์ธํธ ์ธก์ ๊ตฌํํ๋ฏ๋ก kubectl
๊ฐ ์ด๋ฌํ ์์ ์ ์๊ตฌ ์ฌํญ์ ์ํ ํ ์ ์์ต๋๋ค.
@ jilliau-rcd
--force๋ฅผ ์ฌ์ฉํ์ง ๋ง์ญ์์ค
@pre
3 ๋ฐฉํฅ ๋ณํฉ์ ๋ฌธ์ ๊ฐ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ง์ง๋ง์ผ๋ก ์ ์ฉ๋ ์ฃผ์์ด ์ด๋ป๊ฒ ๋ ๋ถ์ ์ ํ๊ฒ ๊ธฐ๋ก๋์์ ์ ์์ต๋๋ค.
๋๋ ๊ทธ๊ฒ์ ์์ ๋ด๊ฒ๋์๋ค. ๋ถ๋ช
ํ Deployment
๋ฐ ํฌ๋ ์ฌ์์์ ๋ ์ด๋ธ์ ๋ณ๊ฒฝํ ์ ์์ง๋ง ๋งค์น ์ ํ๊ธฐ์์๋ ... Kubernetes๋ ๊ทธ๊ฒ์ ์ข์ํ์ง ์์ต๋๋ค. ๋์๊ฒ๋ ์ด์ํ๋ค. ์นด๋๋ฆฌ์ ๋ฐฐํฌ์ ๊ฐ์ด version
"v2"์์ ํฌ๋ ๋ง ์ ํํ๋๋ก ๋ฐฐํฌ๋ฅผ ์์ ํ๋ ค๋ฉด ์ด๋ป๊ฒํด์ผํฉ๋๊น? ํ์ฌ ๋๋ ๊ทธ๋ ๊ฒ ํ ๋ฐฉ๋ฒ์ด ์์ด์ ๊ทธ ๋ถ๋ถ์ ๋ํด ํผ๋์ค๋ฌ์ํ์ต๋๋ค.
Helm ๋ฒ์ 3.5.0์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
Helm ๋ฒ์ 3.5.0์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
์ ํํ ์ด๋ป๊ฒ?
Helm ๋ฒ์ 3.5.0์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
Helm ๋ฒ์ 3.5.0์ ์ฌ์ ํ โโ์๋ํ์ง ์์ต๋๋ค.
๊ทธ๋ฌ๋ --force
์์ด๋ ์๋ํฉ๋๋ค.
ํฌ๊ธฐ 3.5.2์์ ์ด๊ฒ์ ๋๋ฅด์ญ์์ค.
--force
์ (๋ฅผ) ์ ๊ฑฐํ๋ ค๊ณ ํ์ง๋ง ์ฌ์ ํ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
Upgrade "gateway" failed: failed to replace object: Service "ingress"
is invalid: spec.clusterIPs[0]: Invalid value: []string(nil): primary clusterIP
can not be unset
์ง๊ธ๊น์ง ํฉ๋ฆฌ์ ์ธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ฐพ์์ต๋๋ค- --reuse-values
ํ๋๊ทธ. ๋ด ๊ฒฝ์ฐ์ ์ ํฉํฉ๋๋ค.
3.5.2๋ --reuse-values๋ฅผ ์ฌ์ฉํ๊ฑฐ๋ ์ฌ์ฉํ์ง ์๊ณ ์ฌ์ ํ์ด ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
3.5.3์๋ ๋ค์์ด ์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ฐธ๊ณ ๋ก OP๊ฐ ์ ๊ธฐ ํ ๋ฌธ์ ์
--force
์ ๋ํด ์ฌ๊ธฐ์์ ์ ๊ธฐ ๋ ์๊ฒฌ์ ๋ณ๊ฐ์ ๊ฐ๋ณ ๋ฌธ์ ์ ๋๋ค. ์ฌ๊ธฐ์์ OP์ ๋ฌธ์ ์ ์ง์ค ํด ๋ณด๊ฒ ์ต๋๋ค.๋ช ํํํ๊ธฐ ์ํด OP๊ฐ ์ค๋ช ํ๋ ๋ฌธ์ ๋ https://github.com/helm/helm/issues/7956#issuecomment -620749552์์ ํ์ธ ๋ ์ ์ฌ์ ํ๊ท @ n1koo์ ๋๋ค. ํฉ๋ฒ์ ์ธ ๋ฒ๊ทธ ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
--force
์ ๊ฑฐ์ ๋ํด ์ธ๊ธ ํ ๋ค๋ฅธ ์๊ฒฌ์ Kubernetes์ ๊ด์ ์์ ์๋์ ์ด๊ณ ์์ ๋ ๋์์ ๋๋ค.--force
๋ฅผ ์ฌ์ฉํ๋ฉด Helm์ Kubernetes์ ๋ํ PUT ์์ฒญ์ ์์ฒญํฉ๋๋ค. ์ค์ ๋ก๋ Kubernetes์๊ฒ ๋์ ๋งค๋ํ์คํธ (helm upgrade
์์ ์ฐจํธ์ ๋ ๋๋ง ๋ ํ ํ๋ฆฟ)๋ฅผ ์ง์ค์ ์์ค๋ก ์ฌ์ฉํ๊ณ ๋ ๋๋ง ๋ ๋งค๋ํ์คํธ๋ก ํด๋ฌ์คํฐ์ ๋ฆฌ์์ค๋ฅผ ๋ฎ์ด ์ฐ๋๋ก ์์ฒญํฉ๋๋ค.kubectl apply --overwrite
๋์ผํฉ๋๋ค.๋๋ถ๋ถ์ ๊ฒฝ์ฐ ํ ํ๋ฆฟ์ ํด๋ฌ์คํฐ IP๋ฅผ ์ง์ ํ์ง ์์ต๋๋ค. ์ฆ,
helm upgrade --force
์์ ์๋น์ค์ ํด๋ฌ์คํฐ IP๋ฅผ ์ ๊ฑฐ (๋๋ ๋ณ๊ฒฝ)ํ๋๋ก ์์ฒญํฉ๋๋ค. ์ด๊ฒ์ Kubernetes์ ๊ด์ ์์ ๋ณผ ๋ ๋ถ๋ฒ์ ์ธ ์์ ์ ๋๋ค.์ด๊ฒ์ # 7082์๋ ๋ฌธ์ํ๋์ด ์์ต๋๋ค.
์ด๊ฒ์ด
--force
์ ๊ฑฐ๊ฐ ์๋ํ๋ ์ด์ ์ด๊ธฐ๋ํฉ๋๋ค. Helm์ ๋ผ์ด๋ธ ์ํ์ ๋น๊ตํ์ฌ ํด๋ฌ์คํฐ IP๋ฅผ ํจ์น ๋ ๋งค๋ํ์คํธ๋ก ๋ณํฉํ์ฌ ์ ๊ทธ๋ ์ด๋ ๋์ ํด๋ฌ์คํฐ IP๋ฅผ ๋ณด์กดํ๋ PATCH ์์ ์ ์ํํฉ๋๋ค.Helm 2์์ ์ํ ํ ๊ฒ์ฒ๋ผ ๊ฐ์ฒด๋ฅผ ๊ฐ์ ๋ก ์ ๊ฑฐํ๊ณ ๋ค์ ๋ง๋ค๊ณ ์ถ๋ค๋ฉด # 7431์ ์ดํด๋ณด์ธ์.
์ด๊ฒ์ด ์ํฉ์ ๋ช ํํํ๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
์์ผ๋ก ์ฌ๊ธฐ์ OP ๋ฌธ์ ์ ์ง์ค ํด ๋ณด๊ฒ ์ต๋๋ค.