2017-08-25 47 views

回答

10

這應該工作:

kubectl create secret generic production-tls --from-file=./tls.key --from-file=./tls.crt --dry-run -o yaml | kubectl apply -f - 
+2

我喜歡巧妙地使用輸出到yaml並應用命令。 +1 –

3

可以刪除,並立即重新創建祕密:

kubectl delete secret production-tls 
kubectl create secret generic production-tls --from-file=./tls.key --from-file=./tls.crt 

我把這些命令的腳本,在第一次調用你會得到一個有關警告(還沒有)存在的祕密,但這是有效的。