forked from VictoriaMetrics/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.gotmpl
140 lines (89 loc) · 3.92 KB
/
README.md.gotmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Helm Chart For Victoria Metrics Operator.
{{ template "chart.typeBadge" . }} {{ template "chart.versionBadge" . }}
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-operator)
{{ template "chart.description" . }}
## Prerequisites
* Install the follow packages: ``git``, ``kubectl``, ``helm``, ``helm-docs``. See this [tutorial](../../REQUIREMENTS.md).
* PV support on underlying infrastructure.
## Upgrade guide
During release an issue with helm CRD was discovered. So for upgrade from version less then 0.1.3 you have to two options:
1) use helm management for CRD, enabled by default.
2) use own management system, need to add variable: --set createCRD=false.
If you choose helm management, following steps must be done before upgrade:
1) define namespace and helm release name variables
```
export NAMESPACE=default
export RELEASE_NAME=operator
```
execute kubectl commands:
```
kubectl get crd | grep victoriametrics.com | awk '{print $1 }' | xargs -i kubectl label crd {} app.kubernetes.io/managed-by=Helm --overwrite
kubectl get crd | grep victoriametrics.com | awk '{print $1 }' | xargs -i kubectl annotate crd {} meta.helm.sh/release-namespace="$NAMESPACE" meta.helm.sh/release-name="$RELEASE_NAME" --overwrite
```
run helm upgrade command.
## Chart Details
This chart will do the following:
* Rollout victoria metrics operator
## How to install
Access a Kubernetes cluster.
Add a chart helm repository with follow commands:
```console
helm repo add vm https://victoriametrics.github.io/helm-charts/
helm repo update
```
List versions of ``vm/victoria-metrics-operator`` chart available to installation:
```console
helm search repo vm/victoria-metrics-operator -l
```
Export default values of ``victoria-metrics-operator`` chart to file ``values.yaml``:
```console
helm show values vm/victoria-metrics-operator > values.yaml
```
Change the values according to the need of the environment in ``values.yaml`` file.
Test the installation with command:
```console
helm install vmoperator vm/victoria-metrics-operator -f values.yaml -n NAMESPACE --debug --dry-run
```
Install chart with command:
```console
helm install vmoperator vm/victoria-metrics-operator -f values.yaml -n NAMESPACE
```
Get the pods lists by running this commands:
```console
kubectl get pods -A | grep 'operator'
```
Get the application by running this command:
```console
helm list -f vmoperator -n NAMESPACE
```
See the history of versions of ``vmoperator`` application with command.
```console
helm history vmoperator -n NAMESPACE
```
## How to uninstall
Remove application with command.
```console
helm uninstall vmoperator -n NAMESPACE
```
## Validation webhook
Its possible to use validation of created resources with operator. For now, you need cert-manager to easily certificate management https://cert-manager.io/docs/
```yaml
admissionWebhooks:
enabled: true
# what to do in case, when operator not available to validate request.
certManager:
# enables cert creation and injection by cert-manager
enabled: true
```
## Documentation of Helm Chart
Install ``helm-docs`` following the instructions on this [tutorial](../../REQUIREMENTS.md).
Generate docs with ``helm-docs`` command.
```bash
cd charts/victoria-metrics-operator
helm-docs
```
The markdown generation is entirely go template driven. The tool parses metadata from charts and generates a number of sub-templates that can be referenced in a template file (by default ``README.md.gotmpl``). If no template file is provided, the tool has a default internal template that will generate a reasonably formatted README.
## Parameters
The following tables lists the configurable parameters of the chart and their default values.
Change the values according to the need of the environment in ``victoria-metrics-operator/values.yaml`` file.
{{ template "chart.valuesTable" . }}