我应该将存储驱动程序 Secret 在我的集群中保留多长时间?

For how long should I keep the storage driver Secret in my cluster?

我正在使用 helm 3.4.2 将我的图表升级到我的 AKS 集群,我看到每次我部署新东西时,它都会创建一个名为 sh.helm.v 的新秘密...这是第一个我用头盔的时间。

我正在阅读文档,发现在版本 3.x 中,helm 默认使用秘密来存储驱动程序。很酷,但每次我部署它都会创建一个新的秘密,我现在确定这是否是将它全部保存在我的集群中的最佳选择。

Soo,我应该把所有的东西都放在我的集群里吗?就像,每次我部署一些东西,它都会创建一个秘密并住在那里

我可以删除之前的最后一个吗?比如,现在部署 v5 并擦除 v1、v2、v3 并出于某种原因保留 v4 和 v5。如果可以的话,有没有人知道如何去做?使用 bash 或 kubectl?

非常感谢!

是的,与 Helm2 相比,Helm3 的主要变化很少。

  1. Secrets are now used as the default storage driver

In Helm 3, Secrets are now used as the default storage driver. Helm 2 used ConfigMaps by default to store release information. In Helm 2.7.0, a new storage backend that uses Secrets for storing release information was implemented, and it is now the default starting in Helm 3.

还有

  1. Release Names are now scoped to the Namespace

In Helm 3, information about a particular release is now stored in the same namespace as the release itself. With this greater alignment to native cluster namespaces, the helm list command no longer lists all releases by default. Instead, it will list only the releases in the namespace of your current kubernetes context (i.e. the namespace shown when you run kubectl config view --minify). It also means you must supply the --all-namespaces flag to helm list to get behaviour similar to Helm 2.


Soo, should I keep then all in my cluster? Like, every time I deploy some thing, it creates a secret and live there or Can I remove the last before?

我认为手动删除任何内容都不是一个好习惯。如果不是强制性的,最好不要碰它们。但是,如果您确定以后不需要旧版本,您可以删除未使用的。

#To check all secretes were created by helm:
kubectl get secret -l "owner=helm" --all-namespaces

#To delete revision you can simply remove appropriate secret..
kubectl delete secret -n <namespace> <secret-name>

顺便说一句(仅供参考),考虑到 Helm3 的范围仅限于命名空间这一事实 - 您可以简单地 delete deployment by deleting its corresponding namespace

最后一句话,也许对以下有用:您可以将 --history-max 传递到 helm upgrade

limit the maximum number of revisions saved per release. Use 0 for no limit (default 10)