├── .gitignore ├── LICENSE ├── README.md ├── chronograf ├── .helmignore ├── Chart.yaml ├── README.md ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── deployment.yaml │ ├── ingress.yaml │ ├── pvc.yaml │ ├── secret.yaml │ └── service.yaml └── values.yaml ├── create.sh ├── destroy.sh ├── influxdb ├── .helmignore ├── Chart.yaml ├── README.md ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── config.yaml │ ├── deployment.yaml │ ├── pvc.yaml │ └── service.yaml └── values.yaml ├── kapacitor ├── .helmignore ├── Chart.yaml ├── README.md ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── config.yaml │ ├── deployment.yaml │ ├── pvc.yaml │ └── service.yaml └── values.yaml ├── repo-sync.sh ├── telegraf-ds ├── .helmignore ├── Chart.yaml ├── README.md ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── configmap.yaml │ └── daemonset.yaml └── values.yaml └── telegraf-s ├── .helmignore ├── Chart.yaml ├── README.md ├── templates ├── NOTES.txt ├── _helpers.tpl ├── configmap.yaml ├── deployment.yaml └── service.yaml └── values.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | *.tgz 2 | repository 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `tick-charts` 2 | 3 | ## Deprecation Warning 4 | 5 | This repository is **no longer maintained**. We encourage everyone to use the charts provided in the [stable](https://github.com/influxdata/helm-charts) Helm repository. 6 | 7 | --- 8 | 9 | This is a collection of [Helm](https://github.com/kubernetes/helm) [Charts](https://github.com/kubernetes/charts) for the [InfluxData](https://influxdata.com/time-series-platform) TICK stack. This repo contains the following charts: 10 | 11 | - [influxdb](/influxdb/README.md) 12 | - [chronograf](/chronograf/README.md) 13 | - [kapacitor](/kapacitor/README.md) 14 | - [telegraf-s](/telegraf-s/README.md) 15 | - [telegraf-ds](/telegraf-ds/README.md) 16 | 17 | ### Deploy the whole stack! 18 | 19 | - Have your `kubectl` tool configured for the cluster where you would like to deploy the stack. 20 | - Have `helm` and `tiller` installed and configured 21 | - Download and configure the `helm` cli 22 | * [link](https://github.com/kubernetes/helm/blob/master/docs/install.md) 23 | - Run `helm init` to install `tiller` in your cluster 24 | * [link](https://github.com/kubernetes/helm/blob/master/docs/install.md#installing-tiller) 25 | - Install the charts: 26 | ```bash 27 | $ cd tick-charts 28 | $ helm install --name data --namespace tick ./influxdb/ 29 | $ helm install --name polling --namespace tick ./telegraf-s/ 30 | $ helm install --name hosts --namespace tick ./telegraf-ds/ 31 | $ helm install --name alerts --namespace tick ./kapacitor/ 32 | $ helm install --name dash --namespace tick ./chronograf/ 33 | ``` 34 | - Wait for the IP for chronograf to appear: 35 | ```bash 36 | $ kubectl get svc -w --namespace tick -l app=dash-chronograf 37 | ``` 38 | - Open chronograf in your browser and configure it 39 | - InfluxDB URL: `http://data-influxdb.tick:8086` 40 | - Kapacitor URL: `http://alerts-kapacitor.tick:9092` 41 | 42 | Or, just run `./create.sh` and let the shell script do it for you! You can also tear down the installation with `./destroy.sh` 43 | 44 | ### Usage 45 | 46 | To package any of the charts for deployment: 47 | 48 | ```bash 49 | $ helm package /path/to/chart 50 | ``` 51 | 52 | This will create a file named `{{ .Chart.Name }}-{{ .Chart.Version }}.tgz` that is the chart file to be deployed. The default configurations are listed in the `values.yaml` file in the root of each repo. To deploy the chart with some default values create your custom `values.yaml` file to change the default configuration or modify the `values.yaml` file at the root of the chart before packaging it: 53 | 54 | ```bash 55 | $ helm install telegraf-0.1.0.tgz --name {{ .Release.Name }} --namespace {{ .Release.Namespace }} --values /path/to/my_values.yaml 56 | ``` 57 | 58 | #### Using InfluxData's Helm repo 59 | 60 | All the charts are also available in InfluxData's Helm repository. You can use it as so: 61 | 62 | ``` 63 | $ helm repo add influx http://influx-charts.storage.googleapis.com 64 | $ helm install influx/telegraf-ds 65 | ``` 66 | 67 | ### Contributing 68 | 69 | If you are interested in contributing to this effort, we ask that you review and sign the [Contributor License Agreement](https://www.influxdata.com/legal/). 70 | There is an individual and corporate level agreement. Please review which is right based on your situation. 71 | -------------------------------------------------------------------------------- /chronograf/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /chronograf/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: chronograf 2 | version: 1.7.11 3 | description: Chart for Chronograf 4 | keywords: 5 | - chronograf 6 | - visualizaion 7 | - timeseries 8 | home: https://www.influxdata.com/time-series-platform/chronograf/ 9 | maintainers: 10 | - name: 11 | - email: 12 | engine: gotpl 13 | -------------------------------------------------------------------------------- /chronograf/README.md: -------------------------------------------------------------------------------- 1 | # Chronograf 2 | 3 | ## An Open-Source Time Series Visualization Tool 4 | 5 | [Chronograf](https://github.com/influxdata/chronograf) is an open-source web application built by the folks over at [InfluxData](https://influxdata.com) and written in Go and React.js that provides the tools to visualize your monitoring data and easily create alerting and automation rules. 6 | 7 | ## QuickStart 8 | 9 | ```bash 10 | $ helm install stable/chronograf --name foo --namespace bar 11 | ``` 12 | 13 | ## Introduction 14 | 15 | This chart bootstraps a Chronograf deployment and service on a Kubernetes cluster using the Helm Package manager. 16 | 17 | ## Prerequisites 18 | 19 | - Kubernetes 1.4+ 20 | - PV provisioner support in the underlying infrastructure (optional) 21 | 22 | ## Installing the Chart 23 | 24 | To install the chart with the release name `my-release`: 25 | 26 | ```bash 27 | $ helm install --name my-release stable/chronograf 28 | ``` 29 | 30 | The command deploys Chronograf on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. 31 | 32 | > **Tip**: List all releases using `helm list` 33 | 34 | ## Uninstalling the Chart 35 | 36 | To uninstall/delete the `my-release` deployment: 37 | 38 | ```bash 39 | $ helm delete my-release --purge 40 | ``` 41 | 42 | The command removes all the Kubernetes components associated with the chart and deletes the release. 43 | 44 | ## Configuration 45 | 46 | The configurable parameters of the Chronograf chart and 47 | their descriptions can be seen in `values.yaml`. The [full image documentation](https://quay.io/influxdb/chronograf) contains more information about running Chronograf in docker. 48 | 49 | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, 50 | 51 | ```bash 52 | $ helm install --name my-release \ 53 | --set ingress.enabled=true,ingress.hostname=chronograf.foobar.com \ 54 | stable/chronograf 55 | ``` 56 | 57 | The above command enables persistence and changes the size of the requested data volume to 200GB. 58 | 59 | Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, 60 | 61 | ```bash 62 | $ helm install --name my-release -f values.yaml stable/chronograf 63 | ``` 64 | 65 | > **Tip**: You can use the default [values.yaml](values.yaml) 66 | 67 | ## Persistence 68 | 69 | The [Chronograf](https://quay.io/influxdb/chronograf) image stores data in the `/var/lib/chronograf` directory in the container. 70 | 71 | The chart optionally mounts a [Persistent Volume](kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. 72 | 73 | ## OAuth Using Kubernetes Secret 74 | 75 | OAuth, among other things, can be configured in Chronograf using environment variables. For more information please see https://docs.influxdata.com/chronograf/latest/administration/managing-security 76 | 77 | Taking Google as an example, to use an existing Kubernetes Secret that contains sensitive information (`GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`), e.g.: 78 | 79 | ``` 80 | apiVersion: v1 81 | kind: Secret 82 | metadata: 83 | name: chronograf-google-env-secrets 84 | namespace: tick 85 | type: Opaque 86 | data: 87 | GOOGLE_CLIENT_ID: 88 | GOOGLE_CLIENT_SECRET: 89 | ``` 90 | 91 | in conjunction with less sensitive information such as `GOOGLE_DOMAINS` and `PUBLIC_URL`, one can make use of the chart's `envFromSecret` and `env` values, e.g. a values file can have the following: 92 | 93 | ``` 94 | [...] 95 | env: 96 | GOOGLE_DOMAINS: "yourdomain.com" 97 | PUBLIC_URL: "https://chronograf.yourdomain.com" 98 | envFromSecret: chronograf-google-env-secrets 99 | [...] 100 | ``` 101 | -------------------------------------------------------------------------------- /chronograf/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Chronograf can be accessed via port 80 on the following DNS name from within your cluster: 2 | 3 | - http://{{ template "fullname" . }}.{{ .Release.Namespace }} 4 | 5 | You can easily connect to the remote instance from your browser. Forward the webserver port to localhost:8888 6 | 7 | - kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8888 8 | 9 | You can also connect to the container running Chronograf. To open a shell session in the pod run the following: 10 | 11 | - kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh 12 | 13 | To trail the logs for the Chronograf pod run the following: 14 | 15 | - kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 16 | 17 | {{- if eq .Values.service.type "LoadBalancer" }} 18 | 19 | To watch for the LoadBalancer IP run the following 20 | 21 | - kubectl get svc -w --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} 22 | {{- end }} 23 | {{- if .Values.ingress.enabled }} 24 | 25 | Chronograf will be available at the URL: 26 | 27 | - http://{{ .Values.ingress.hostname }} 28 | {{- end -}} -------------------------------------------------------------------------------- /chronograf/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | -------------------------------------------------------------------------------- /chronograf/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | spec: 11 | replicas: {{ .Values.service.replicas }} 12 | template: 13 | metadata: 14 | labels: 15 | app: {{ template "fullname" . }} 16 | annotations: 17 | # Include a hash of the secret in the pod template 18 | # This means that if the secret changes, the deployment will be rolled 19 | checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }} 20 | spec: 21 | containers: 22 | - name: {{ .Chart.Name }} 23 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 24 | imagePullPolicy: {{ .Values.image.pullPolicy }} 25 | env: 26 | {{- range $key, $value := .Values.env }} 27 | - name: "{{ $key }}" 28 | value: "{{ $value }}" 29 | {{- end }} 30 | {{- if .Values.oauth.enabled }} 31 | - name: TOKEN_SECRET 32 | valueFrom: 33 | secretKeyRef: 34 | name: {{ template "fullname" . }} 35 | key: token_secret 36 | {{- if .Values.oauth.github.enabled}} 37 | - name: GH_CLIENT_ID 38 | valueFrom: 39 | secretKeyRef: 40 | name: {{ template "fullname" . }} 41 | key: gh_client_id 42 | - name: GH_CLIENT_SECRET 43 | valueFrom: 44 | secretKeyRef: 45 | name: {{ template "fullname" . }} 46 | key: gh_client_secret 47 | - name: GH_ORGS 48 | valueFrom: 49 | secretKeyRef: 50 | name: {{ template "fullname" . }} 51 | key: gh_orgs 52 | {{- end }} 53 | {{- if .Values.oauth.heroku.enabled}} 54 | - name: HEROKU_CLIENT_ID 55 | valueFrom: 56 | secretKeyRef: 57 | name: {{ template "fullname" . }} 58 | key: he_client_id 59 | - name: HEROKU_CLIENT_SECRET 60 | valueFrom: 61 | secretKeyRef: 62 | name: {{ template "fullname" . }} 63 | key: he_client_secret 64 | - name: HEROKU_ORGS 65 | valueFrom: 66 | secretKeyRef: 67 | name: {{ template "fullname" . }} 68 | key: he_orgs 69 | {{- end }} 70 | {{- if .Values.oauth.google.enabled}} 71 | - name: GOOGLE_CLIENT_ID 72 | valueFrom: 73 | secretKeyRef: 74 | name: {{ template "fullname" . }} 75 | key: go_client_id 76 | - name: GOOGLE_CLIENT_SECRET 77 | valueFrom: 78 | secretKeyRef: 79 | name: {{ template "fullname" . }} 80 | key: go_client_secret 81 | - name: GOOGLE_DOMAINS 82 | valueFrom: 83 | secretKeyRef: 84 | name: {{ template "fullname" . }} 85 | key: go_domains 86 | - name: PUBLIC_URL 87 | valueFrom: 88 | secretKeyRef: 89 | name: {{ template "fullname" . }} 90 | key: go_public_url 91 | {{- end }} 92 | {{- end }} 93 | {{- if .Values.envFromSecret }} 94 | envFrom: 95 | - secretRef: 96 | name: {{ .Values.envFromSecret }} 97 | {{- end }} 98 | ports: 99 | - containerPort: 8888 100 | name: api 101 | livenessProbe: 102 | httpGet: 103 | path: /ping 104 | port: api 105 | readinessProbe: 106 | httpGet: 107 | path: /ping 108 | port: api 109 | volumeMounts: 110 | - name: data 111 | mountPath: /var/lib/chronograf 112 | resources: 113 | {{- if .Values.priorityClassName }} 114 | priorityClassName: {{ .Values.priorityClassName }} 115 | {{- end }} 116 | {{ toYaml .Values.resources | indent 10 }} 117 | {{- with .Values.nodeSelector }} 118 | nodeSelector: 119 | {{ toYaml . | indent 8 }} 120 | {{- end }} 121 | {{- with .Values.affinity }} 122 | affinity: 123 | {{ toYaml . | indent 8 }} 124 | {{- end }} 125 | {{- with .Values.tolerations }} 126 | tolerations: 127 | {{ toYaml . | indent 8 }} 128 | {{- end }} 129 | volumes: 130 | - name: data 131 | {{- if .Values.persistence.enabled }} 132 | persistentVolumeClaim: 133 | claimName: {{ template "fullname" . }} 134 | {{ else }} 135 | emptyDir: {} 136 | {{ end }} 137 | -------------------------------------------------------------------------------- /chronograf/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled -}} 2 | apiVersion: extensions/v1beta1 3 | kind: Ingress 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | annotations: 12 | {{ toYaml .Values.ingress.annotations | indent 4 }} 13 | spec: 14 | {{- if .Values.ingress.tls }} 15 | tls: 16 | - hosts: 17 | - {{ .Values.ingress.hostname | quote }} 18 | secretName: {{ .Values.ingress.secretName | default (printf "%s-tls" (include "fullname" .)) }} 19 | {{- end }} 20 | rules: 21 | - host: {{ .Values.ingress.hostname }} 22 | http: 23 | paths: 24 | - path: / 25 | backend: 26 | serviceName: {{ template "fullname" . }} 27 | servicePort: 80 28 | {{- end -}} -------------------------------------------------------------------------------- /chronograf/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.persistence.enabled -}} 2 | apiVersion: v1 3 | kind: PersistentVolumeClaim 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | annotations: 12 | {{- if .Values.persistence.storageClass }} 13 | volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} 14 | {{- else }} 15 | volume.alpha.kubernetes.io/storage-class: default 16 | {{- end }} 17 | spec: 18 | accessModes: 19 | - {{ .Values.persistence.accessMode | quote }} 20 | resources: 21 | requests: 22 | storage: {{ .Values.persistence.size | quote }} 23 | {{- end }} 24 | -------------------------------------------------------------------------------- /chronograf/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.oauth.enabled }} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | type: Opaque 7 | data: 8 | token_secret: {{ .Values.oauth.token_secret | b64enc | quote }} 9 | {{- if .Values.oauth.github.enabled }} 10 | gh_client_id: {{ .Values.oauth.github.client_id | b64enc | quote }} 11 | gh_client_secret: {{ .Values.oauth.github.client_secret | b64enc | quote }} 12 | gh_orgs: {{ .Values.oauth.github.gh_orgs | b64enc | quote }} 13 | {{- end }} 14 | {{- if .Values.oauth.google.enabled }} 15 | go_client_id: {{ .Values.oauth.google.client_id | b64enc | quote }} 16 | go_client_secret: {{ .Values.oauth.google.client_secret | b64enc | quote }} 17 | go_domains: {{ .Values.oauth.google.domains | b64enc | quote }} 18 | go_public_url: {{ .Values.oauth.google.public_url | b64enc | quote }} 19 | {{- end }} 20 | {{- if .Values.oauth.heroku.enabled }} 21 | he_client_id: {{ .Values.oauth.heroku.client_id | b64enc | quote }} 22 | he_client_secret: {{ .Values.oauth.heroku.client_secret | b64enc | quote }} 23 | he_orgs: {{ .Values.oauth.heroku.heroku_orgs | b64enc | quote }} 24 | {{- end }} 25 | {{- end }} -------------------------------------------------------------------------------- /chronograf/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | - port: 80 14 | targetPort: 8888 15 | selector: 16 | app: {{ template "fullname" . }} 17 | -------------------------------------------------------------------------------- /chronograf/values.yaml: -------------------------------------------------------------------------------- 1 | ## Image Settings 2 | ## 3 | ## ref: https://hub.docker.com/r/library/chronograf/tags/ 4 | image: 5 | repository: "chronograf" 6 | tag: "1.7.11-alpine" 7 | pullPolicy: IfNotPresent 8 | 9 | ## Specify a service type 10 | ## ClusterIP is default 11 | ## ref: http://kubernetes.io/docs/user-guide/services/ 12 | ## 13 | service: 14 | replicas: 1 15 | type: ClusterIP 16 | 17 | ## Persist data to a persitent volume 18 | ## 19 | persistence: 20 | enabled: false 21 | ## If defined, volume.beta.kubernetes.io/storage-class: 22 | ## Default: volume.alpha.kubernetes.io/storage-class: default 23 | ## 24 | # storageClass: 25 | accessMode: ReadWriteOnce 26 | size: 8Gi 27 | 28 | ## Configure resource requests and limits 29 | ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ 30 | ## 31 | resources: 32 | requests: 33 | memory: 256Mi 34 | cpu: 0.1 35 | limits: 36 | memory: 2Gi 37 | cpu: 2 38 | 39 | ## Pod priority 40 | ## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ 41 | # priorityClassName: "" 42 | 43 | ## Node labels for pod assignment 44 | ## ref: https://kubernetes.io/docs/user-guide/node-selection/ 45 | # 46 | nodeSelector: {} 47 | 48 | ## Tolerations for pod assignment 49 | ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ 50 | ## 51 | tolerations: [] 52 | 53 | ## Affinity for pod assignment 54 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity 55 | ## 56 | affinity: {} 57 | 58 | ## Configure the ingress object to hook into existing infastructure 59 | ## ref : http://kubernetes.io/docs/user-guide/ingress/ 60 | ## OPTIONALLY you can set .Values.ingress.secretName to set which secret to use 61 | ## 62 | ingress: 63 | enabled: false 64 | tls: false 65 | hostname: chronograf.foobar.com 66 | annotations: 67 | # kubernetes.io/ingress.class: "nginx" 68 | # secretName: my-tls-cert 69 | # kubernetes.io/tls-acme: "true" 70 | 71 | ## OAuth Settings for OAuth Providers 72 | ## More information -> https://docs.influxdata.com/chronograf/v1.7/administration/managing-security/ 73 | ## 74 | oauth: 75 | # Need to set to true to use any of the oauth options 76 | enabled: false 77 | # Used for JWT to support running multiple copies of Chronograf 78 | token_secret: CHANGE_ME 79 | github: 80 | enabled: false 81 | client_id: CHANGE_ME 82 | client_secret: CHANGE_ME 83 | # This is a comma seperated list of GH organizations (OPTIONAL) 84 | gh_orgs: "" 85 | google: 86 | enabled: false 87 | client_id: CHANGE_ME 88 | client_secret: CHANGE_ME 89 | public_url: "" # eg. http://chronograf.foobar.com 90 | # This is a comma seperated list of Google Apps domains (OPTIONAL) 91 | google_domains: "" 92 | heroku: 93 | enabled: false 94 | client_id: CHANGE_ME 95 | client_secret: CHANGE_ME 96 | # This is a comma seperated list of Heroku organizations (OPTIONAL) 97 | he_orgs: "" 98 | 99 | ## Extra environment variables that will be passed onto deployment pods 100 | env: {} 101 | 102 | ## The name of a secret in the same kubernetes namespace which contain values to be added to the environment 103 | ## This can be useful for auth tokens, etc 104 | envFromSecret: "" 105 | -------------------------------------------------------------------------------- /create.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | helm install --name data --namespace tick ./influxdb/ 4 | helm install --name polling --namespace tick ./telegraf-s/ 5 | helm install --name hosts --namespace tick ./telegraf-ds/ 6 | helm install --name alerts --namespace tick ./kapacitor/ 7 | helm install --name dash --namespace tick ./chronograf/ 8 | kubectl get svc -w --namespace tick -l app=dash-chronograf 9 | -------------------------------------------------------------------------------- /destroy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | helm delete data polling hosts alerts dash --purge 4 | kubectl delete ns tick -------------------------------------------------------------------------------- /influxdb/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /influxdb/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: influxdb 2 | version: 1.7.6 3 | description: Scalable datastore for metrics, events, and real-time analytics. 4 | keywords: 5 | - influxdb 6 | - database 7 | - timeseries 8 | home: https://www.influxdata.com/time-series-platform/influxdb/ 9 | sources: 10 | - https://github.com/influxdata/influxdb 11 | maintainers: 12 | - name: 13 | email: 14 | engine: gotpl 15 | -------------------------------------------------------------------------------- /influxdb/README.md: -------------------------------------------------------------------------------- 1 | # InfluxDB 2 | 3 | ## An Open-Source Time Series Database 4 | 5 | [InfluxDB](https://github.com/influxdata/influxdb) is an open source time series database built by the folks over at [InfluxData](https://influxdata.com) with no external dependencies. It's useful for recording metrics, events, and performing analytics. 6 | 7 | ## QuickStart 8 | 9 | ```bash 10 | $ helm install stable/influxdb --name foo --namespace bar 11 | ``` 12 | 13 | ## Introduction 14 | 15 | This chart bootstraps an InfluxDB deployment and service on a Kubernetes cluster using the Helm Package manager. 16 | 17 | ## Prerequisites 18 | 19 | - Kubernetes 1.4+ 20 | - PV provisioner support in the underlying infrastructure (optional) 21 | 22 | ## Installing the Chart 23 | 24 | To install the chart with the release name `my-release`: 25 | 26 | ```bash 27 | $ helm install --name my-release stable/influxdb 28 | ``` 29 | 30 | The command deploys InfluxDB on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. 31 | 32 | > **Tip**: List all releases using `helm list` 33 | 34 | ## Uninstalling the Chart 35 | 36 | To uninstall/delete the `my-release` deployment: 37 | 38 | ```bash 39 | $ helm delete my-release --purge 40 | ``` 41 | 42 | The command removes all the Kubernetes components associated with the chart and deletes the release. 43 | 44 | ## Configuration 45 | 46 | The default configuration values for this chart are listed in `values.yaml`. 47 | 48 | The [full image documentation](https://hub.docker.com/_/influxdb/) contains more information about running InfluxDB in docker. 49 | 50 | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, 51 | 52 | ```bash 53 | $ helm install --name my-release \ 54 | --set persistence.enabled=true,persistence.size=200Gi \ 55 | stable/influxdb 56 | ``` 57 | 58 | The above command enables persistence and changes the size of the requested data volume to 200GB. 59 | 60 | Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, 61 | 62 | ```bash 63 | $ helm install --name my-release -f values.yaml stable/influxdb 64 | ``` 65 | 66 | > **Tip**: You can use the default [values.yaml](values.yaml) 67 | 68 | ## Persistence 69 | 70 | The [InfluxDB](https://hub.docker.com/_/influxdb/) image stores data in the `/var/lib/influxdb` directory in the container. 71 | 72 | The chart mounts a [Persistent Volume](kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. 73 | -------------------------------------------------------------------------------- /influxdb/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | InfluxDB can be accessed via port {{ .Values.config.http.bind_address }} on the following DNS name from within your cluster: 2 | 3 | - http://{{ template "fullname" . }}.{{ .Release.Namespace }}:{{ .Values.config.http.bind_address }} 4 | 5 | You can easily connect to the remote instance with your local influx cli. To forward the API port to localhost:8086 run the following: 6 | 7 | - kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8086:{{ .Values.config.http.bind_address }} 8 | 9 | You can also connect to the influx cli from inside the container. To open a shell session in the InfluxDB pod run the following: 10 | 11 | - kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh 12 | 13 | To tail the logs for the InfluxDB pod run the following: 14 | 15 | - kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 16 | -------------------------------------------------------------------------------- /influxdb/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | -------------------------------------------------------------------------------- /influxdb/templates/config.yaml: -------------------------------------------------------------------------------- 1 | 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | data: 12 | influxdb.conf: |+ 13 | reporting-disabled = {{ .Values.config.reporting_disabled | default false }} 14 | bind-address = ":{{ .Values.config.rpc.bind_address }}" 15 | 16 | [meta] 17 | dir = "{{ .Values.config.storage_directory }}/meta" 18 | retention-autocreate = {{ .Values.config.meta.retention_autocreate }} 19 | logging-enabled = {{ .Values.config.meta.logging_enabled }} 20 | 21 | [data] 22 | dir = "{{ .Values.config.storage_directory }}/data" 23 | wal-dir = "{{ .Values.config.storage_directory }}/wal" 24 | query-log-enabled = {{ .Values.config.data.query_log_enabled }} 25 | cache-max-memory-size = {{ .Values.config.data.cache_max_memory_size | int64 }} 26 | cache-snapshot-memory-size = {{ .Values.config.data.cache_snapshot_memory_size | int64 }} 27 | cache-snapshot-write-cold-duration = "{{ .Values.config.data.cache_snapshot_write_cold_duration }}" 28 | compact-full-write-cold-duration = "{{ .Values.config.data.compact_full_write_cold_duration }}" 29 | max-series-per-database = {{ .Values.config.data.max_series_per_database | int64 }} 30 | max-values-per-tag = {{ .Values.config.data.max_values_per_tag | int64 }} 31 | trace-logging-enabled = {{ .Values.config.data.trace_logging_enabled }} 32 | compact-throughput = {{ .Values.config.data.compact_throughput | int64 }} 33 | compact-throughput-burst = {{ .Values.config.data.compact_throughput_burst | int64 }} 34 | 35 | [coordinator] 36 | write-timeout = "{{ .Values.config.coordinator.write_timeout }}" 37 | max-concurrent-queries = {{ .Values.config.coordinator.max_concurrent_queries | int64 }} 38 | query-timeout = "{{ .Values.config.coordinator.query_timeout }}" 39 | log-queries-after = "{{ .Values.config.coordinator.log_queries_after }}" 40 | max-select-point = {{ .Values.config.coordinator.max_select_point | int64 }} 41 | max-select-series = {{ .Values.config.coordinator.max_select_series | int64 }} 42 | max-select-buckets = {{ .Values.config.coordinator.max_select_buckets | int64 }} 43 | 44 | [retention] 45 | enabled = {{ .Values.config.retention.enabled }} 46 | check-interval = "{{ .Values.config.retention.check_interval }}" 47 | 48 | [shard-precreation] 49 | enabled = {{ .Values.config.shard_precreation.enabled }} 50 | check-interval = "{{ .Values.config.shard_precreation.check_interval }}" 51 | advance-period = "{{ .Values.config.shard_precreation.advance_period }}" 52 | 53 | [monitor] 54 | store-enabled = {{ .Values.config.monitor.store_enabled }} 55 | store-database = "{{ .Values.config.monitor.store_database }}" 56 | store-interval = "{{ .Values.config.monitor.store_interval }}" 57 | 58 | [subscriber] 59 | enabled = {{ .Values.config.subscriber.enabled }} 60 | http-timeout = "{{ .Values.config.subscriber.http_timeout }}" 61 | insecure-skip-verify = {{ .Values.config.subscriber.insecure_skip_verify }} 62 | ca-certs = "{{ .Values.config.subscriber.ca_certs }}" 63 | write-concurrency = {{ .Values.config.subscriber.write_concurrency | int64 }} 64 | write-buffer-size = {{ .Values.config.subscriber.write_buffer_size | int64 }} 65 | 66 | [http] 67 | enabled = {{ .Values.config.http.enabled }} 68 | bind-address = ":{{ .Values.config.http.bind_address }}" 69 | auth-enabled = {{ .Values.config.http.auth_enabled }} 70 | log-enabled = {{ .Values.config.http.log_enabled }} 71 | write-tracing = {{ .Values.config.http.write_tracing }} 72 | pprof-enabled = {{ .Values.config.http.pprof_enabled }} 73 | https-enabled = {{ .Values.config.http.https_enabled }} 74 | https-certificate = "{{ .Values.config.http.https_certificate }}" 75 | https-private-key = "{{ .Values.config.http.https_private_key }}" 76 | max-row-limit = {{ .Values.config.http.max_row_limit | int64 }} 77 | max-connection-limit = {{ .Values.config.http.max_connection_limit | int64 }} 78 | shared-secret = "{{ .Values.config.http.shared_secret }}" 79 | realm = "{{ .Values.config.http.realm }}" 80 | unix-socket-enabled = {{ .Values.config.http.unix_socket_enabled }} 81 | bind-socket = "{{ .Values.config.http.bind_socket }}" 82 | flux-enabled = {{ .Values.config.http.flux_enabled }} 83 | 84 | # TODO: allow multiple graphite listeners with templates 85 | 86 | [[graphite]] 87 | enabled = {{ .Values.config.graphite.enabled }} 88 | bind-address = ":{{ .Values.config.graphite.bind_address }}" 89 | database = "{{ .Values.config.graphite.database }}" 90 | retention-policy = "{{ .Values.config.graphite.retention_policy }}" 91 | protocol = "{{ .Values.config.graphite.protocol }}" 92 | batch-size = {{ .Values.config.graphite.batch_size | int64 }} 93 | batch-pending = {{ .Values.config.graphite.batch_pending | int64 }} 94 | batch-timeout = "{{ .Values.config.graphite.batch_timeout }}" 95 | consistency-level = "{{ .Values.config.graphite.consistency_level }}" 96 | separator = "{{ .Values.config.graphite.separator }}" 97 | udp-read-buffer = {{ .Values.config.graphite.udp_read_buffer | int64 }} 98 | 99 | # TODO: allow multiple collectd listeners with templates 100 | 101 | [[collectd]] 102 | enabled = {{ .Values.config.collectd.enabled }} 103 | bind-address = ":{{ .Values.config.collectd.bind_address }}" 104 | database = "{{ .Values.config.collectd.database }}" 105 | retention-policy = "{{ .Values.config.collectd.retention_policy }}" 106 | batch-size = {{ .Values.config.collectd.batch_size | int64 }} 107 | batch-pending = {{ .Values.config.collectd.batch_pending | int64 }} 108 | batch-timeout = "{{ .Values.config.collectd.batch_timeout }}" 109 | read-buffer = {{ .Values.config.collectd.read_buffer | int64 }} 110 | typesdb = "{{ .Values.config.collectd.typesdb }}" 111 | security-level = "{{ .Values.config.collectd.security_level }}" 112 | auth-file = "{{ .Values.config.collectd.auth_file }}" 113 | 114 | # TODO: allow multiple opentsdb listeners with templates 115 | 116 | [[opentsdb]] 117 | enabled = {{ .Values.config.opentsdb.enabled }} 118 | bind-address = ":{{ .Values.config.opentsdb.bind_address }}" 119 | database = "{{ .Values.config.opentsdb.database }}" 120 | retention-policy = "{{ .Values.config.opentsdb.retention_policy }}" 121 | consistency-level = "{{ .Values.config.opentsdb.consistency_level }}" 122 | tls-enabled = {{ .Values.config.opentsdb.tls_enabled }} 123 | certificate = "{{ .Values.config.opentsdb.certificate }}" 124 | batch-size = {{ .Values.config.opentsdb.batch_size | int64 }} 125 | batch-pending = {{ .Values.config.opentsdb.batch_pending | int64 }} 126 | batch-timeout = "{{ .Values.config.opentsdb.batch_timeout }}" 127 | log-point-errors = {{ .Values.config.opentsdb.log_point_errors }} 128 | 129 | # TODO: allow multiple udp listeners with templates 130 | 131 | [[udp]] 132 | enabled = {{ .Values.config.udp.enabled }} 133 | bind-address = ":{{ .Values.config.udp.bind_address }}" 134 | database = "{{ .Values.config.udp.database }}" 135 | retention-policy = "{{ .Values.config.udp.retention_policy }}" 136 | batch-size = {{ .Values.config.udp.batch_size | int64 }} 137 | batch-pending = {{ .Values.config.udp.batch_pending | int64 }} 138 | read-buffer = {{ .Values.config.udp.read_buffer | int64 }} 139 | batch-timeout = "{{ .Values.config.udp.batch_timeout }}" 140 | precision = "{{ .Values.config.udp.precision }}" 141 | 142 | [continuous_queries] 143 | log-enabled = {{ .Values.config.continuous_queries.log_enabled }} 144 | enabled = {{ .Values.config.continuous_queries.enabled }} 145 | run-interval = "{{ .Values.config.continuous_queries.run_interval }}" 146 | 147 | 148 | -------------------------------------------------------------------------------- /influxdb/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | spec: 11 | replicas: 1 12 | template: 13 | metadata: 14 | labels: 15 | app: {{ template "fullname" . }} 16 | annotations: 17 | # Include a hash of the config in the pod template 18 | # This means that if the config changes, the deployment will be rolled 19 | checksum/config: {{ include (print .Template.BasePath "/config.yaml") . | sha256sum }} 20 | spec: 21 | containers: 22 | - name: {{ template "fullname" . }} 23 | image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" 24 | imagePullPolicy: {{ .Values.image.pullPolicy | quote }} 25 | resources: 26 | {{ toYaml .Values.resources | indent 10 }} 27 | ports: 28 | - name: api 29 | containerPort: {{ .Values.config.http.bind_address }} 30 | {{- if .Values.config.graphite.enabled }} 31 | - name: graphite 32 | containerPort: {{ .Values.config.graphite.bind_address }} 33 | {{- end }} 34 | {{- if .Values.config.collectd.enabled }} 35 | - name: collectd 36 | containerPort: {{ .Values.config.collectd.bind_address }} 37 | {{- end }} 38 | {{- if .Values.config.udp.enabled }} 39 | - name: udp 40 | containerPort: {{ .Values.config.udp.bind_address }} 41 | {{- end }} 42 | {{- if .Values.config.opentsdb.enabled }} 43 | - name: opentsdb 44 | containerPort: {{ .Values.config.opentsdb.bind_address }} 45 | {{- end }} 46 | livenessProbe: 47 | httpGet: 48 | path: /ping 49 | port: api 50 | initialDelaySeconds: 30 51 | timeoutSeconds: 5 52 | readinessProbe: 53 | httpGet: 54 | path: /ping 55 | port: api 56 | initialDelaySeconds: 5 57 | timeoutSeconds: 1 58 | volumeMounts: 59 | - name: data 60 | mountPath: {{ .Values.config.storage_directory }} 61 | - name: config 62 | mountPath: /etc/influxdb 63 | {{- if .Values.priorityClassName }} 64 | priorityClassName: {{ .Values.priorityClassName }} 65 | {{- end }} 66 | {{- with .Values.nodeSelector }} 67 | nodeSelector: 68 | {{ toYaml . | indent 8 }} 69 | {{- end }} 70 | {{- with .Values.affinity }} 71 | affinity: 72 | {{ toYaml . | indent 8 }} 73 | {{- end }} 74 | {{- with .Values.tolerations }} 75 | tolerations: 76 | {{ toYaml . | indent 8 }} 77 | {{- end }} 78 | volumes: 79 | - name: data 80 | {{- if .Values.persistence.enabled }} 81 | persistentVolumeClaim: 82 | claimName: {{ template "fullname" . }} 83 | {{- else }} 84 | emptyDir: {} 85 | {{- end }} 86 | - name: config 87 | configMap: 88 | name: {{ template "fullname" . }} 89 | -------------------------------------------------------------------------------- /influxdb/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.persistence.enabled }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | annotations: 12 | {{- if .Values.persistence.storageClass }} 13 | volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} 14 | {{- else }} 15 | volume.alpha.kubernetes.io/storage-class: default 16 | {{- end }} 17 | spec: 18 | accessModes: 19 | - {{ .Values.persistence.accessMode | quote }} 20 | resources: 21 | requests: 22 | storage: {{ .Values.persistence.size | quote }} 23 | {{- end }} 24 | -------------------------------------------------------------------------------- /influxdb/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- if .Values.config.http.enabled }} 14 | - name: api 15 | port: {{ .Values.config.http.bind_address }} 16 | targetPort: {{ .Values.config.http.bind_address }} 17 | {{- end }} 18 | {{- if .Values.config.graphite.enabled }} 19 | - name: graphite 20 | port: {{ .Values.config.graphite.bind_address }} 21 | targetPort: {{ .Values.config.graphite.bind_address }} 22 | {{- end }} 23 | {{- if .Values.config.collectd.enabled }} 24 | - name: collectd 25 | port: {{ .Values.config.collectd.bind_address }} 26 | targetPort: {{ .Values.config.collectd.bind_address }} 27 | {{- end }} 28 | {{- if .Values.config.udp.enabled }} 29 | - name: udp 30 | port: {{ .Values.config.udp.bind_address }} 31 | targetPort: {{ .Values.config.udp.bind_address }} 32 | {{- end }} 33 | {{- if .Values.config.opentsdb.enabled }} 34 | - name: opentsdb 35 | port: {{ .Values.config.opentsdb.bind_address }} 36 | targetPort: {{ .Values.config.opentsdb.bind_address }} 37 | {{- end }} 38 | {{- if .Values.config.rpc.enabled }} 39 | - name: rpc 40 | port: {{ .Values.config.rpc.bind_address }} 41 | targetPort: {{ .Values.config.rpc.bind_address }} 42 | {{- end }} 43 | selector: 44 | app: {{ template "fullname" . }} 45 | -------------------------------------------------------------------------------- /influxdb/values.yaml: -------------------------------------------------------------------------------- 1 | ## influxdb image version 2 | ## ref: https://hub.docker.com/r/library/influxdb/tags/ 3 | image: 4 | repo: "influxdb" 5 | tag: "1.7.6-alpine" 6 | pullPolicy: IfNotPresent 7 | 8 | ## Specify a service type 9 | ## NodePort is default 10 | ## ref: http://kubernetes.io/docs/user-guide/services/ 11 | ## 12 | service: 13 | type: ClusterIP 14 | 15 | ## Persist data to a persitent volume 16 | ## 17 | persistence: 18 | enabled: false 19 | ## If defined, volume.beta.kubernetes.io/storage-class: 20 | ## Default: volume.alpha.kubernetes.io/storage-class: default 21 | ## 22 | # storageClass: 23 | accessMode: ReadWriteOnce 24 | size: 8Gi 25 | 26 | ## Configure resource requests and limits 27 | ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ 28 | resources: 29 | requests: 30 | memory: 256Mi 31 | cpu: 0.1 32 | limits: 33 | memory: 16Gi 34 | cpu: 8 35 | 36 | ## Pod priority 37 | ## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ 38 | # priorityClassName: "" 39 | 40 | ## Node labels for pod assignment 41 | ## ref: https://kubernetes.io/docs/user-guide/node-selection/ 42 | # 43 | nodeSelector: {} 44 | 45 | ## Tolerations for pod assignment 46 | ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ 47 | ## 48 | tolerations: [] 49 | 50 | ## Affinity for pod assignment 51 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity 52 | ## 53 | affinity: {} 54 | 55 | ## Change InfluxDB configuration paramaters below: 56 | ## Defaults are indicated 57 | ## ref: https://docs.influxdata.com/influxdb/v1.7/administration/config/ 58 | config: 59 | reporting_disabled: false 60 | storage_directory: /var/lib/influxdb 61 | rpc: 62 | bind_address: 8088 63 | enabled: true 64 | meta: 65 | retention_autocreate: true 66 | logging_enabled: true 67 | data: 68 | query_log_enabled: true 69 | cache_max_memory_size: 1073741824 70 | cache_snapshot_memory_size: 26214400 71 | cache_snapshot_write_cold_duration: 10m0s 72 | compact_full_write_cold_duration: 4h0m0s 73 | max_series_per_database: 1000000 74 | max_values_per_tag: 100000 75 | trace_logging_enabled: false 76 | compact_throughput: 50331648 77 | compact_throughput_burst: 50331648 78 | coordinator: 79 | write_timeout: 10s 80 | max_concurrent_queries: 0 81 | query_timeout: 0s 82 | log_queries_after: 0s 83 | max_select_point: 0 84 | max_select_series: 0 85 | max_select_buckets: 0 86 | retention: 87 | enabled: true 88 | check_interval: 30m0s 89 | shard_precreation: 90 | enabled: true 91 | check_interval: 10m0s 92 | advance_period: 30m0s 93 | monitor: 94 | store_enabled: true 95 | store_database: _internal 96 | store_interval: 10s 97 | subscriber: 98 | enabled: true 99 | http_timeout: 30s 100 | insecure_skip_verify: false 101 | ca_certs: "" 102 | write_concurrency: 40 103 | write_buffer_size: 1000 104 | http: 105 | enabled: true 106 | bind_address: 8086 107 | auth_enabled: false 108 | log_enabled: true 109 | write_tracing: false 110 | pprof_enabled: true 111 | https_enabled: false 112 | https_certificate: /etc/ssl/influxdb.pem 113 | https_private_key: "" 114 | max_row_limit: 10000 115 | max_connection_limit: 0 116 | shared_secret: "beetlejuicebeetlejuicebeetlejuice" 117 | realm: InfluxDB 118 | unix_socket_enabled: false 119 | bind_socket: /var/run/influxdb.sock 120 | flux_enabled: true 121 | graphite: 122 | enabled: false 123 | bind_address: 2003 124 | database: graphite 125 | retention_policy: autogen 126 | protocol: tcp 127 | batch_size: 5000 128 | batch_pending: 10 129 | batch_timeout: 1s 130 | consistency_level: one 131 | separator: . 132 | udp_read_buffer: 0 133 | collectd: 134 | enabled: false 135 | bind_address: 25826 136 | database: collectd 137 | retention_policy: autogen 138 | batch_size: 5000 139 | batch_pending: 10 140 | batch_timeout: 10s 141 | read_buffer: 0 142 | typesdb: /usr/share/collectd/types.db 143 | security_level: none 144 | auth_file: /etc/collectd/auth_file 145 | opentsdb: 146 | enabled: false 147 | bind_address: 4242 148 | database: opentsdb 149 | retention_policy: autogen 150 | consistency_level: one 151 | tls_enabled: false 152 | certificate: /etc/ssl/influxdb.pem 153 | batch_size: 1000 154 | batch_pending: 5 155 | batch_timeout: 1s 156 | log_point_errors: true 157 | udp: 158 | enabled: false 159 | bind_address: 8089 160 | database: udp 161 | retention_policy: autogen 162 | batch_size: 5000 163 | batch_pending: 10 164 | read_buffer: 0 165 | batch_timeout: 1s 166 | precision: "ns" 167 | continuous_queries: 168 | log_enabled: true 169 | enabled: true 170 | run_interval: 1s 171 | 172 | -------------------------------------------------------------------------------- /kapacitor/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /kapacitor/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: kapacitor 2 | version: 1.5.2 3 | description: InfluxDB's co-processing processing engine. It can process both stream and batch data from InfluxDB. 4 | keywords: 5 | - kapacitor 6 | - stream 7 | - etl 8 | - timeseries 9 | home: https://www.influxdata.com/time-series-platform/kapacitor/ 10 | sources: 11 | - https://github.com/influxdata/kapacitor 12 | maintainers: 13 | - name: 14 | email: 15 | engine: gotpl 16 | -------------------------------------------------------------------------------- /kapacitor/README.md: -------------------------------------------------------------------------------- 1 | # Kapacitor 2 | 3 | ## An Open-Source Time Series ETL and Alerting Engine 4 | 5 | [Kapacitor](https://github.com/influxdata/kapacitor) is an open-source framework built by the folks over at [InfluxData](https://influxdata.com) and written in Go for processing, monitoring, and alerting on time series data 6 | 7 | ## QuickStart 8 | 9 | ```bash 10 | $ helm install stable/kapacitor --name foo --namespace bar 11 | ``` 12 | 13 | ## Introduction 14 | 15 | This chart bootstraps A Kapacitor deployment and service on a Kubernetes cluster using the Helm Package manager. 16 | 17 | ## Prerequisites 18 | 19 | - Kubernetes 1.4+ 20 | - PV provisioner support in the underlying infrastructure (optional) 21 | 22 | ## Installing the Chart 23 | 24 | To install the chart with the release name `my-release`: 25 | 26 | ```bash 27 | $ helm install --name my-release stable/kapacitor 28 | ``` 29 | 30 | The command deploys Kapacitor on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. 31 | 32 | > **Tip**: List all releases using `helm list` 33 | 34 | ## Uninstalling the Chart 35 | 36 | To uninstall/delete the `my-release` deployment: 37 | 38 | ```bash 39 | $ helm delete my-release --purge 40 | ``` 41 | 42 | The command removes all the Kubernetes components associated with the chart and deletes the release. 43 | 44 | ## Configuration 45 | 46 | The configurable parameters of the Kapacitor chart and the default values are listed in `values.yaml`. 47 | 48 | The [full image documentation](https://hub.docker.com/_/kapacitor/) contains more information about running Kapacitor in docker. 49 | 50 | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, 51 | 52 | ```bash 53 | $ helm install --name my-release \ 54 | --set influxURL=http://myinflux.mytld:8086,persistence.enabled=true \ 55 | stable/kapacitor 56 | ``` 57 | 58 | The above command enables persistence and changes the size of the requested data volume to 200GB. 59 | 60 | Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, 61 | 62 | ```bash 63 | $ helm install --name my-release -f values.yaml stable/kapacitor 64 | ``` 65 | 66 | > **Tip**: You can use the default [values.yaml](values.yaml) 67 | 68 | ## Persistence 69 | 70 | The [Kapacitor](https://hub.docker.com/_/kapacitor/) image stores data in the `/var/lib/kapacitor` directory in the container. 71 | 72 | The chart optionally mounts a [Persistent Volume](kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. -------------------------------------------------------------------------------- /kapacitor/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | {{- $bl := empty .Values.influxURL }} 2 | {{- if not $bl }} 3 | Kapacitor can be accessed via port 9092 on the following DNS name from within your cluster: 4 | 5 | - http://{{ template "fullname" . }}.{{ .Release.Namespace }}:9092 6 | 7 | You can easily connect to the remote instance from a local kapacitor cli. Forward the api port to localhost:9092 8 | 9 | - kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 9092:9092 10 | 11 | You can also connect to the container running Kapacitor. To open a shell session in the pod run the following: 12 | 13 | - kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh 14 | 15 | To tail the logs for the Kapacitor pod run the following: 16 | 17 | - kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 18 | 19 | {{- if eq .Values.service.type "LoadBalancer" }} 20 | 21 | To watch for the LoadBalancer IP or Hostname to populate run the following: 22 | 23 | - kubectl get svc -w --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} 24 | {{- end }} 25 | {{- end }} 26 | 27 | {{- if empty .Values.influxURL }} 28 | You have not set .Values.influxURL. Kapacitor needs an InfluxDB instance to create a subscription on. Please set that value to deploy kapacitor 29 | {{- end }} -------------------------------------------------------------------------------- /kapacitor/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 16 | {{- end -}} 17 | -------------------------------------------------------------------------------- /kapacitor/templates/config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | data: 11 | kapacitor.conf: |+ 12 | hostname = "{{ template "fullname" . }}.{{.Release.Namespace}}" 13 | data_dir = "/var/lib/kapacitor" 14 | skip-config-overrides = false 15 | default-retention-policy = "" 16 | [http] 17 | bind-address = ":9092" 18 | auth-enabled = false 19 | log-enabled = false 20 | write-tracing = false 21 | pprof-enabled = false 22 | https-enabled = false 23 | https-certificate = "/etc/ssl/kapacitor.pem" 24 | shutdown-timeout = "10s" 25 | shared-secret = "" 26 | [replay] 27 | dir = "/var/lib/kapacitor/replay" 28 | [storage] 29 | boltdb = "/var/lib/kapacitor/kapacitor.db" 30 | [task] 31 | dir = "/var/lib/kapacitor/tasks" 32 | snapshot-interval = "1m0s" 33 | [[influxdb]] 34 | enabled = true 35 | name = "default" 36 | default = false 37 | urls = [{{ .Values.influxURL | quote }}] 38 | username = "" 39 | password = "" 40 | ssl-ca = "" 41 | ssl-cert = "" 42 | ssl-key = "" 43 | insecure-skip-verify = false 44 | timeout = "0s" 45 | disable-subscriptions = false 46 | subscription-protocol = "http" 47 | kapacitor-hostname = "{{ template "fullname" . }}.{{.Release.Namespace}}" 48 | http-port = 0 49 | udp-bind = "" 50 | udp-buffer = 1000 51 | udp-read-buffer = 0 52 | startup-timeout = "5m0s" 53 | subscriptions-sync-interval = "1m0s" 54 | [influxdb.excluded-subscriptions] 55 | _kapacitor = ["autogen"] 56 | [logging] 57 | file = "STDERR" 58 | level = "INFO" 59 | [config-override] 60 | enabled = true 61 | [collectd] 62 | enabled = false 63 | bind-address = ":25826" 64 | database = "collectd" 65 | retention-policy = "" 66 | batch-size = 5000 67 | batch-pending = 10 68 | batch-timeout = "10s" 69 | read-buffer = 0 70 | typesdb = "/usr/share/collectd/types.db" 71 | [opentsdb] 72 | enabled = false 73 | bind-address = ":4242" 74 | database = "opentsdb" 75 | retention-policy = "" 76 | consistency-level = "one" 77 | tls-enabled = false 78 | certificate = "/etc/ssl/influxdb.pem" 79 | batch-size = 1000 80 | batch-pending = 5 81 | batch-timeout = "1s" 82 | log-point-errors = true 83 | [alerta] 84 | enabled = false 85 | url = "" 86 | insecure-skip-verify = false 87 | token = "" 88 | token-prefix = "" 89 | environment = "" 90 | origin = "" 91 | [hipchat] 92 | enabled = false 93 | url = "" 94 | token = "" 95 | room = "" 96 | global = false 97 | state-changes-only = false 98 | [opsgenie] 99 | enabled = false 100 | api-key = "" 101 | url = "https://api.opsgenie.com/v1/json/alert" 102 | recovery_url = "https://api.opsgenie.com/v1/json/alert/note" 103 | global = false 104 | [pagerduty] 105 | enabled = false 106 | url = "https://events.pagerduty.com/generic/2010-04-15/create_event.json" 107 | service-key = "" 108 | global = false 109 | [pushover] 110 | enabled = false 111 | token = "" 112 | user-key = "" 113 | url = "https://api.pushover.net/1/messages.json" 114 | [smtp] 115 | enabled = false 116 | host = "localhost" 117 | port = 25 118 | username = "" 119 | password = "" 120 | no-verify = false 121 | global = false 122 | state-changes-only = false 123 | from = "" 124 | idle-timeout = "30s" 125 | [snmptrap] 126 | enabled = false 127 | addr = "localhost:162" 128 | community = "kapacitor" 129 | retries = 1 130 | [sensu] 131 | enabled = false 132 | addr = "" 133 | source = "Kapacitor" 134 | [slack] 135 | enabled = false 136 | url = "" 137 | channel = "" 138 | username = "kapacitor" 139 | icon-emoji = "" 140 | global = false 141 | state-changes-only = false 142 | ssl-ca = "" 143 | ssl-cert = "" 144 | ssl-key = "" 145 | insecure-skip-verify = false 146 | [talk] 147 | enabled = false 148 | url = "" 149 | author_name = "" 150 | [telegram] 151 | enabled = false 152 | url = "https://api.telegram.org/bot" 153 | token = "" 154 | chat-id = "" 155 | parse-mode = "" 156 | disable-web-page-preview = false 157 | disable-notification = false 158 | global = false 159 | state-changes-only = false 160 | [victorops] 161 | enabled = false 162 | api-key = "" 163 | routing-key = "" 164 | url = "https://alert.victorops.com/integrations/generic/20131114/alert" 165 | global = false 166 | [reporting] 167 | enabled = true 168 | url = "https://usage.influxdata.com" 169 | [stats] 170 | enabled = true 171 | stats-interval = "10s" 172 | database = "_kapacitor" 173 | retention-policy = "autogen" 174 | timing-sample-rate = 0.1 175 | timing-movavg-size = 1000 176 | [udf] 177 | [deadman] 178 | interval = "10s" 179 | threshold = 0.0 180 | id = "{{ .Group }}" 181 | message = "{{ .ID }}" 182 | global = false 183 | [[kubernetes]] 184 | id = "kubernetes-pod" 185 | enabled = true 186 | in-cluster = true 187 | resource = "pod" 188 | [[kubernetes]] 189 | id = "kubernetes-node" 190 | enabled = true 191 | in-cluster = true 192 | resource = "node" 193 | [[kubernetes]] 194 | id = "kubernetes-service" 195 | enabled = true 196 | in-cluster = true 197 | resource = "service" 198 | [[kubernetes]] 199 | id = "kubernetes-endpoint" 200 | enabled = true 201 | in-cluster = true 202 | resource = "endpoint" 203 | [[scraper]] 204 | enabled = true 205 | name = "prometheus-node" 206 | discoverer-id = "kubernetes-node" 207 | discoverer-service = "kubernetes" 208 | db = "prometheus_raw" 209 | rp = "autogen" 210 | type = "prometheus" 211 | scheme = "http" 212 | metrics-path = "/metrics" 213 | scrape-interval = "10s" 214 | scrape-timeout = "10s" 215 | [[scraper]] 216 | enabled = true 217 | name = "prometheus-pod" 218 | discoverer-id = "kubernetes-pod" 219 | discoverer-service = "kubernetes" 220 | db = "prometheus_raw" 221 | rp = "autogen" 222 | type = "prometheus" 223 | scheme = "http" 224 | metrics-path = "/metrics" 225 | scrape-interval = "10s" 226 | scrape-timeout = "10s" 227 | [[scraper]] 228 | enabled = true 229 | name = "prometheus-service" 230 | discoverer-id = "kubernetes-service" 231 | discoverer-service = "kubernetes" 232 | db = "prometheus_raw" 233 | rp = "autogen" 234 | type = "prometheus" 235 | scheme = "http" 236 | metrics-path = "/metrics" 237 | scrape-interval = "10s" 238 | scrape-timeout = "10s" 239 | [[scraper]] 240 | enabled = true 241 | name = "prometheus-endpoint" 242 | discoverer-id = "kubernetes-endpoint" 243 | discoverer-service = "kubernetes" 244 | db = "prometheus_raw" 245 | rp = "autogen" 246 | type = "prometheus" 247 | scheme = "http" 248 | metrics-path = "/metrics" 249 | scrape-interval = "10s" 250 | scrape-timeout = "10s" -------------------------------------------------------------------------------- /kapacitor/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if not (empty .Values.influxURL) }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: {{ .Release.Name | quote }} 9 | heritage: {{ .Release.Service | quote }} 10 | app: {{ template "fullname" . }} 11 | spec: 12 | replicas: 1 13 | template: 14 | metadata: 15 | labels: 16 | app: {{ template "fullname" . }} 17 | annotations: 18 | # Include a hash of the config in the pod template 19 | # This means that if the config changes, the deployment will be rolled 20 | checksum/config: {{ include (print .Template.BasePath "/config.yaml") . | sha256sum }} 21 | spec: 22 | containers: 23 | - name: {{ .Chart.Name }} 24 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 25 | imagePullPolicy: {{ .Values.image.pullPolicy }} 26 | resources: 27 | {{ toYaml .Values.resources | indent 10 }} 28 | ports: 29 | - containerPort: 9092 30 | volumeMounts: 31 | - name: data 32 | mountPath: /var/lib/kapacitor 33 | - name: config 34 | mountPath: /etc/kapacitor/ 35 | {{- if .Values.priorityClassName }} 36 | priorityClassName: {{ .Values.priorityClassName }} 37 | {{- end }} 38 | {{- with .Values.nodeSelector }} 39 | nodeSelector: 40 | {{ toYaml . | indent 8 }} 41 | {{- end }} 42 | {{- with .Values.affinity }} 43 | affinity: 44 | {{ toYaml . | indent 8 }} 45 | {{- end }} 46 | {{- with .Values.tolerations }} 47 | tolerations: 48 | {{ toYaml . | indent 8 }} 49 | {{- end }} 50 | volumes: 51 | - name: config 52 | configMap: 53 | name: {{ template "fullname" . }} 54 | - name: data 55 | {{- if .Values.persistence.enabled }} 56 | persistentVolumeClaim: 57 | claimName: {{ template "fullname" . }} 58 | {{- else }} 59 | emptyDir: {} 60 | {{- end }} 61 | {{- end }} 62 | -------------------------------------------------------------------------------- /kapacitor/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.persistence.enabled }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | app: {{ template "fullname" . }} 11 | annotations: 12 | {{- if .Values.persistence.storageClass }} 13 | volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} 14 | {{- else }} 15 | volume.alpha.kubernetes.io/storage-class: default 16 | {{- end }} 17 | spec: 18 | accessModes: 19 | - {{ .Values.persistence.accessMode | quote }} 20 | resources: 21 | requests: 22 | storage: {{ .Values.persistence.size | quote }} 23 | {{- end }} 24 | -------------------------------------------------------------------------------- /kapacitor/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 7 | release: "{{ .Release.Name }}" 8 | heritage: "{{ .Release.Service }}" 9 | app: {{ template "fullname" . }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | - port: 9092 14 | targetPort: 9092 15 | name: api 16 | selector: 17 | app: {{ template "fullname" . }} 18 | -------------------------------------------------------------------------------- /kapacitor/values.yaml: -------------------------------------------------------------------------------- 1 | ## kapacitor image version 2 | ## ref: https://hub.docker.com/r/library/kapacitor/tags/ 3 | ## 4 | image: 5 | repository: "kapacitor" 6 | tag: "1.5.2-alpine" 7 | pullPolicy: "IfNotPresent" 8 | 9 | ## Specify a service type, defaults to NodePort 10 | ## ref: http://kubernetes.io/docs/user-guide/services/ 11 | ## 12 | service: 13 | type: ClusterIP 14 | 15 | ## Persist data to a persitent volume 16 | ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ 17 | ## 18 | persistence: 19 | enabled: false 20 | ## If defined, volume.beta.kubernetes.io/storage-class: 21 | ## Default: volume.alpha.kubernetes.io/storage-class: default 22 | ## 23 | # storageClass: 24 | accessMode: ReadWriteOnce 25 | size: 8Gi 26 | 27 | ## Configure resource requests and limits 28 | ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ 29 | ## 30 | resources: 31 | requests: 32 | memory: 256Mi 33 | cpu: 0.1 34 | limits: 35 | memory: 2Gi 36 | cpu: 2 37 | 38 | ## Pod priority 39 | ## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ 40 | # priorityClassName: "" 41 | 42 | ## Node labels for pod assignment 43 | ## ref: https://kubernetes.io/docs/user-guide/node-selection/ 44 | # 45 | nodeSelector: {} 46 | 47 | ## Tolerations for pod assignment 48 | ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ 49 | ## 50 | tolerations: [] 51 | 52 | ## Affinity for pod assignment 53 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity 54 | ## 55 | affinity: {} 56 | 57 | ## Set the URL of InfluxDB instance to create subscription on 58 | ## ref: https://docs.influxdata.com/kapacitor/v1.5/introduction/getting_started/ 59 | ## 60 | influxURL: http://data-influxdb.tick:8086 61 | -------------------------------------------------------------------------------- /repo-sync.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2016 The Kubernetes Authors All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Bash 'Strict Mode' 18 | # http://redsymbol.net/articles/unofficial-bash-strict-mode 19 | set -euo pipefail 20 | IFS=$'\n\t' 21 | 22 | # Helper Functions ------------------------------------------------------------- 23 | 24 | # Display error message and exit 25 | error_exit() { 26 | echo "error: ${1:-"unknown error"}" 1>&2 27 | exit 1 28 | } 29 | 30 | # Checks if a command exists. Returns 1 or 0 31 | command_exists() { 32 | hash "${1}" 2>/dev/null 33 | } 34 | 35 | # Program Functions ------------------------------------------------------------ 36 | 37 | verify_prereqs() { 38 | echo "Verifying Prerequisites...." 39 | if command_exists gsutil; then 40 | echo "Thumbs up! Looks like you have gsutil. Let's continue." 41 | else 42 | error_exit "Couldn't find gsutil. Bailing out." 43 | fi 44 | } 45 | 46 | # Main ------------------------------------------------------------------------- 47 | 48 | main() { 49 | 50 | echo "Deleting previous repository folder..." 51 | rm -rf repository/ 52 | echo "Packaging all repositories..." 53 | for d in */; do 54 | echo "Packging $d ..." 55 | helm package $d 56 | done 57 | mkdir repository/ 58 | mv *.tgz repository/ 59 | helm repo index repository/ --url http://influx-charts.storage.googleapis.com 60 | 61 | echo "Getting ready to sync your local directory (./repository) to a remote repository at gs://influx-charts" 62 | 63 | verify_prereqs 64 | 65 | # dry run of the command 66 | gsutil rsync -d -n repository/ gs://influx-charts 67 | 68 | echo "Syncing repository/ with gs://influx-charts" 69 | gsutil rsync -d repository/ gs://influx-charts 70 | 71 | echo "Your remote chart repository now matches the contents of the repository/ directory!" 72 | 73 | } 74 | 75 | main "${@:-}" 76 | -------------------------------------------------------------------------------- /telegraf-ds/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /telegraf-ds/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: telegraf-ds 2 | version: 1.10.3 3 | description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics. 4 | keywords: 5 | - telegraf 6 | - collector 7 | - timeseries 8 | - influxdata 9 | home: https://www.influxdata.com/time-series-platform/telegraf/ 10 | maintainers: 11 | - name: 12 | email: 13 | engine: gotpl 14 | -------------------------------------------------------------------------------- /telegraf-ds/README.md: -------------------------------------------------------------------------------- 1 | # Telegraf-DS 2 | 3 | [Telegraf](https://github.com/influxdata/telegraf) is a plugin-driven server agent written by the folks over at [InfluxData](https://influxdata.com) for collecting & reporting metrics. This chart runs a DaemonSet of Telegraf instances to collect host level metrics for your cluster. If you need to poll individual instances of infrastructure or APIs there is a `stable/telegraf-s` chart that is more suited to that usecase. 4 | 5 | ## TL;DR 6 | 7 | ```console 8 | $ helm install stable/telegraf-ds 9 | ``` 10 | 11 | ## Introduction 12 | 13 | This chart bootstraps a `telegraf-ds` deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. 14 | 15 | ## Prerequisites 16 | 17 | - Kubernetes 1.4+ with Beta APIs enabled 18 | 19 | ## Installing the Chart 20 | 21 | To install the chart with the release name `my-release`: 22 | 23 | ```console 24 | $ helm install --name my-release stable/telegraf-ds 25 | ``` 26 | 27 | The command deploys a Telegraf daemonset on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section as well as the [values.yaml](/values.yaml) file lists the parameters that can be configured during installation. 28 | 29 | > **Tip**: List all releases using `helm list` 30 | 31 | ## Uninstalling the Chart 32 | 33 | To uninstall/delete the `my-release` deployment: 34 | 35 | ```console 36 | $ helm delete my-release 37 | ``` 38 | 39 | The command removes all the Kubernetes components associated with the chart and deletes the release. 40 | 41 | ## Configuration 42 | 43 | The default configuration parameters are listed in `values.yaml`. To change the defaults, specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, 44 | 45 | ```console 46 | $ helm install --name my-release \ 47 | --set config.outputs.influxdb.url=http://foo.bar:8086 \ 48 | stable/telegraf-ds 49 | ``` 50 | 51 | The above command allows the chart to deploy by setting the InfluxDB URL for telegraf to write to. 52 | 53 | Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, 54 | 55 | ```console 56 | $ helm install --name my-release -f values.yaml stable/telegraf-ds 57 | ``` 58 | 59 | ## Telegraf Configuration 60 | 61 | This chart deploys the following by default: 62 | 63 | - `telegraf` (`telegraf-ds`) running in a daemonset with the following plugins enabled 64 | * [`cpu`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 65 | * [`disk`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 66 | * [`docker`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/docker) 67 | * [`diskio`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 68 | * [`kernel`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 69 | * [`kubernetes`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/kubernetes) 70 | * [`mem`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 71 | * [`processes`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 72 | * [`swap`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 73 | * [`system`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 74 | -------------------------------------------------------------------------------- /telegraf-ds/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | To open a shell session in the container running Telegraf run the following: 2 | 3 | - kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh 4 | 5 | To tail the logs for a Telegraf pod in the Daemonset run the following: 6 | 7 | - kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8 | 9 | To list the running Telegraf instances run the following: 10 | 11 | - kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -w -------------------------------------------------------------------------------- /telegraf-ds/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 24 -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 24 -}} 16 | {{- end -}} 17 | 18 | {{/* 19 | CUSTOM TEMPLATES: This section contains templates that make up the different parts of the telegraf configuration file. 20 | - global_tags section 21 | - agent section 22 | */}} 23 | 24 | {{- define "global_tags" -}} 25 | {{- if . -}} 26 | [global_tags] 27 | {{- range $key, $val := . }} 28 | {{ $key }} = {{ $val | quote }} 29 | {{- end }} 30 | {{- end }} 31 | {{- end -}} 32 | 33 | {{- define "agent" -}} 34 | [agent] 35 | {{- range $key, $value := . -}} 36 | {{- $tp := typeOf $value }} 37 | {{- if eq $tp "string"}} 38 | {{ $key }} = {{ $value | quote }} 39 | {{- end }} 40 | {{- if eq $tp "float64"}} 41 | {{ $key }} = {{ $value | int64 }} 42 | {{- end }} 43 | {{- if eq $tp "int"}} 44 | {{ $key }} = {{ $value | int64 }} 45 | {{- end }} 46 | {{- if eq $tp "bool"}} 47 | {{ $key }} = {{ $value }} 48 | {{- end }} 49 | {{- end }} 50 | {{- end -}} 51 | 52 | {{- define "outputs" -}} 53 | {{- range $outputIdx, $configObject := . -}} 54 | {{- range $output, $config := . }} 55 | [[outputs.{{ $output }}]] 56 | {{- if $config }} 57 | {{- $tp := typeOf $config -}} 58 | {{- if eq $tp "map[string]interface {}" -}} 59 | {{- range $key, $value := $config -}} 60 | {{- $tp := typeOf $value }} 61 | {{- if eq $tp "string"}} 62 | {{ $key }} = {{ $value | quote }} 63 | {{- end }} 64 | {{- if eq $tp "float64"}} 65 | {{ $key }} = {{ $value | int64 }} 66 | {{- end }} 67 | {{- if eq $tp "int"}} 68 | {{ $key }} = {{ $value | int64 }} 69 | {{- end }} 70 | {{- if eq $tp "bool"}} 71 | {{ $key }} = {{ $value }} 72 | {{- end }} 73 | {{- if eq $tp "[]interface {}" }} 74 | {{ $key }} = [ 75 | {{- $numOut := len $value }} 76 | {{- $numOut := sub $numOut 1 }} 77 | {{- range $b, $val := $value }} 78 | {{- $i := int64 $b }} 79 | {{- if eq $i $numOut }} 80 | {{ $val | quote }} 81 | {{- else }} 82 | {{ $val | quote }}, 83 | {{- end }} 84 | {{- end }} 85 | ] 86 | {{- end }} 87 | {{- end }} 88 | {{- end }} 89 | {{- end }} 90 | {{- end }} 91 | {{- end }} 92 | {{- end -}} 93 | 94 | {{- define "inputs" -}} 95 | {{- range $inputIdx, $configObject := . -}} 96 | {{- range $input, $config := . -}} 97 | 98 | [[inputs.{{- $input }}]] 99 | {{- if $config -}} 100 | {{- $tp := typeOf $config -}} 101 | {{- if eq $tp "map[string]interface {}" -}} 102 | {{- range $key, $value := $config -}} 103 | {{- $tp := typeOf $value -}} 104 | {{- if eq $tp "string" }} 105 | {{ $key }} = {{ $value | quote }} 106 | {{- end }} 107 | {{- if eq $tp "float64" }} 108 | {{ $key }} = {{ $value | int64 }} 109 | {{- end }} 110 | {{- if eq $tp "int" }} 111 | {{ $key }} = {{ $value | int64 }} 112 | {{- end }} 113 | {{- if eq $tp "bool" }} 114 | {{ $key }} = {{ $value }} 115 | {{- end }} 116 | {{- if eq $tp "[]interface {}" }} 117 | {{ $key }} = [ 118 | {{- $numOut := len $value }} 119 | {{- $numOut := sub $numOut 1 }} 120 | {{- range $b, $val := $value }} 121 | {{- $i := int64 $b }} 122 | {{- $tp := typeOf $val }} 123 | {{- if eq $i $numOut }} 124 | {{- if eq $tp "string" }} 125 | {{ $val | quote }} 126 | {{- end }} 127 | {{- if eq $tp "float64" }} 128 | {{ $val | int64 }} 129 | {{- end }} 130 | {{- else }} 131 | {{- if eq $tp "string" }} 132 | {{ $val | quote }}, 133 | {{- end}} 134 | {{- if eq $tp "float64" }} 135 | {{ $val | int64 }}, 136 | {{- end }} 137 | {{- end }} 138 | {{- end }} 139 | ] 140 | {{- end }} 141 | {{- if eq $tp "map[string]interface {}" }} 142 | [[inputs.{{ $input }}.{{ $key }}]] 143 | {{- range $k, $v := $value }} 144 | {{- $tps := typeOf $v }} 145 | {{- if eq $tps "string" }} 146 | {{ $k }} = {{ $v }} 147 | {{- end }} 148 | {{- if eq $tps "[]interface {}"}} 149 | {{ $k }} = [ 150 | {{- $numOut := len $value }} 151 | {{- $numOut := sub $numOut 1 }} 152 | {{- range $b, $val := $v }} 153 | {{- $i := int64 $b }} 154 | {{- if eq $i $numOut }} 155 | {{ $val | quote }} 156 | {{- else }} 157 | {{ $val | quote }}, 158 | {{- end }} 159 | {{- end }} 160 | ] 161 | {{- end }} 162 | {{- if eq $tps "map[string]interface {}"}} 163 | [[inputs.{{ $input }}.{{ $key }}.{{ $k }}]] 164 | {{- range $foo, $bar := $v }} 165 | {{ $foo }} = {{ $bar | quote }} 166 | {{- end }} 167 | {{- end }} 168 | {{- end }} 169 | {{- end }} 170 | {{- end }} 171 | {{- end }} 172 | {{- end }} 173 | {{ end }} 174 | {{- end }} 175 | {{- end -}} 176 | -------------------------------------------------------------------------------- /telegraf-ds/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | data: 12 | telegraf.conf: |+ 13 | {{ template "global_tags" .Values.config.global_tags }} 14 | {{ template "agent" .Values.config.agent }} 15 | {{ template "outputs" .Values.config.outputs }} 16 | {{ template "inputs" .Values.config.inputs -}} -------------------------------------------------------------------------------- /telegraf-ds/templates/daemonset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: DaemonSet 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | spec: 10 | template: 11 | metadata: 12 | labels: 13 | app: {{ template "fullname" . }} 14 | annotations: 15 | # Include a hash of the configmap in the pod template 16 | # This means that if the configmap changes, the deployment will be rolled 17 | checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }} 18 | spec: 19 | containers: 20 | - name: {{ template "fullname" . }} 21 | image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" 22 | imagePullPolicy: {{ default "" .Values.image.pullPolicy | quote }} 23 | resources: 24 | {{ toYaml .Values.resources | indent 10 }} 25 | env: 26 | # This pulls HOSTNAME from the node, not the pod. 27 | - name: HOSTNAME 28 | valueFrom: 29 | fieldRef: 30 | fieldPath: spec.nodeName 31 | # In test clusters where hostnames are resolved in /etc/hosts on each node, 32 | # the HOSTNAME is not resolvable from inside containers 33 | # So inject the host IP as well 34 | - name: HOSTIP 35 | valueFrom: 36 | fieldRef: 37 | fieldPath: status.hostIP 38 | - name: "HOST_PROC" 39 | value: "/rootfs/proc" 40 | - name: "HOST_SYS" 41 | value: "/rootfs/sys" 42 | volumeMounts: 43 | - name: varrunutmpro 44 | mountPath: /var/run/utmp 45 | readOnly: true 46 | - name: sysro 47 | mountPath: /rootfs/sys 48 | readOnly: true 49 | - name: procro 50 | mountPath: /rootfs/proc 51 | readOnly: true 52 | - name: docker-socket 53 | mountPath: /var/run/docker.sock 54 | - name: config 55 | mountPath: /etc/telegraf 56 | {{- with .Values.tolerations }} 57 | tolerations: 58 | {{ toYaml . | indent 8 }} 59 | {{- end }} 60 | volumes: 61 | - name: sysro 62 | hostPath: 63 | path: /sys 64 | - name: docker-socket 65 | hostPath: 66 | path: /var/run/docker.sock 67 | - name: procro 68 | hostPath: 69 | path: /proc 70 | - name: varrunutmpro 71 | hostPath: 72 | path: /var/run/utmp 73 | - name: config 74 | configMap: 75 | name: {{ template "fullname" . }} 76 | -------------------------------------------------------------------------------- /telegraf-ds/values.yaml: -------------------------------------------------------------------------------- 1 | ## Default values.yaml for Telegraf 2 | ## This is a YAML-formatted file. 3 | ## ref: https://hub.docker.com/r/library/telegraf/tags/ 4 | image: 5 | repo: "telegraf" 6 | tag: "1.10.3-alpine" 7 | pullPolicy: IfNotPresent 8 | 9 | ## Configure resource requests and limits 10 | ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ 11 | resources: 12 | requests: 13 | memory: 256Mi 14 | cpu: 0.1 15 | limits: 16 | memory: 2Gi 17 | cpu: 1 18 | 19 | ## Tolerations for pod assignment 20 | ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ 21 | ## 22 | tolerations: [] 23 | 24 | ## Exposed telegraf configuration 25 | ## ref: https://docs.influxdata.com/telegraf/v1.8/administration/configuration/ 26 | config: 27 | # global_tags: 28 | # cluster: "mycluster" 29 | agent: 30 | interval: "10s" 31 | round_interval: true 32 | metric_batch_size: 1000 33 | metric_buffer_limit: 10000 34 | collection_jitter: "0s" 35 | flush_interval: "10s" 36 | flush_jitter: "0s" 37 | precision: "" 38 | debug: false 39 | quiet: false 40 | logfile: "" 41 | hostname: "$HOSTNAME" 42 | omit_hostname: false 43 | outputs: 44 | - influxdb: 45 | url: "http://data-influxdb.tick:8086" 46 | database: "telegraf" 47 | retention_policy: "" 48 | timeout: "5s" 49 | username: "" 50 | password: "" 51 | user_agent: "telegraf" 52 | insecure_skip_verify: false 53 | inputs: 54 | - kubernetes: 55 | url: "https://$HOSTIP:10250" 56 | bearer_token: "/var/run/secrets/kubernetes.io/serviceaccount/token" 57 | insecure_skip_verify: true 58 | - docker: 59 | endpoint: "unix:///var/run/docker.sock" 60 | timeout: "5s" 61 | perdevice: true 62 | total: false 63 | docker_label_exclude: 64 | - "annotation.kubernetes.io/*" 65 | -------------------------------------------------------------------------------- /telegraf-s/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /telegraf-s/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: telegraf-s 2 | version: 1.10.3 3 | description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics. 4 | keywords: 5 | - telegraf 6 | - collector 7 | - timeseries 8 | - influxdata 9 | home: https://www.influxdata.com/time-series-platform/telegraf/ 10 | maintainers: 11 | - name: 12 | email: 13 | engine: gotpl 14 | -------------------------------------------------------------------------------- /telegraf-s/README.md: -------------------------------------------------------------------------------- 1 | # Telegraf 2 | 3 | [Telegraf](https://github.com/influxdata/telegraf) is a plugin-driven server agent written by the folks over at [InfluxData](https://influxdata.com) for collecting & reporting metrics. 4 | 5 | ## TL;DR 6 | 7 | ```console 8 | $ helm install stable/telegraf 9 | ``` 10 | 11 | ## Introduction 12 | 13 | This chart bootstraps a `telegraf` deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. 14 | 15 | ## Prerequisites 16 | 17 | - Kubernetes 1.4+ with Beta APIs enabled 18 | 19 | ## Installing the Chart 20 | 21 | To install the chart with the release name `my-release`: 22 | 23 | ```console 24 | $ helm install --name my-release stable/telegraf 25 | ``` 26 | 27 | The command deploys Telegraf on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. 28 | 29 | > **Tip**: List all releases using `helm list` 30 | 31 | ## Uninstalling the Chart 32 | 33 | To uninstall/delete the `my-release` deployment: 34 | 35 | ```console 36 | $ helm delete my-release 37 | ``` 38 | 39 | The command removes all the Kubernetes components associated with the chart and deletes the release. 40 | 41 | ## Configuration 42 | 43 | The default configuration parameters are listed in `values.yaml`. To change the defaults, specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, 44 | 45 | ```console 46 | $ helm install --name my-release \ 47 | --set single.enabled=false \ 48 | stable/telegraf 49 | ``` 50 | 51 | The above command prevents the single telegraf instance from deploying. 52 | 53 | Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, 54 | 55 | ```console 56 | $ helm install --name my-release -f values.yaml stable/telegraf 57 | ``` 58 | 59 | Outputs and inputs are configured as arrays of key/value dictionaries. Additional examples and defaults can be found in [values.yaml](values.yaml) 60 | Example: 61 | ``` 62 | outputs: 63 | - influxdb: 64 | urls: [] 65 | # - "http://influxdb-influxdb.tick:8086" 66 | database: "telegraf" 67 | inputs: 68 | - cpu: 69 | percpu: false 70 | totalcpu: true 71 | - system: 72 | ``` 73 | 74 | > **Tip**: You can use the default [values.yaml](values.yaml) 75 | 76 | ## Telegraf Configuration 77 | 78 | This chart deploys the following by default: 79 | 80 | - `telegraf` (`telegraf-ds`) running in a daemonset with the following plugins enabled 81 | * [`cpu`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 82 | * [`disk`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 83 | * [`docker`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/docker) 84 | * [`diskio`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 85 | * [`kernel`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 86 | * [`kubernetes`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/kubernetes) 87 | * [`mem`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 88 | * [`processes`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 89 | * [`swap`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 90 | * [`system`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 91 | 92 | - A single `telegraf` deployment (`telegraf-s`) with an associated service running the following plugins: 93 | * [`prometheus`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus) 94 | * [`influxdb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/influxdb) 95 | * [`statsd`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd) 96 | 97 | 98 | ### Supported Outputs 99 | 100 | The following telegraf output plugins are supported for both the daemonset and the single instance. To enable them uncomment them in `.Values.{{ "daemonset" | "single" }}.outputs`: 101 | 102 | - [`amqp`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/amqp) 103 | - [`influxdb`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/influxdb) 104 | - [`kafka`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/kafka) 105 | - [`mqtt`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/mqtt) 106 | - [`nats`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/nats) 107 | - [`nsq`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/nsq) 108 | 109 | ### Service Plugins - Single Instance 110 | 111 | The single telegraf also supports all service plugins. To enable them uncomment the named plugin in `.Values.single.inputs` section. The associated service exposes the ports if it is enabled: 112 | 113 | - [`tcp_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/tcp_listener) 114 | - [`udp_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/udp_listener) 115 | - [`statsd`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd) 116 | - [`http_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/http_listener) 117 | 118 | ### Supported Inputs - Single Instance 119 | 120 | To enable additional input plugins uncomment them in the `.Values.single.inputs` section. The input plugins supported by the single telegraf instance are as follows: 121 | 122 | - [`aerospike`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/aerospike) 123 | - [`apache`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/apache) 124 | - [`cassandra`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cassandra) 125 | - [`cloudwatch`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cloudwatch) 126 | - [`consul`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/consul) 127 | - [`couchbase`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/couchbase) 128 | - [`couchdb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/couchdb) 129 | - [`disque`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/disque) 130 | - [`dns_query`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/dns_query) 131 | - [`dovecot`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/dovecot) 132 | - [`elasticsearch`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/elasticsearch) 133 | - [`graylog`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/graylog) 134 | - [`haproxy`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/haproxy) 135 | - [`influxdb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/influxdb) 136 | - [`lustre2`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/lustre2) 137 | - [`mailchimp`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mailchimp) 138 | - [`memcached`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/memcached) 139 | - [`mesos`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mesos) 140 | - [`mongodb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mongodb) 141 | - [`mysql`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mysql) 142 | - [`net_response`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/net_response) 143 | - [`nginx`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nginx) 144 | - [`nsq`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nsq) 145 | - [`phpfpm`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/phpfpm) 146 | - [`ping`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ping) 147 | - [`postgresql`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/postgresql) 148 | - [`prometheus`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus) 149 | - [`rabbitmq`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/rabbitmq) 150 | - [`raindrops`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/raindrops) 151 | - [`redis`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/redis) 152 | - [`rethinkdb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/rethinkdb) 153 | - [`riak`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/riak) 154 | - [`sqlserver`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sqlserver) 155 | - [`twemproxy`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/twemproxy) 156 | - [`zookeeper`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/zookeeper) 157 | - [`http_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/http_listener) 158 | - [`statsd`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd) 159 | - [`tcp_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/tcp_listener) 160 | - [`udp_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/udp_listener) 161 | - [`webhooks`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/webhooks) 162 | 163 | ### Future work: 164 | 165 | There are a couple of additional plugins that could/should possibly be supported but are not yet: 166 | - `telegraf-s` 167 | - [`smnp`](https://github.com/influxdata/telegraf/tree/master/plugins/smnp) 168 | - `telegraf-ds` 169 | - [`jolokia`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/jolokia) 170 | - [`bcache`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/bcache) 171 | - [`cgroup`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cgroup) 172 | - [`conntrack`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/conntrack) 173 | - [`exec`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec) 174 | - [`filestat`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/filestat) 175 | - [`hddtemp`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/hddtemp) 176 | - [`ipmi_sensor`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ipmi_sensor) 177 | - [`iptables`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/iptables) 178 | - [`leofs`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/leofs) 179 | - [`logparser`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/logparser) 180 | - [`nstat`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nstat) 181 | - [`ntpq`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ntpq) 182 | - [`passenger`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/passenger) 183 | - [`powerdns`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/powerdns) 184 | - [`procstat`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/procstat) 185 | - [`puppetagent`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/puppetagent) 186 | - [`sysstat`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sysstat) 187 | - [`varnish`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/varnish) 188 | - [`win_perf_counters`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters) 189 | - [`zfs`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/zfs) 190 | -------------------------------------------------------------------------------- /telegraf-s/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | To open a shell session in the container running Telegraf run the following: 2 | 3 | - kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh 4 | 5 | To tail the logs for a Telegraf pod, run the following: 6 | 7 | - kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8 | 9 | {{- if eq .Values.service.type "LoadBalancer" }} 10 | 11 | To watch for the LoadBalancer IP run the following 12 | 13 | - kubectl get svc -w --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /telegraf-s/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 24 -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | */}} 13 | {{- define "fullname" -}} 14 | {{- $name := default .Chart.Name .Values.nameOverride -}} 15 | {{- printf "%s-%s" .Release.Name $name | trunc 24 -}} 16 | {{- end -}} 17 | 18 | {{/* 19 | CUSTOM TEMPLATES: This section contains templates that make up the different parts of the telegraf configuration file. 20 | - global_tags section 21 | - agent section 22 | */}} 23 | 24 | {{- define "global_tags" -}} 25 | {{- if . -}} 26 | [global_tags] 27 | {{- range $key, $val := . }} 28 | {{ $key }} = {{ $val | quote }} 29 | {{- end }} 30 | {{- end }} 31 | {{- end -}} 32 | 33 | {{- define "agent" -}} 34 | [agent] 35 | {{- range $key, $value := . -}} 36 | {{- $tp := typeOf $value }} 37 | {{- if eq $tp "string"}} 38 | {{ $key }} = {{ $value | quote }} 39 | {{- end }} 40 | {{- if eq $tp "float64"}} 41 | {{ $key }} = {{ $value | int64 }} 42 | {{- end }} 43 | {{- if eq $tp "int"}} 44 | {{ $key }} = {{ $value | int64 }} 45 | {{- end }} 46 | {{- if eq $tp "bool"}} 47 | {{ $key }} = {{ $value }} 48 | {{- end }} 49 | {{- end }} 50 | {{- end -}} 51 | 52 | {{- define "outputs" -}} 53 | {{- range $outputIdx, $configObject := . -}} 54 | {{- range $output, $config := . }} 55 | [[outputs.{{ $output }}]] 56 | {{- if $config }} 57 | {{- $tp := typeOf $config -}} 58 | {{- if eq $tp "map[string]interface {}" -}} 59 | {{- range $key, $value := $config -}} 60 | {{- $tp := typeOf $value }} 61 | {{- if eq $tp "string"}} 62 | {{ $key }} = {{ $value | quote }} 63 | {{- end }} 64 | {{- if eq $tp "float64"}} 65 | {{ $key }} = {{ $value | int64 }} 66 | {{- end }} 67 | {{- if eq $tp "int"}} 68 | {{ $key }} = {{ $value | int64 }} 69 | {{- end }} 70 | {{- if eq $tp "bool"}} 71 | {{ $key }} = {{ $value }} 72 | {{- end }} 73 | {{- if eq $tp "[]interface {}" }} 74 | {{ $key }} = [ 75 | {{- $numOut := len $value }} 76 | {{- $numOut := sub $numOut 1 }} 77 | {{- range $b, $val := $value }} 78 | {{- $i := int64 $b }} 79 | {{- if eq $i $numOut }} 80 | {{ $val | quote }} 81 | {{- else }} 82 | {{ $val | quote }}, 83 | {{- end }} 84 | {{- end }} 85 | ] 86 | {{- end }} 87 | {{- end }} 88 | {{- end }} 89 | {{- end }} 90 | {{- end }} 91 | {{- end }} 92 | {{- end -}} 93 | 94 | {{- define "inputs" -}} 95 | {{- range $inputIdx, $configObject := . -}} 96 | {{- range $input, $config := . -}} 97 | 98 | [[inputs.{{- $input }}]] 99 | {{- if $config -}} 100 | {{- $tp := typeOf $config -}} 101 | {{- if eq $tp "map[string]interface {}" -}} 102 | {{- range $key, $value := $config -}} 103 | {{- $tp := typeOf $value -}} 104 | {{- if eq $tp "string" }} 105 | {{ $key }} = {{ $value | quote }} 106 | {{- end }} 107 | {{- if eq $tp "float64" }} 108 | {{ $key }} = {{ $value | int64 }} 109 | {{- end }} 110 | {{- if eq $tp "int" }} 111 | {{ $key }} = {{ $value | int64 }} 112 | {{- end }} 113 | {{- if eq $tp "bool" }} 114 | {{ $key }} = {{ $value }} 115 | {{- end }} 116 | {{- if eq $tp "[]interface {}" }} 117 | {{ $key }} = [ 118 | {{- $numOut := len $value }} 119 | {{- $numOut := sub $numOut 1 }} 120 | {{- range $b, $val := $value }} 121 | {{- $i := int64 $b }} 122 | {{- $tp := typeOf $val }} 123 | {{- if eq $i $numOut }} 124 | {{- if eq $tp "string" }} 125 | {{ $val | quote }} 126 | {{- end }} 127 | {{- if eq $tp "float64" }} 128 | {{ $val | int64 }} 129 | {{- end }} 130 | {{- else }} 131 | {{- if eq $tp "string" }} 132 | {{ $val | quote }}, 133 | {{- end}} 134 | {{- if eq $tp "float64" }} 135 | {{ $val | int64 }}, 136 | {{- end }} 137 | {{- end }} 138 | {{- end }} 139 | ] 140 | {{- end }} 141 | {{- if eq $tp "map[string]interface {}" }} 142 | [[inputs.{{ $input }}.{{ $key }}]] 143 | {{- range $k, $v := $value }} 144 | {{- $tps := typeOf $v }} 145 | {{- if eq $tps "string" }} 146 | {{ $k }} = {{ $v }} 147 | {{- end }} 148 | {{- if eq $tps "[]interface {}"}} 149 | {{ $k }} = [ 150 | {{- $numOut := len $value }} 151 | {{- $numOut := sub $numOut 1 }} 152 | {{- range $b, $val := $v }} 153 | {{- $i := int64 $b }} 154 | {{- if eq $i $numOut }} 155 | {{ $val | quote }} 156 | {{- else }} 157 | {{ $val | quote }}, 158 | {{- end }} 159 | {{- end }} 160 | ] 161 | {{- end }} 162 | {{- if eq $tps "map[string]interface {}"}} 163 | [[inputs.{{ $input }}.{{ $key }}.{{ $k }}]] 164 | {{- range $foo, $bar := $v }} 165 | {{ $foo }} = {{ $bar | quote }} 166 | {{- end }} 167 | {{- end }} 168 | {{- end }} 169 | {{- end }} 170 | {{- end }} 171 | {{- end }} 172 | {{- end }} 173 | {{ end }} 174 | {{- end }} 175 | {{- end -}} -------------------------------------------------------------------------------- /telegraf-s/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | heritage: "{{ .Release.Service }}" 10 | data: 11 | telegraf.conf: |+ 12 | {{ template "global_tags" .Values.config.global_tags }} 13 | {{ template "agent" .Values.config.agent }} 14 | {{ template "outputs" .Values.config.outputs }} 15 | {{ template "inputs" .Values.config.inputs -}} -------------------------------------------------------------------------------- /telegraf-s/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "fullname" . }} 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | spec: 10 | replicas: 1 11 | template: 12 | metadata: 13 | labels: 14 | app: {{ template "fullname" . }} 15 | annotations: 16 | # Include a hash of the configmap in the pod template 17 | # This means that if the configmap changes, the deployment will be rolled 18 | checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }} 19 | spec: 20 | containers: 21 | - name: {{ template "fullname" . }} 22 | image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" 23 | imagePullPolicy: {{ default "" .Values.image.pullPolicy | quote }} 24 | resources: 25 | {{ toYaml .Values.resources | indent 10 }} 26 | volumeMounts: 27 | - name: config 28 | mountPath: /etc/telegraf 29 | - name: varrunutmpro 30 | mountPath: /var/run/utmp 31 | readOnly: true 32 | {{- if .Values.priorityClassName }} 33 | priorityClassName: {{ .Values.priorityClassName }} 34 | {{- end }} 35 | {{- with .Values.nodeSelector }} 36 | nodeSelector: 37 | {{ toYaml . | indent 8 }} 38 | {{- end }} 39 | {{- with .Values.affinity }} 40 | affinity: 41 | {{ toYaml . | indent 8 }} 42 | {{- end }} 43 | {{- with .Values.tolerations }} 44 | tolerations: 45 | {{ toYaml . | indent 8 }} 46 | {{- end }} 47 | {{- if .Values.serviceAccountName }} 48 | serviceAccountName: {{ .Values.serviceAccountName }} 49 | {{- end }} 50 | volumes: 51 | - name: varrunutmpro 52 | hostPath: 53 | path: /var/run/utmp 54 | - name: config 55 | configMap: 56 | name: {{ template "fullname" . }} 57 | -------------------------------------------------------------------------------- /telegraf-s/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.service.enabled -}} 2 | {{- if .Values.service.enabled -}} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ template "fullname" . }} 7 | labels: 8 | app: {{ template "fullname" . }} 9 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 10 | release: {{ .Release.Name }} 11 | spec: 12 | type: {{ .Values.service.type }} 13 | ports: 14 | {{- range $objectKey, $objectValue := .Values.config.inputs }} 15 | {{- range $key, $value := . -}} 16 | {{- $tp := typeOf $value -}} 17 | {{- if eq $key "http_listener" }} 18 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 19 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 20 | name: "http-listener" 21 | {{- end }} 22 | {{- if eq $key "statsd" }} 23 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 24 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 25 | protocol: "UDP" 26 | name: "statsd" 27 | {{- end }} 28 | {{- if eq $key "tcp-listener" }} 29 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 30 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 31 | name: "tcp_listener" 32 | {{- end }} 33 | {{- if eq $key "udp-listener" }} 34 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 35 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 36 | protocol: "UDP" 37 | name: "udp_listener" 38 | {{- end }} 39 | {{- if eq $key "webhooks" }} 40 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 41 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 42 | name: "webhooks" 43 | {{- end }} 44 | {{- end -}} 45 | {{- end }} 46 | selector: 47 | app: {{ template "fullname" .}} 48 | {{- end -}} 49 | {{- end -}} 50 | -------------------------------------------------------------------------------- /telegraf-s/values.yaml: -------------------------------------------------------------------------------- 1 | ## Default values.yaml for Telegraf 2 | ## This is a YAML-formatted file. 3 | ## ref: https://hub.docker.com/r/library/telegraf/tags/ 4 | image: 5 | repo: "telegraf" 6 | tag: "1.10.3-alpine" 7 | pullPolicy: IfNotPresent 8 | 9 | ## Configure resource requests and limits 10 | ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ 11 | resources: 12 | requests: 13 | memory: 256Mi 14 | cpu: 0.1 15 | limits: 16 | memory: 2Gi 17 | cpu: 1 18 | 19 | # Pod service account 20 | # serviceAccountName: "" 21 | 22 | ## Pod priority 23 | ## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ 24 | # priorityClassName: "" 25 | 26 | ## Node labels for pod assignment 27 | ## ref: https://kubernetes.io/docs/user-guide/node-selection/ 28 | # 29 | nodeSelector: {} 30 | 31 | ## Tolerations for pod assignment 32 | ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ 33 | ## 34 | tolerations: [] 35 | 36 | ## Affinity for pod assignment 37 | ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity 38 | ## 39 | affinity: {} 40 | 41 | ## Configure the service for this telegraf instance. If you are running 42 | ## Any of the service plugins you will need this enabled 43 | ## Service Plugins: http_listener, statsd, tcp_listener, udp_listener 44 | ## ref: http://kubernetes.io/docs/user-guide/services/ 45 | service: 46 | enabled: true 47 | type: ClusterIP 48 | 49 | ## Exposed telegraf configuration 50 | ## For full list of possible values see `/docs/all-config-values.yaml` and `/docs/all-config-values.toml` 51 | ## ref: https://docs.influxdata.com/telegraf/v1.8/administration/configuration/ 52 | 53 | config: 54 | ## global_tags: 55 | ## dc: "us-east-1" 56 | ## user: "$USER" 57 | agent: 58 | interval: "10s" 59 | round_interval: true 60 | metric_batch_size: 1000 61 | metric_buffer_limit: 10000 62 | collection_jitter: "0s" 63 | flush_interval: "10s" 64 | flush_jitter: "0s" 65 | precision: "" 66 | debug: false 67 | quiet: false 68 | logfile: "" 69 | hostname: "telegraf-polling-service" 70 | omit_hostname: false 71 | outputs: 72 | - influxdb: 73 | urls: 74 | - "http://data-influxdb.tick:8086" 75 | database: "telegraf" 76 | ## retention_policy: "" 77 | ## write_consistency: "any" 78 | ## timeout: "5s" 79 | ## username: "telegraf" 80 | ## password: "metricsmetricsmetricsmetrics" 81 | ## user_agent: "telegraf" 82 | ## udp_payload: 512 83 | ## ssl_ca: "/etc/telegraf/ca.pem" 84 | ## ssl_cert: "/etc/telegraf/cert.pem" 85 | ## ssl_key: "/etc/telegraf/key.pem" 86 | ## insecure_skip_verify: false 87 | ## amqp: 88 | ## url: "amqp://localhost:5672/influxdb" 89 | ## exchange: "telegraf" 90 | ## auth_method: "PLAIN" 91 | ## routing_tag: "host" 92 | ## retention_policy: "default" 93 | ## database: "telegraf" 94 | ## precision: "s" 95 | ## ssl_ca: "/etc/telegraf/ca.pem" 96 | ## ssl_cert: "/etc/telegraf/cert.pem" 97 | ## ssl_key: "/etc/telegraf/key.pem" 98 | ## insecure_skip_verify: false 99 | ## data_format: "influx" 100 | ## kafka: 101 | ## brokers: 102 | ## - "localhost:9092" 103 | ## topic: "telegraf" 104 | ## routing_tag: "host" 105 | ## compression_codec: 0 106 | ## required_acks: -1 107 | ## max_retry: 3 108 | ## ssl_ca: "/etc/telegraf/ca.pem" 109 | ## ssl_cert: "/etc/telegraf/cert.pem" 110 | ## ssl_key: "/etc/telegraf/key.pem" 111 | ## insecure_skip_verify: false 112 | ## data_format: "influx" 113 | ## mqtt: 114 | ## servers: 115 | ## - "localhost:1883" 116 | ## topic_prefix: "telegraf" 117 | ## username: "telegraf" 118 | ## password: "metricsmetricsmetricsmetrics" 119 | ## ssl_ca: "/etc/telegraf/ca.pem" 120 | ## ssl_cert: "/etc/telegraf/cert.pem" 121 | ## ssl_key: "/etc/telegraf/key.pem" 122 | ## insecure_skip_verify: false 123 | ## data_format: "influx" 124 | ## nats: 125 | ## servers: 126 | ## - "nats://localhost:4222" 127 | ## username: "" 128 | ## password: "" 129 | ## subject: "telegraf" 130 | ## ssl_ca: "/etc/telegraf/ca.pem" 131 | ## ssl_cert: "/etc/telegraf/cert.pem" 132 | ## ssl_key: "/etc/telegraf/key.pem" 133 | ## insecure_skip_verify: false 134 | ## data_format: "influx" 135 | ## nsq: 136 | ## server: "localhost:4150" 137 | ## topic: "telegraf" 138 | ## data_format: "influx" 139 | 140 | # CPU and System is required for chronograf 141 | # This may show errors in the logs, but this does not affect performance or functionality 142 | inputs: 143 | 144 | ## cpu: 145 | ## percpu: false 146 | ## totalcpu: true 147 | ## system: 148 | ## aerospike: 149 | ## servers: 150 | ## - "localhost:3000" 151 | ## apache: 152 | ## urls: 153 | ## - "http://localhost/server-status?auto" 154 | ## cassandra: 155 | ## context: "/jolokia/read" 156 | ## servers: 157 | ## - "myuser:mypassword@10.10.10.1:8778" 158 | ## - "10.10.10.2:8778" 159 | ## - ":8778" 160 | ## metrics : 161 | ## - "/java.lang:type=Memory/HeapMemoryUsage" 162 | ## - "/org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=ReadLatency" 163 | ## cloudwatch: 164 | ## region: "us-east-1" 165 | ## access_key: "" 166 | ## secret_key: "" 167 | ## token: "" 168 | ## role_arn: "" 169 | ## profile: "" 170 | ## shared_credential_file: "" 171 | ## period: "5m" 172 | ## delay: "5m" 173 | ## interval: "5m" 174 | ## cache_ttl: "10m" 175 | ## namespace: "AWS/ELB" 176 | ## ratelimit: 10 177 | ## metrics: 178 | ## names: 179 | ## - "Latency" 180 | ## - "RequestCount" 181 | ## dimensions: 182 | ## name: "LoadBalancerName" 183 | ## value: "p-example" 184 | ## consul: 185 | ## address: "localhost" 186 | ## scheme: "http" 187 | ## token: "" 188 | ## username: "" 189 | ## password: "" 190 | ## datacentre: "" 191 | ## couchbase: 192 | ## servers: 193 | ## - "http://localhost:8091" 194 | ## couchdb: 195 | ## hosts: 196 | ## - "http://localhost:8086/_stats" 197 | ## disque: 198 | ## servers: 199 | ## - "localhost" 200 | ## dns_query: 201 | ## servers: 202 | ## - "8.8.8.8" 203 | ## domains: 204 | ## - "." 205 | ## record_type: "A" 206 | ## port: 53 207 | ## timeout: 2 208 | ## dovecot: 209 | ## servers: 210 | ## - "localhost:24242" 211 | ## type: "global" 212 | ## filters: 213 | ## - "" 214 | ## elasticsearch: 215 | ## servers: 216 | ## - "http://localhost:9200" 217 | ## http_timeout: "5s" 218 | ## local: true 219 | ## cluster_health: false 220 | ## ssl_ca: "/etc/telegraf/ca.pem" 221 | ## ssl_cert: "/etc/telegraf/cert.pem" 222 | ## ssl_key: "/etc/telegraf/key.pem" 223 | ## insecure_skip_verify: false 224 | ## graylog: 225 | ## servers: 226 | ## - "http://[graylog-server-ip]:12900/system/metrics/multiple" 227 | ## metrics: 228 | ## - "jvm.cl.loaded" 229 | ## - "jvm.memory.pools.Metaspace.committed" 230 | ## username: "" 231 | ## password: "" 232 | ## ssl_ca: "/etc/telegraf/ca.pem" 233 | ## ssl_cert: "/etc/telegraf/cert.pem" 234 | ## ssl_key: "/etc/telegraf/key.pem" 235 | ## insecure_skip_verify: false 236 | ## haproxy: 237 | ## servers: 238 | ## - "http://myhaproxy.com:1936/haproxy?stats" 239 | - influxdb: 240 | urls: 241 | - "http://influxdb-influxdb.tick:8086/debug/vars" 242 | timeout: "5s" 243 | - kapacitor: 244 | urls: 245 | - "http://kap-kapacitor.tick:9092/debug/vars" 246 | timeout: "5s" 247 | - kapacitor: 248 | urls: 249 | - "http://kap2-kapacitor.tick:9092/debug/vars" 250 | timeout: "5s" 251 | ## lustre2: 252 | ## ost_procfiles: 253 | ## - "/proc/fs/lustre/obdfilter/*/stats" 254 | ## - "/proc/fs/lustre/osd-ldiskfs/*/stats" 255 | ## - "/proc/fs/lustre/obdfilter/*/job_stats" 256 | ## mds_procfiles: 257 | ## - "/proc/fs/lustre/mdt/*/md_stats" 258 | ## - "/proc/fs/lustre/mdt/*/job_stats" 259 | ## mailchimp: 260 | ## api_key: "" 261 | ## days_old: 0 262 | ## campaign_id: "" 263 | ## memcached: 264 | ## servers: 265 | ## - "localhost:11211" 266 | ## unix_sockets: 267 | ## - "/var/run/memcached.sock" 268 | ## mesos: 269 | ## timeout: 100 270 | ## masters: 271 | ## - "localhost:5050" 272 | ## master_collections: 273 | ## - "resources" 274 | ## - "master" 275 | ## - "system" 276 | ## - "agents" 277 | ## - "frameworks" 278 | ## - "tasks" 279 | ## - "messages" 280 | ## - "evqueue" 281 | ## - "registrar" 282 | ## slaves: 283 | ## - 284 | ## slave_collections: 285 | ## - "resources" 286 | ## - "agent" 287 | ## - "system" 288 | ## - "executors" 289 | ## - "tasks" 290 | ## - "messages" 291 | ## mongodb: 292 | ## servers: 293 | ## - "mongodb://user:password@127.0.0.1:27017" 294 | ## gather_perdb_stats: false 295 | ## mysql: 296 | ## servers: 297 | ## - "tcp(127.0.0.1:3306)?tls=false" 298 | ## perf_events_statements_digest_text_limit : 120 299 | ## perf_events_statements_limit: 250 300 | ## perf_events_statements_time_limit : 86400 301 | ## table_schema_databases: [] 302 | ## gather_table_schema: false 303 | ## gather_process_list: true 304 | ## gather_info_schema_auto_inc: true 305 | ## gather_slave_status: true 306 | ## gather_binary_logs: false 307 | ## gather_table_io_waits: false 308 | ## gather_table_lock_waits: false 309 | ## gather_index_io_waits: false 310 | ## gather_event_waits: false 311 | ## gather_file_events_stats: false 312 | ## gather_perf_events_statements: false 313 | ## interval_slow: "30m" 314 | ## net_response: 315 | ## protocol: "tcp" 316 | ## address: "github.com:80" 317 | ## timeout: "1s" 318 | ## send: "ssh" 319 | ## expect: "ssh" 320 | ## read_timeout: "1s" 321 | ## nginx: 322 | ## urls: 323 | ## - "http://nginx.kube-system:18080/status" 324 | ## nsq: 325 | ## endpoints: 326 | ## - "http://localhost:4151" 327 | ## phpfpm: 328 | ## urls: 329 | ## - "http://localhost/status" 330 | ## ping: 331 | ## urls: 332 | ## - "www.google.com" 333 | ## count: 1 334 | ## ping_interval: 1.0 335 | ## timeout: 1.0 336 | ## interface: "" 337 | ## postgresql: 338 | ## address: "postgres://user:password@localhost?sslmode=disable" 339 | ## ignored_databases: 340 | ## - "postgres" 341 | ## databases: 342 | ## - "app_production" 343 | ## - "testing" 344 | ## prometheus: 345 | ## urls: 346 | ## - "https://kubernetes.default:443/metrics" 347 | ## name_prefix: "prom_" 348 | ## bearer_token: "/var/run/secrets/kubernetes.io/serviceaccount/token" 349 | ## insecure_skip_verify: true 350 | ## ssl_ca: /path/to/cafile 351 | ## ssl_cert: /path/to/certfile 352 | ## ssl_key: /path/to/keyfile 353 | ## rabbitmq: 354 | ## url: "http://localhost:15672" 355 | ## name: "rmq-server-1" 356 | ## username: "guest" 357 | ## password: "guest" 358 | ## ssl_ca: "/etc/telegraf/ca.pem" 359 | ## ssl_cert: "/etc/telegraf/cert.pem" 360 | ## ssl_key: "/etc/telegraf/key.pem" 361 | ## insecure_skip_verify: false 362 | ## nodes: 363 | ## - "rabbit@node1" 364 | ## - "rabbit@node2" 365 | ## raindrops: 366 | ## urls: 367 | ## - "http://localhost:8080/_raindrops" 368 | ## redis: 369 | ## servers: 370 | ## - "tcp://localhost:6379" 371 | ## rethinkdb: 372 | ## servers: 373 | ## - "127.0.0.1:28015" 374 | ## riak: 375 | ## servers: 376 | ## - "http://localhost:8098" 377 | ## sqlserver: 378 | ## servers: 379 | ## - "Server=192.168.1.10;Port=1433;User Id=;Password=;app name=telegraf;log=1;" 380 | ## twemproxy: 381 | ## addr: "localhost:22222" 382 | ## pools: 383 | ## - "redis_pool" 384 | ## - "mc_pool" 385 | ## zookeeper: 386 | ## servers: 387 | ## - "localhost:2181" 388 | ## http_listener: 389 | ## service_address: ":8186" 390 | ## read_timeout: "10s" 391 | ## write_timeout: "10s" 392 | ## max_body_size: 0 393 | ## max_line_size: 0 394 | - statsd: 395 | service_address: ":8125" 396 | percentiles: 397 | - 50 398 | - 95 399 | - 99 400 | metric_separator: "_" 401 | allowed_pending_messages: 10000 402 | percentile_limit: 1000 403 | 404 | --------------------------------------------------------------------------------