我正在運行一個helm upgrade命令來安裝某個圖表。我需要設定的值之一是這樣的:
helm upgrade --install someService someChart `
--set coredns.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-internal"="true"
我已經成功地將它與其他圖表一起使用,但在這個特定的圖表上我得到了錯誤
Error: unable to build kubernetes objects from release manifest: unable to decode "": json: cannot unmarshal bool into Go struct field ObjectMeta.metadata.annotations of type string
所以看起來 helm 會自動將其true轉換為布林值。我已經嘗試過使用="\"true\"",但這也沒有幫助。
有什么想法可以告訴 helm 不要將其轉換為 bool 嗎?(我無法控制舵圖)
uj5u.com熱心網友回復:
您可以使用helm upgrade --set-string強制 Helm 將值解釋為字串。
helm upgrade --install someService someChart \
--set-string coredns...=true
請注意,helm install --set它的語法和參考規則有些不尋常;您已經看到需要在值名稱中轉義句點。helm install -f您可能會發現撰寫安裝特定值的 YAML(或 JSON)檔案并使用選項傳遞它更清晰。
coredns:
service:
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
helm upgrade --install someService someChart \
-f local-values.yaml
這是一個獨立于values.yaml圖表一部分的檔案的檔案,其值與圖表的值合并,本地值優先。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/495022.html
標籤:Kubernetes kubernetes-helm 掌舵3
上一篇:Helm連接的字串沒有被渲染
