README.md 6.38 KB
Newer Older
kelseiv's avatar
kelseiv committed
1
# Kapacitor Helm chart
2

kelseiv's avatar
kelseiv committed
3
[Kapacitor](https://github.com/influxdata/kapacitor) is an open-source framework used for processing, monitoring, and alerting on time series data.
4

kelseiv's avatar
kelseiv committed
5
The Kapacitor Helm chart uses the [Helm](https://helm.sh) package manager to bootstrap a Kapacitor deployment and service on a [Kubernetes](http://kubernetes.io) cluster.
6

kelseiv's avatar
kelseiv committed
7
## Prerequisites
8

kelseiv's avatar
kelseiv committed
9 10 11
- Helm v2 or later
- Kubernetes 1.4+
- PersistentVolume (PV) provisioner support in the underlying infrastructure (optional)
12

kelseiv's avatar
kelseiv committed
13
## Install the chart
14

kelseiv's avatar
kelseiv committed
15
1. Add the InfluxData Helm repository:
16

kelseiv's avatar
kelseiv committed
17 18 19
   ```bash
   helm repo add influxdata https://helm.influxdata.com/
   ```
20

kelseiv's avatar
kelseiv committed
21
2. Run the following command, providing a name for your release:
22

kelseiv's avatar
kelseiv committed
23 24 25
   ```bash
   helm upgrade --install my-release influxdata/kapacitor
   ```
26

kelseiv's avatar
kelseiv committed
27
   > **Tip**: `--install` can be shortened to `-i`.
28

kelseiv's avatar
kelseiv committed
29
   This command deploys Kapacitor on the Kubernetes cluster using the default configuration. To find parameters you can configure during installation, see [Configure the chart](#configure-the-chart).
30

kelseiv's avatar
kelseiv committed
31
   > **Tip**: To view all Helm chart releases, run `helm list`.
32

kelseiv's avatar
kelseiv committed
33
## Uninstall the chart
34

kelseiv's avatar
kelseiv committed
35
To uninstall the `my-release` deployment, use the following command:
36 37

```bash
38
helm uninstall my-release
39 40
```

kelseiv's avatar
kelseiv committed
41
This command removes all the Kubernetes components associated with the chart and deletes the release.
42

kelseiv's avatar
kelseiv committed
43
## Configure the chart
44

kelseiv's avatar
kelseiv committed
45
The following table lists configurable parameters, their descriptions, and their default values stored in `values.yaml`.
46 47 48

| Parameter               | Description                           | Default                                                    |
| ----------------------- | ----------------------------------    | ---------------------------------------------------------- |
kelseiv's avatar
kelseiv committed
49
| `image.repository` | image repository url | Kapacitor image | `kapacitor` |
timhallinflux's avatar
timhallinflux committed
50
| `image.tag` | Kapacitor image version | `1.6.4-alpine` |
51
| `image.pullPolicy` | Kapacitor image pull policy |  `IfNotPresent` |
52
| `strategy` | Kapacitor deployment strategy config |  |
53 54 55 56 57
| `service.type` | Kapacitor web service type  | `ClusterIP` |
| `persistence.enabled` | Enable Kapacitor persistence using Persistent Volume Claims | `false` |
| `persistence.storageClass` | Kapacitor Persistent Volume Storage Class | `default` |
| `persistence.accessMode` | Kapacitor Persistent Volume Access Mode | `ReadWriteOnce` |
| `persistence.size` | Kapacitor Persistent Volume Storage Size | `8Gi` |
58
| `persistence.existingClaim` | Kapacitor existing PVC name | `nil` |
59 60 61 62 63
| `resources.request.memory` | Kapacitor memory request | `256Mi` |
| `resources.request.cpu` | Kapacitor cpu request | `0.1` |
| `resources.limits.memory` | Kapacitor memory limit | `2Gi` |
| `resources.limits.cpu` | Kapacitor cpu limit | `2` |
| `envVars` | Environment variables to set initial Kapacitor configuration (https://hub.docker.com/_/kapacitor/) | `{}` |
64
| `influxURL` | InfluxDB url used to interact with Kapacitor | `http://influxdb-influxdb.tick:8086` |
65
| `existingSecret` | Name of an existing Secrect used to set the environment variables for the InfluxDB user and password. The expected keys in the secret are `influxdb-user` and `influxdb-password`. |
66 67 68 69
| `rbac.create` | Create and use RBAC resources | `true` |
| `rbac.namespaced` | Creates Role and Rolebinding instead of the default ClusterRole and ClusteRoleBindings for the Kapacitor instance  | `false` |
| `serviceAccount.annotations` | ServiceAccount annotations | `{}` |
| `serviceAccount.create` | Create service account | `true` |
70
| `serviceAccount.name` | Service account name to use, when empty will be set to created account if `serviceAccount.create` is set else to `default` |  |
71 72 73 74 75 76 77 78 79
| `sidecar.image` | Sidecar image | `kiwigrid/k8s-sidecar:0.1.116` |
| `sidecar.imagePullPolicy` | Sidecar image pull policy | `IfNotPresent` |
| `sidecar.resources` | Sidecar resources | `{}` |
| `sidecar.skipTlsVerify` | Set to true to skip tls verification for kube api calls | `nil` |
| `sidecar.sideload.enabled` | Enables the search for sideloads and adds/updates/deletes them in Kapacitor | `false` |
| `sidecar.sideload.label` | Label that configmaps with sideloads should have to be added | `kapacitor_sideload` |
| `sidecar.sideload.searchNamespace` | If specified, the sidecar will search for sideload configmaps inside this namespace. Otherwise the namespace in which the sidecar is running will be used. It's also possible to specify ALL to search in all namespaces | `nil` |
| `sidecar.sideload.folder` | Folder in the pod that should hold the collected sideloads. This path will be mounted. | `/var/lib/kapacitor/sideload` |
| `namespaceOverride` | Override the deployment namespace | `""` (`Release.Namespace`) |
80

kelseiv's avatar
kelseiv committed
81
To configure the chart, do either of the following:
82

kelseiv's avatar
kelseiv committed
83
- Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade --install`. For example, use the following command:
84

kelseiv's avatar
kelseiv committed
85 86
  ```bash
  helm upgrade --install my-release \
Jack Zampolin's avatar
Jack Zampolin committed
87
  --set influxURL=http://myinflux.mytld:8086,persistence.enabled=true \
88
    influxdata/kapacitor
kelseiv's avatar
kelseiv committed
89
  ```
90

kelseiv's avatar
kelseiv committed
91
  This command enables persistence.
92

kelseiv's avatar
kelseiv committed
93
- Provide a YAML file that specifies parameter values while installing the chart. For example, use the following command:
94

kelseiv's avatar
kelseiv committed
95 96 97
  ```bash
  helm upgrade --install my-release -f values.yaml influxdata/kapacitor
  ```
98

kelseiv's avatar
kelseiv committed
99
  > **Tip**: Use the default [values.yaml](values.yaml).
100

kelseiv's avatar
kelseiv committed
101
For information about running Kapacitor in Docker, see the [full image documentation](https://hub.docker.com/_/kapacitor/).
102 103 104 105 106

## Persistence

The [Kapacitor](https://hub.docker.com/_/kapacitor/) image stores data in the `/var/lib/kapacitor` directory in the container.

107
The chart optionally mounts a [Persistent Volume](http://kubernetes.io/docs/user-guide/persistent-volumes/) at this location. The volume is created using dynamic volume provisioning.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127

## Sidecar for sideloads

If the parameter `sidecar.sideload.enabled` is set, a sidecar container is deployed in the Kapacitor
pod. This container watches all configmaps in the cluster and filters out the ones with
a label as defined in `sidecar.sideload.label`. The files defined in those configmaps are written
to a folder and can be accessed by TICKscripts. Changes to the configmaps are monitored and the files
are deleted/updated.

Example sideload config:
```
apiVersion: v1
kind: ConfigMap
metadata:
  name: kapacitor-sideload-influxdb-httpd-clienterror
  labels:
    kapacitor_sideload: "1"
data:
  influxdb-httpd-clienterror.yml: |
    [...]
kelseiv's avatar
kelseiv committed
128 129 130 131 132
```

---

Check out our [Slack channel](https://www.influxdata.com/slack) for support and information.