簡體   English   中英

Kubernetes 秘密以編程方式更新

[英]Kubernetes secret programmatically update

有沒有辦法以編程方式從 pod 更新 kubernetes 機密? 也就是說,不使用 kubectl。 我有一個秘密安裝在一個 pod 上,也通過環境變量公開。 我想從我的服務中修改它,但它看起來默認是只讀的。

You can use the Kubernetes REST API with the pod's serviceaccount's token as credentials (found at /var/run/secrets/kubernetes.io/serviceaccount/token inside the pod), you just need to allow the service account to edit secrets in the namespace通過一個角色。

請參閱 API 文檔的秘密

API 服務器可通過https://kubernetes.default在內部訪問

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM