Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-prometheus-stack] Add Kustomize for Managing CRDs #3380

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 45.28.0
version: 45.29.0
appVersion: v0.65.1
kubeVersion: ">=1.16.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
21 changes: 10 additions & 11 deletions charts/kube-prometheus-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,10 @@ This removes all the Kubernetes components associated with the chart and deletes

_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._

CRDs created by this chart are not removed by default and should be manually cleaned up:
CRDs created by this chart are not removed by default and should be manually cleaned up: (add `?ref=kube-prometheus-stack-x.y.z` to the URL for a specific version)

```console
kubectl delete crd alertmanagerconfigs.monitoring.coreos.com
kubectl delete crd alertmanagers.monitoring.coreos.com
kubectl delete crd podmonitors.monitoring.coreos.com
kubectl delete crd probes.monitoring.coreos.com
kubectl delete crd prometheuses.monitoring.coreos.com
kubectl delete crd prometheusrules.monitoring.coreos.com
kubectl delete crd servicemonitors.monitoring.coreos.com
kubectl delete crd thanosrulers.monitoring.coreos.com
kubectl delete -k https://github.com/prometheus-community/helm-charts/charts/kube-prometheus-stack/crds/
```

## Upgrading Chart
Expand All @@ -71,10 +64,16 @@ kubectl delete crd thanosrulers.monitoring.coreos.com
helm upgrade [RELEASE_NAME] prometheus-community/kube-prometheus-stack
```

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

With Helm v3, CRDs created by this chart are not updated by default and should be manually updated.
Consult also the [Helm Documentation on CRDs](https://helm.sh/docs/chart_best_practices/custom_resource_definitions).
Consult the [Helm Documentation on CRDs](https://helm.sh/docs/chart_best_practices/custom_resource_definitions) for more details.

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._
To upgrade CRDs manually, use this command: (add `?ref=kube-prometheus-stack-x.y.z` to the URL for a specific version)

```console
kubectl apply --server-side -k https://github.com/prometheus-community/helm-charts/charts/kube-prometheus-stack/crds/
```

### Upgrading an existing Release to a new major version

Expand Down
12 changes: 12 additions & 0 deletions charts/kube-prometheus-stack/crds/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
resources:
- crd-alertmanagerconfigs.yaml
- crd-alertmanagers.yaml
- crd-podmonitors.yaml
- crd-probes.yaml
- crd-prometheuses.yaml
- crd-prometheusrules.yaml
- crd-servicemonitors.yaml
- crd-thanosrulers.yaml