Skip to content

Commit

Permalink
k8s-stack: added note about installing operator separately
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed Dec 4, 2024
1 parent f502b62 commit 454b743
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
20 changes: 16 additions & 4 deletions charts/victoria-metrics-k8s-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ defaultDashboards:

argocd.argoproj.io/sync-options: ServerSideApply=true

### Resources are not completely removed after chart uninstallation

This chart uses `pre-delete` Helm hook to cleanup resources managed by operator, but it's not supported in ArgoCD and this hooks is ignored.
To have a control over resources removal please consider using either [ArgoCD sync phases and waves](https://argo-cd.readthedocs.io/en/stable/user-guide/sync-waves/) or [installing operator chart separately](#install-operator-separately)

### Rules and dashboards

This chart by default install multiple dashboards and recording rules from [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus)
Expand Down Expand Up @@ -282,6 +287,16 @@ See the history of versions of `vmks` application with command.
helm history vmks -n NAMESPACE
```

### Install operator separately

To have control over an order of managed resources removal or to be able to remove a whole namespace with managed resources it's recommended to disable operator in k8s-stack chart (victoria-metrics-operator.enabled: false) and [install it](https://docs.victoriametrics.com/helm/victoriametrics-operator/) separately. To move operator from existing k8s-stack release to a separate one please follow the steps below:

- disable cleanup webhook (`victoria-metrics-operator.crds.cleanup.enabled: false`) and apply changes
- disable operator (`victoria-metrics-operator.enabled: false`) and apply changes
- [deploy operator](https://docs.victoriametrics.com/helm/victoriametrics-operator/) separately with `crds.plain: true`

If you're going to delete a whole namespace with managed resources please consider deploying operator in a separate namespace

### Install locally (Minikube)

To run VictoriaMetrics stack locally it's possible to use [Minikube](https://github.com/kubernetes/minikube). To avoid dashboards and alert rules issues please follow the steps below:
Expand All @@ -306,10 +321,7 @@ Remove application with command.
helm uninstall vmks -n NAMESPACE
```

By default with a Helm chart uninstallation CRDs will be removed as well by a chart hook.
If you want to disable CRDs removal please set `victoria-metrics-operator.crds.cleanup.enabled` to `false`

To remove CRDs manually please use:
CRDs created by this chart are not removed by default and should be manually cleaned up:

```console
kubectl get crd | grep victoriametrics.com | awk '{print $1 }' | xargs -i kubectl delete crd {}
Expand Down
22 changes: 17 additions & 5 deletions charts/victoria-metrics-k8s-stack/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ defaultDashboards:
argocd.argoproj.io/sync-options: ServerSideApply=true
```

argocd.argoproj.io/sync-options: ServerSideApply=true
argocd.argoproj.io/sync-options: ServerSideApply=true

### Resources are not completely removed after chart uninstallation

This chart uses `pre-delete` Helm hook to cleanup resources managed by operator, but it's not supported in ArgoCD and this hooks is ignored.
To have a control over resources removal please consider using either [ArgoCD sync phases and waves](https://argo-cd.readthedocs.io/en/stable/user-guide/sync-waves/) or [installing operator chart separately](#install-operator-separately)

### Rules and dashboards

Expand Down Expand Up @@ -204,6 +209,16 @@ helm repo update

{{ include "chart.installSection" . }}

### Install operator separately

To have control over an order of managed resources removal or to be able to remove a whole namespace with managed resources it's recommended to disable operator in k8s-stack chart (victoria-metrics-operator.enabled: false) and [install it](https://docs.victoriametrics.com/helm/victoriametrics-operator/) separately. To move operator from existing k8s-stack release to a separate one please follow the steps below:

- disable cleanup webhook (`victoria-metrics-operator.crds.cleanup.enabled: false`) and apply changes
- disable operator (`victoria-metrics-operator.enabled: false`) and apply changes
- [deploy operator](https://docs.victoriametrics.com/helm/victoriametrics-operator/) separately with `crds.plain: true`

If you're going to delete a whole namespace with managed resources please consider deploying operator in a separate namespace

### Install locally (Minikube)

To run VictoriaMetrics stack locally it's possible to use [Minikube](https://github.com/kubernetes/minikube). To avoid dashboards and alert rules issues please follow the steps below:
Expand All @@ -222,10 +237,7 @@ helm install [RELEASE_NAME] vm/victoria-metrics-k8s-stack -f values.yaml -f valu

{{ include "chart.uninstallSection" . }}

By default with a Helm chart uninstallation CRDs will be removed as well by a chart hook.
If you want to disable CRDs removal please set `victoria-metrics-operator.crds.cleanup.enabled` to `false`

To remove CRDs manually please use:
CRDs created by this chart are not removed by default and should be manually cleaned up:

```console
kubectl get crd | grep victoriametrics.com | awk '{print $1 }' | xargs -i kubectl delete crd {}
Expand Down

0 comments on commit 454b743

Please sign in to comment.