问题是:我们有一些版本的 kube-prometheus-stack (https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack) 例如版本 20.0.0。我只想安装 40.0.0 版本。根据文档,我应该使用 kubectl apply -f somecrd 安装 crd。我可以只安装正在运行并且已经安装了所有这些 crd 的版本 40.0.0 吗?
谢谢
按照docs中的建议,如果您想将 kube-stack-prometheus 版本升级到 40.0.0,您需要使用以下命令升级 crds,并在升级 kube-prometheus 之前删除 daemonset-堆栈图:
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.59.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.59.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.59.1/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.59.1/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.59.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.59.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.59.1/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.59.1/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml
不建议运行如此大的升级(20.0.0 -> 40.0.0),因为 Helm Charts 默认值.yaml 可能有很多更改,因此如果您只想要最新版本,可以考虑卸载在重新安装更新版本之前,查看 Helm Chart 并删除所有 CRD。