5
我使用kubectl create secret generic production-tls --from-file=./tls.key --from-file=./tls.crt
創建了一個祕密。如何從文件生成Kuberenetes時更新密碼?
如果我想更新值 - 我該怎麼做?
我使用kubectl create secret generic production-tls --from-file=./tls.key --from-file=./tls.crt
創建了一個祕密。如何從文件生成Kuberenetes時更新密碼?
如果我想更新值 - 我該怎麼做?
這應該工作:
kubectl create secret generic production-tls --from-file=./tls.key --from-file=./tls.crt --dry-run -o yaml | kubectl apply -f -
可以刪除,並立即重新創建祕密:
kubectl delete secret production-tls
kubectl create secret generic production-tls --from-file=./tls.key --from-file=./tls.crt
我把這些命令的腳本,在第一次調用你會得到一個有關警告(還沒有)存在的祕密,但這是有效的。
我喜歡巧妙地使用輸出到yaml並應用命令。 +1 –