Skip to content

Commit

Permalink
Add kustomize for CRDs.
Browse files Browse the repository at this point in the history
  • Loading branch information
KazW authored May 16, 2023
1 parent 8f91606 commit 30dffb2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
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

0 comments on commit 30dffb2

Please sign in to comment.