├── .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 │ ├── deployment.yaml │ ├── pvc.yaml │ └── service.yaml └── values.yaml ├── telegraf-ds ├── .helmignore ├── Chart.yaml ├── README.md ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── conifgmap.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 | -------------------------------------------------------------------------------- /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 | 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: 4 | 5 | - [influxdb](/influxdb/README.md) 6 | - [chronograf](/chronograf/README.md) 7 | - [kapacitor](/kapacitor/README.md) 8 | - [telegraf-s](/telegraf-s/README.md) 9 | - [telegraf-ds](/telegraf-ds/README.md) 10 | 11 | ### Deploy the whole stack! 12 | 13 | - Have your `kubectl` tool configured for the cluster where you would like to deploy the stack. 14 | - Have `helm` and `tiller` installed and configured 15 | - Download and configure the `helm` cli 16 | * [link](https://github.com/kubernetes/helm/blob/master/docs/install.md) 17 | - Run `helm init` to install `tiller` in your cluster 18 | * [link](https://github.com/kubernetes/helm/blob/master/docs/install.md#installing-tiller) 19 | - Install the charts: 20 | ```bash 21 | $ cd tick-charts 22 | $ helm install --name data --namespace tick ./influxdb/ 23 | $ helm install --name polling --namespace tick ./telegraf-s/ 24 | $ helm install --name hosts --namespace tick ./telegraf-ds/ 25 | $ helm install --name alerts --namespace tick ./kapacitor/ 26 | $ helm install --name dash --namespace tick ./chronograf/ 27 | ``` 28 | - Wait for the IP for chronograf to appear: 29 | ```bash 30 | $ kubectl get svc -w --namespace tick -l app dash-chronograf 31 | ``` 32 | - Open chronograf in your browser and configure it 33 | - InfluxDB URL: `http://data-influxdb.tick:8086` 34 | - Kapacitor URL: `http://alerts-kapacitor.tick:9092` 35 | 36 | Or, just run `./create.sh` and let the shell script do it for you! You can also tear down the installation with `./destroy.sh` 37 | 38 | ### Usage 39 | 40 | To package any of the charts for deployment: 41 | 42 | ```bash 43 | $ helm package /path/to/chart 44 | ``` 45 | 46 | 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: 47 | 48 | ```bash 49 | $ helm install telegraf-0.1.0.tgz --name {{ .Release.Name }} --namespace {{ .Release.Namespace }} --values /path/to/my_values.yaml 50 | ``` 51 | -------------------------------------------------------------------------------- /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: 0.2.0 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: Jack Zampolin 11 | email: jack@influxdb.com 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 | -------------------------------------------------------------------------------- /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 | spec: 17 | containers: 18 | - name: {{ .Chart.Name }} 19 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 20 | imagePullPolicy: {{ .Values.image.pullPolicy }} 21 | {{- if .Values.oauth.enabled }} 22 | env: 23 | - name: TOKEN_SECRET 24 | valueFrom: 25 | secretKeyRef: 26 | name: {{ template "fullname" . }} 27 | key: token_secret 28 | {{- if .Values.oauth.github.enabled}} 29 | - name: GH_CLIENT_IDx 30 | valueFrom: 31 | secretKeyRef: 32 | name: {{ template "fullname" . }} 33 | key: gh_client_id 34 | - name: GH_CLIENT_SECRET 35 | valueFrom: 36 | secretKeyRef: 37 | name: {{ template "fullname" . }} 38 | key: gh_client_secret 39 | - name: GH_ORGS 40 | valueFrom: 41 | secretKeyRef: 42 | name: {{ template "fullname" . }} 43 | key: gh_orgs 44 | {{- end }} 45 | {{- if .Values.oauth.heroku.enabled}} 46 | - name: HEROKU_CLIENT_ID 47 | valueFrom: 48 | secretKeyRef: 49 | name: {{ template "fullname" . }} 50 | key: he_client_id 51 | - name: HEROKU_CLIENT_SECRET 52 | valueFrom: 53 | secretKeyRef: 54 | name: {{ template "fullname" . }} 55 | key: he_client_secret 56 | - name: HEROKU_ORGS 57 | valueFrom: 58 | secretKeyRef: 59 | name: {{ template "fullname" . }} 60 | key: he_orgs 61 | {{- end }} 62 | {{- if .Values.oauth.google.enabled}} 63 | - name: GOOGLE_CLIENT_ID 64 | valueFrom: 65 | secretKeyRef: 66 | name: {{ template "fullname" . }} 67 | key: go_client_id 68 | - name: GOOGLE_CLIENT_SECRET 69 | valueFrom: 70 | secretKeyRef: 71 | name: {{ template "fullname" . }} 72 | key: go_client_secret 73 | - name: GOOGLE_DOMAINS 74 | valueFrom: 75 | secretKeyRef: 76 | name: {{ template "fullname" . }} 77 | key: go_domains 78 | - name: PUBLIC_URL 79 | valueFrom: 80 | secretKeyRef: 81 | name: {{ template "fullname" . }} 82 | key: go_public_url 83 | {{- end }} 84 | {{- end }} 85 | ports: 86 | - containerPort: 8888 87 | name: api 88 | livenessProbe: 89 | httpGet: 90 | path: /ping 91 | port: api 92 | readinessProbe: 93 | httpGet: 94 | path: /ping 95 | port: api 96 | volumeMounts: 97 | - name: data 98 | mountPath: /var/lib/chronograf 99 | resources: 100 | {{ toYaml .Values.resources | indent 10 }} 101 | volumes: 102 | - name: data 103 | {{- if .Values.persistence.enabled }} 104 | persistentVolumeClaim: 105 | claimName: {{ template "fullname" . }} 106 | {{ else }} 107 | emptyDir: {} 108 | {{ end }} -------------------------------------------------------------------------------- /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 | image: 4 | repository: "quay.io/influxdb/chronograf" 5 | tag: "latest" 6 | pullPolicy: "Always" 7 | 8 | ## Specify a service type 9 | ## ClusterIP is default 10 | ## ref: http://kubernetes.io/docs/user-guide/services/ 11 | ## 12 | service: 13 | replicas: 1 14 | type: LoadBalancer 15 | 16 | ## Persist data to a persitent volume 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 | ## Configure the ingress object to hook into existing infastructure 39 | ## ref : http://kubernetes.io/docs/user-guide/ingress/ 40 | ## OPTIONALLY you can set .Values.ingress.secretName to set which secret to use 41 | ## 42 | ingress: 43 | enabled: false 44 | tls: false 45 | hostname: chronograf.foobar.com 46 | annotations: 47 | # kubernetes.io/ingress.class: "nginx" 48 | # secretName: my-tls-cert 49 | # kubernetes.io/tls-acme: "true" 50 | 51 | ## OAuth Settings for OAuth Providers 52 | ## More information -> https://github.com/influxdata/chronograf/blob/master/docs/auth.md 53 | ## 54 | oauth: 55 | # Need to set to true to use any of the oauth options 56 | enabled: false 57 | # Used for JWT to support running multiple copies of Chronograf 58 | token_secret: CHANGE_ME 59 | github: 60 | enabled: false 61 | client_id: CHANGE_ME 62 | client_secret: CHANGE_ME 63 | # This is a comma seperated list of GH organizations (OPTIONAL) 64 | gh_orgs: "" 65 | google: 66 | enabled: false 67 | client_id: CHANGE_ME 68 | client_secret: CHANGE_ME 69 | public_url: "" # eg. http://chronograf.foobar.com 70 | # This is a comma seperated list of Google Apps domains (OPTIONAL) 71 | google_domains: "" 72 | heroku: 73 | enabled: false 74 | client_id: CHANGE_ME 75 | client_secret: CHANGE_ME 76 | # This is a comma seperated list of Heroku organizations (OPTIONAL) 77 | he_orgs: "" 78 | -------------------------------------------------------------------------------- /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 | kkubectl get svc -w --namespace tick -l app=dash-chronograf -------------------------------------------------------------------------------- /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: 0.2.1 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: Jack Zampolin 13 | email: jack@influxdb.com 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.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 | 33 | [coordinator] 34 | write-timeout = "{{ .Values.config.coordinator.write_timeout }}" 35 | max-concurrent-queries = {{ .Values.config.coordinator.max_concurrent_queries | int64 }} 36 | query-timeout = "{{ .Values.config.coordinator.query_timeout }}" 37 | log-queries-after = "{{ .Values.config.coordinator.log_queries_after }}" 38 | max-select-point = {{ .Values.config.coordinator.max_select_point | int64 }} 39 | max-select-series = {{ .Values.config.coordinator.max_select_series | int64 }} 40 | max-select-buckets = {{ .Values.config.coordinator.max_select_buckets | int64 }} 41 | 42 | [retention] 43 | enabled = {{ .Values.config.retention.enabled }} 44 | check-interval = "{{ .Values.config.retention.check_interval }}" 45 | 46 | [shard-precreation] 47 | enabled = {{ .Values.config.shard_precreation.enabled }} 48 | check-interval = "{{ .Values.config.shard_precreation.check_interval }}" 49 | advance-period = "{{ .Values.config.shard_precreation.advance_period }}" 50 | 51 | [admin] 52 | enabled = {{ .Values.config.admin.enabled }} 53 | bind-address = ":{{ .Values.config.admin.bind_address }}" 54 | https-enabled = {{ .Values.config.admin.https_enabled }} 55 | https-certificate = "{{ .Values.config.admin.https_certificate }}" 56 | 57 | [monitor] 58 | store-enabled = {{ .Values.config.monitor.store_enabled }} 59 | store-database = "{{ .Values.config.monitor.store_database }}" 60 | store-interval = "{{ .Values.config.monitor.store_interval }}" 61 | 62 | [subscriber] 63 | enabled = {{ .Values.config.subscriber.enabled }} 64 | http-timeout = "{{ .Values.config.subscriber.http_timeout }}" 65 | insecure-skip-verify = {{ .Values.config.subscriber.insecure_skip_verify }} 66 | ca-certs = "{{ .Values.config.subscriber.ca_certs }}" 67 | write-concurrency = {{ .Values.config.subscriber.write_concurrency | int64 }} 68 | write-buffer-size = {{ .Values.config.subscriber.write_buffer_size | int64 }} 69 | 70 | [http] 71 | enabled = {{ .Values.config.http.enabled }} 72 | bind-address = ":{{ .Values.config.http.bind_address }}" 73 | auth-enabled = {{ .Values.config.http.auth_enabled }} 74 | log-enabled = {{ .Values.config.http.log_enabled }} 75 | write-tracing = {{ .Values.config.http.write_tracing }} 76 | pprof-enabled = {{ .Values.config.http.pprof_enabled }} 77 | https-enabled = {{ .Values.config.http.https_enabled }} 78 | https-certificate = "{{ .Values.config.http.https_certificate }}" 79 | https-private-key = "{{ .Values.config.http.https_private_key }}" 80 | max-row-limit = {{ .Values.config.http.max_row_limit | int64 }} 81 | max-connection-limit = {{ .Values.config.http.max_connection_limit | int64 }} 82 | shared-secret = "{{ .Values.config.http.shared_secret }}" 83 | realm = "{{ .Values.config.http.realm }}" 84 | unix-socket-enabled = {{ .Values.config.http.unix_socket_enabled }} 85 | bind-socket = "{{ .Values.config.http.bind_socket }}" 86 | 87 | # TODO: allow multiple graphite listeners with templates 88 | 89 | [[graphite]] 90 | enabled = {{ .Values.config.graphite.enabled }} 91 | bind-address = ":{{ .Values.config.graphite.bind_address }}" 92 | database = "{{ .Values.config.graphite.database }}" 93 | retention-policy = "{{ .Values.config.graphite.retention_policy }}" 94 | protocol = "{{ .Values.config.graphite.protocol }}" 95 | batch-size = {{ .Values.config.graphite.batch_size | int64 }} 96 | batch-pending = {{ .Values.config.graphite.batch_pending | int64 }} 97 | batch-timeout = "{{ .Values.config.graphite.batch_timeout }}" 98 | consistency-level = "{{ .Values.config.graphite.consistency_level }}" 99 | separator = "{{ .Values.config.graphite.separator }}" 100 | udp-read-buffer = {{ .Values.config.graphite.udp_read_buffer | int64 }} 101 | 102 | # TODO: allow multiple collectd listeners with templates 103 | 104 | [[collectd]] 105 | enabled = {{ .Values.config.collectd.enabled }} 106 | bind-address = ":{{ .Values.config.collectd.bind_address }}" 107 | database = "{{ .Values.config.collectd.database }}" 108 | retention-policy = "{{ .Values.config.collectd.retention_policy }}" 109 | batch-size = {{ .Values.config.collectd.batch_size | int64 }} 110 | batch-pending = {{ .Values.config.collectd.batch_pending | int64 }} 111 | batch-timeout = "{{ .Values.config.collectd.batch_timeout }}" 112 | read-buffer = {{ .Values.config.collectd.read_buffer | int64 }} 113 | typesdb = "{{ .Values.config.collectd.typesdb }}" 114 | security-level = "{{ .Values.config.collectd.security_level }}" 115 | auth-file = "{{ .Values.config.collectd.auth_file }}" 116 | 117 | # TODO: allow multiple opentsdb listeners with templates 118 | 119 | [[opentsdb]] 120 | enabled = {{ .Values.config.opentsdb.enabled }} 121 | bind-address = ":{{ .Values.config.opentsdb.bind_address }}" 122 | database = "{{ .Values.config.opentsdb.database }}" 123 | retention-policy = "{{ .Values.config.opentsdb.retention_policy }}" 124 | consistency-level = "{{ .Values.config.opentsdb.consistency_level }}" 125 | tls-enabled = {{ .Values.config.opentsdb.tls_enabled }} 126 | certificate = "{{ .Values.config.opentsdb.certificate }}" 127 | batch-size = {{ .Values.config.opentsdb.batch_size | int64 }} 128 | batch-pending = {{ .Values.config.opentsdb.batch_pending | int64 }} 129 | batch-timeout = "{{ .Values.config.opentsdb.batch_timeout }}" 130 | log-point-errors = {{ .Values.config.opentsdb.log_point_errors }} 131 | 132 | # TODO: allow multiple udp listeners with templates 133 | 134 | [[udp]] 135 | enabled = {{ .Values.config.udp.enabled }} 136 | bind-address = ":{{ .Values.config.udp.bind_address }}" 137 | database = "{{ .Values.config.udp.database }}" 138 | retention-policy = "{{ .Values.config.udp.retention_policy }}" 139 | batch-size = {{ .Values.config.udp.batch_size | int64 }} 140 | batch-pending = {{ .Values.config.udp.batch_pending | int64 }} 141 | read-buffer = {{ .Values.config.udp.read_buffer | int64 }} 142 | batch-timeout = "{{ .Values.config.udp.batch_timeout }}" 143 | precision = "{{ .Values.config.udp.precision }}" 144 | 145 | [continuous_queries] 146 | log-enabled = {{ .Values.config.continuous_queries.log_enabled }} 147 | enabled = {{ .Values.config.continuous_queries.enabled }} 148 | run-interval = "{{ .Values.config.continuous_queries.run_interval }}" 149 | 150 | 151 | -------------------------------------------------------------------------------- /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 | spec: 17 | containers: 18 | - name: {{ template "fullname" . }} 19 | image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" 20 | imagePullPolicy: {{ .Values.image.pullPolicy | quote }} 21 | resources: 22 | {{ toYaml .Values.resources | indent 10 }} 23 | ports: 24 | - name: api 25 | containerPort: {{ .Values.config.http.bind_address -}} 26 | {{- if .Values.config.admin.enabled -}} 27 | - name: admin 28 | containerPort: {{ .Values.config.admin.bind_address }} 29 | {{- end }} 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 | volumes: 64 | - name: data 65 | {{- if .Values.persistence.enabled }} 66 | persistentVolumeClaim: 67 | claimName: {{ template "fullname" . }} 68 | {{- else }} 69 | emptyDir: {} 70 | {{- end }} 71 | - name: config 72 | configMap: 73 | name: {{ template "fullname" . }} 74 | -------------------------------------------------------------------------------- /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.admin.enabled }} 19 | - name: admin 20 | port: {{ .Values.config.admin.bind_address }} 21 | targetPort: {{ .Values.config.admin.bind_address }} 22 | {{- end }} 23 | {{- if .Values.config.graphite.enabled }} 24 | - name: graphite 25 | port: {{ .Values.config.graphite.bind_address }} 26 | targetPort: {{ .Values.config.graphite.bind_address }} 27 | {{- end }} 28 | {{- if .Values.config.collectd.enabled }} 29 | - name: collectd 30 | port: {{ .Values.config.collectd.bind_address }} 31 | targetPort: {{ .Values.config.collectd.bind_address }} 32 | {{- end }} 33 | {{- if .Values.config.udp.enabled }} 34 | - name: udp 35 | port: {{ .Values.config.udp.bind_address }} 36 | targetPort: {{ .Values.config.udp.bind_address }} 37 | {{- end }} 38 | {{- if .Values.config.opentsdb.enabled }} 39 | - name: opentsdb 40 | port: {{ .Values.config.opentsdb.bind_address }} 41 | targetPort: {{ .Values.config.opentsdb.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.2-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 | ## Change InfluxDB configuration paramaters below: 37 | ## Defaults are indicated 38 | ## ref: https://docs.influxdata.com/influxdb/v1.1/administration/config/ 39 | config: 40 | reporting_disabled: false 41 | bind_address: 8088 42 | storage_directory: /var/lib/influxdb 43 | meta: 44 | retention_autocreate: true 45 | logging_enabled: true 46 | data: 47 | query_log_enabled: true 48 | cache_max_memory_size: 1073741824 49 | cache_snapshot_memory_size: 26214400 50 | cache_snapshot_write_cold_duration: 10m0s 51 | compact_full_write_cold_duration: 4h0m0s 52 | max_series_per_database: 1000000 53 | max_values_per_tag: 100000 54 | trace_logging_enabled: false 55 | coordinator: 56 | write_timeout: 10s 57 | max_concurrent_queries: 0 58 | query_timeout: 0s 59 | log_queries_after: 0s 60 | max_select_point: 0 61 | max_select_series: 0 62 | max_select_buckets: 0 63 | retention: 64 | enabled: true 65 | check_interval: 30m0s 66 | shard_precreation: 67 | enabled: true 68 | check_interval: 10m0s 69 | advance_period: 30m0s 70 | admin: 71 | enabled: false 72 | bind_address: 8083 73 | https_enabled: false 74 | https_certificate: /etc/ssl/influxdb.pem 75 | monitor: 76 | store_enabled: true 77 | store_database: _internal 78 | store_interval: 10s 79 | subscriber: 80 | enabled: true 81 | http_timeout: 30s 82 | insecure_skip_verify: false 83 | ca_certs: "" 84 | write_concurrency: 40 85 | write_buffer_size: 1000 86 | http: 87 | enabled: true 88 | bind_address: 8086 89 | auth_enabled: false 90 | log_enabled: true 91 | write_tracing: false 92 | pprof_enabled: true 93 | https_enabled: false 94 | https_certificate: /etc/ssl/influxdb.pem 95 | https_private_key: "" 96 | max_row_limit: 10000 97 | max_connection_limit: 0 98 | shared_secret: "beetlejuicebeetlejuicebeetlejuice" 99 | realm: InfluxDB 100 | unix_socket_enabled: false 101 | bind_socket: /var/run/influxdb.sock 102 | graphite: 103 | enabled: false 104 | bind_address: 2003 105 | database: graphite 106 | retention_policy: autogen 107 | protocol: tcp 108 | batch_size: 5000 109 | batch_pending: 10 110 | batch_timeout: 1s 111 | consistency_level: one 112 | separator: . 113 | udp_read_buffer: 0 114 | collectd: 115 | enabled: false 116 | bind_address: 25826 117 | database: collectd 118 | retention_policy: autogen 119 | batch_size: 5000 120 | batch_pending: 10 121 | batch_timeout: 10s 122 | read_buffer: 0 123 | typesdb: /usr/share/collectd/types.db 124 | security_level: none 125 | auth_file: /etc/collectd/auth_file 126 | opentsdb: 127 | enabled: false 128 | bind_address: 4242 129 | database: opentsdb 130 | retention_policy: autogen 131 | consistency_level: one 132 | tls_enabled: false 133 | certificate: /etc/ssl/influxdb.pem 134 | batch_size: 1000 135 | batch_pending: 5 136 | batch_timeout: 1s 137 | log_point_errors: true 138 | udp: 139 | enabled: false 140 | bind_address: 8089 141 | database: udp 142 | retention_policy: autogen 143 | batch_size: 5000 144 | batch_pending: 10 145 | read_buffer: 0 146 | batch_timeout: 1s 147 | precision: "ns" 148 | continuous_queries: 149 | log_enabled: true 150 | enabled: true 151 | run_interval: 1s 152 | -------------------------------------------------------------------------------- /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: 0.2.1 3 | description: InfluxDB's native data 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: Jack Zampolin 14 | email: jack@influxdb.com 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/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 | spec: 18 | containers: 19 | - name: {{ .Chart.Name }} 20 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 21 | imagePullPolicy: {{ .Values.image.pullPolicy }} 22 | env: 23 | - name: KAPACITOR_HOSTNAME 24 | value: {{ template "fullname" . }}.{{ .Release.Namespace }} 25 | - name: KAPACITOR_INFLUXDB_0_URLS_0 26 | value: {{ .Values.influxURL }} 27 | resources: 28 | {{ toYaml .Values.resources | indent 10 }} 29 | ports: 30 | - containerPort: 9092 31 | volumeMounts: 32 | - name: data 33 | mountPath: /var/lib/kapacitor 34 | volumes: 35 | - name: data 36 | {{- if .Values.persistence.enabled }} 37 | persistentVolumeClaim: 38 | claimName: {{ template "fullname" . }} 39 | {{- else }} 40 | emptyDir: {} 41 | {{- end }} 42 | {{- end }} -------------------------------------------------------------------------------- /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 | ## influxdb image version 2 | ## ref: https://hub.docker.com/r/library/influxdb/tags/ 3 | ## 4 | image: 5 | repository: "kapacitor" 6 | tag: "1.2" 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 | ## Set the URL of InfluxDB instance to create subscription on 39 | ## ref: https://docs.influxdata.com/kapacitor/v1.1/introduction/getting_started/ 40 | ## 41 | influxURL: http://data-influxdb.tick:8086 42 | -------------------------------------------------------------------------------- /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: 0.1.0 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: Jack Zampolin 12 | email: jack@influxdb.com 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 | {{- if empty .Values.config.outputs.influxdb.url }} 2 | 3 | Need to set an InfluxDB url to deploy this instance: 4 | 5 | .Values.config.outputs.influxdb.url 6 | 7 | {{- else }} 8 | To open a shell session in the container running Telegraf run the following: 9 | 10 | - 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 11 | 12 | To tail the logs for a Telegraf pod in the Daemonset run the following: 13 | 14 | - kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 15 | 16 | To list the running Telegraf instances run the following: 17 | 18 | - kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -w 19 | 20 | {{- end }} -------------------------------------------------------------------------------- /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 | */}} -------------------------------------------------------------------------------- /telegraf-ds/templates/conifgmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if not (empty .Values.config.outputs.influxdb.url) }} 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 | {{- if .Values.config.global_tags }} 14 | [global_tags] 15 | {{- range $key, $val := .Values.config.global_tags }} 16 | {{ $key }} = {{ $val | quote }} 17 | {{- end }} 18 | {{- end }} 19 | [agent] 20 | interval = {{ .Values.config.agent.interval | quote }} 21 | round_interval = {{ .Values.config.agent.round_interval }} 22 | metric_batch_size = {{ .Values.config.agent.metric_batch_size }} 23 | metric_buffer_limit = {{ .Values.config.agent.metric_buffer_limit }} 24 | collection_jitter = {{ .Values.config.agent.collection_jitter | quote }} 25 | flush_interval = {{ .Values.config.agent.flush_interval | quote }} 26 | flush_jitter = {{ .Values.config.agent.flush_jitter | quote }} 27 | precision = "" 28 | debug = false 29 | quiet = true 30 | logfile = "" 31 | hostname = "$HOSTNAME" 32 | omit_hostname = false 33 | [[outputs.influxdb]] 34 | urls = [{{ .Values.config.outputs.influxdb.url | quote }}] 35 | database = {{ .Values.config.outputs.influxdb.database | quote }} 36 | retention_policy = {{ .Values.config.outputs.influxdb.retention_policy | quote }} 37 | write_consistency = "any" 38 | timeout = {{ .Values.config.outputs.influxdb.timeout | quote }} 39 | username = {{ .Values.config.outputs.influxdb.username | quote }} 40 | password = {{ .Values.config.outputs.influxdb.password | quote }} 41 | user_agent = {{ .Values.config.outputs.influxdb.user_agent | quote }} 42 | insecure_skip_verify = {{ .Values.config.outputs.influxdb.insecure_skip_verify }} 43 | [[inputs.cpu]] 44 | percpu = true 45 | totalcpu = true 46 | collect_cpu_time = false 47 | [[inputs.disk]] 48 | ignore_fs = ["tmpfs", "devtmpfs"] 49 | [[inputs.diskio]] 50 | [[inputs.docker]] 51 | endpoint = {{ .Values.config.inputs.docker.endpoint | quote }} 52 | container_names = [] 53 | timeout = {{ .Values.config.inputs.docker.timeout | quote }} 54 | perdevice = {{ .Values.config.inputs.docker.perdevice }} 55 | total = {{ .Values.config.inputs.docker.total }} 56 | [[inputs.kernel]] 57 | [[inputs.kubernetes]] 58 | url = {{ .Values.config.inputs.kubernetes.url | quote }} 59 | bearer_token = {{ .Values.config.inputs.kubernetes.bearer_token | quote }} 60 | insecure_skip_verify = {{ .Values.config.inputs.kubernetes.insecure_skip_verify }} 61 | [[inputs.mem]] 62 | [[inputs.processes]] 63 | [[inputs.swap]] 64 | [[inputs.system]] 65 | {{- end -}} -------------------------------------------------------------------------------- /telegraf-ds/templates/daemonset.yaml: -------------------------------------------------------------------------------- 1 | {{- if not (empty .Values.config.outputs.influxdb.url) }} 2 | apiVersion: extensions/v1beta1 3 | kind: DaemonSet 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | spec: 11 | template: 12 | metadata: 13 | labels: 14 | app: {{ template "fullname" . }} 15 | spec: 16 | containers: 17 | - name: {{ template "fullname" . }} 18 | image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" 19 | imagePullPolicy: {{ default "" .Values.image.pullPolicy | quote }} 20 | resources: 21 | {{ toYaml .Values.resources | indent 10 }} 22 | env: 23 | # This pulls HOSTNAME from the node, not the pod. 24 | - name: HOSTNAME 25 | valueFrom: 26 | fieldRef: 27 | fieldPath: spec.nodeName 28 | - name: "HOST_PROC" 29 | value: "/rootfs/proc" 30 | - name: "HOST_SYS" 31 | value: "/rootfs/sys" 32 | volumeMounts: 33 | - name: sysro 34 | mountPath: /rootfs/sys 35 | readOnly: true 36 | - name: procro 37 | mountPath: /rootfs/proc 38 | readOnly: true 39 | - name: docker-socket 40 | mountPath: /var/run/docker.sock 41 | - name: varrunutmpro 42 | mountPath: /var/run/utmp 43 | readOnly: true 44 | - name: config 45 | mountPath: /etc/telegraf 46 | volumes: 47 | - name: sysro 48 | hostPath: 49 | path: /sys 50 | - name: docker-socket 51 | hostPath: 52 | path: /var/run/docker.sock 53 | - name: procro 54 | hostPath: 55 | path: /proc 56 | - name: varrunutmpro 57 | hostPath: 58 | path: /var/run/utmp 59 | - name: config 60 | configMap: 61 | name: {{ template "fullname" . }} 62 | {{- end -}} -------------------------------------------------------------------------------- /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.2.1-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 | ## Exposed telegraf configuration 20 | ## ref: https://docs.influxdata.com/telegraf/v1.1/administration/configuration/ 21 | config: 22 | # global_tags: 23 | # cluster: "mycluster" 24 | agent: 25 | interval: "10s" 26 | round_interval: true 27 | metric_batch_size: 1000 28 | metric_buffer_limit: 10000 29 | collection_jitter: "0s" 30 | flush_interval: "10s" 31 | flush_jitter: "0s" 32 | outputs: 33 | influxdb: 34 | url: "http://data-influxdb.tick:8086" 35 | database: "telegraf" 36 | retention_policy: "" 37 | timeout: "5s" 38 | username: "" 39 | password: "" 40 | user_agent: "telegraf" 41 | insecure_skip_verify: false 42 | inputs: 43 | kubernetes: 44 | url: "http://$HOSTNAME:10255" 45 | bearer_token: "/var/run/secrets/kubernetes.io/serviceaccount/token" 46 | insecure_skip_verify: true 47 | docker: 48 | endpoint: "unix:///var/run/docker.sock" 49 | timeout: "5s" 50 | perdevice: true 51 | total: false -------------------------------------------------------------------------------- /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: 0.2.0 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: Jack Zampolin 12 | email: jack@influxdb.com 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 | > **Tip**: You can use the default [values.yaml](values.yaml) 60 | 61 | ## Telegraf Configuration 62 | 63 | This chart deploys the following by default: 64 | 65 | - `telegraf` (`telegraf-ds`) running in a daemonset with the following plugins enabled 66 | * [`cpu`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 67 | * [`disk`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 68 | * [`docker`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/docker) 69 | * [`diskio`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 70 | * [`kernel`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 71 | * [`kubernetes`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/kubernetes) 72 | * [`mem`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 73 | * [`processes`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 74 | * [`swap`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 75 | * [`system`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/system) 76 | 77 | - A single `telegraf` deployment (`telegraf-s`) with an associated service running the following plugins: 78 | * [`prometheus`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus) 79 | * [`influxdb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/influxdb) 80 | * [`statsd`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd) 81 | 82 | 83 | ### Supported Outputs 84 | 85 | 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`: 86 | 87 | - [`amqp`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/amqp) 88 | - [`influxdb`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/influxdb) 89 | - [`kafka`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/kafka) 90 | - [`mqtt`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/mqtt) 91 | - [`nats`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/nats) 92 | - [`nsq`](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/nsq) 93 | 94 | ### Service Plugins - Single Instance 95 | 96 | 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: 97 | 98 | - [`tcp_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/tcp_listener) 99 | - [`udp_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/udp_listener) 100 | - [`statsd`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd) 101 | - [`http_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/http_listener) 102 | 103 | ### Supported Inputs - Single Instance 104 | 105 | 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: 106 | 107 | - [`aerospike`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/aerospike) 108 | - [`apache`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/apache) 109 | - [`cassandra`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cassandra) 110 | - [`cloudwatch`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cloudwatch) 111 | - [`consul`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/consul) 112 | - [`couchbase`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/couchbase) 113 | - [`couchdb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/couchdb) 114 | - [`disque`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/disque) 115 | - [`dns_query`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/dns_query) 116 | - [`dovecot`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/dovecot) 117 | - [`elasticsearch`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/elasticsearch) 118 | - [`graylog`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/graylog) 119 | - [`haproxy`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/haproxy) 120 | - [`influxdb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/influxdb) 121 | - [`lustre2`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/lustre2) 122 | - [`mailchimp`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mailchimp) 123 | - [`memcached`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/memcached) 124 | - [`mesos`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mesos) 125 | - [`mongodb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mongodb) 126 | - [`mysql`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mysql) 127 | - [`net_response`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/net_response) 128 | - [`nginx`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nginx) 129 | - [`nsq`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nsq) 130 | - [`phpfpm`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/phpfpm) 131 | - [`ping`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ping) 132 | - [`postgresql`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/postgresql) 133 | - [`prometheus`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus) 134 | - [`rabbitmq`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/rabbitmq) 135 | - [`raindrops`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/raindrops) 136 | - [`redis`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/redis) 137 | - [`rethinkdb`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/rethinkdb) 138 | - [`riak`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/riak) 139 | - [`sqlserver`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sqlserver) 140 | - [`twemproxy`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/twemproxy) 141 | - [`zookeeper`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/zookeeper) 142 | - [`http_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/http_listener) 143 | - [`statsd`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd) 144 | - [`tcp_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/tcp_listener) 145 | - [`udp_listener`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/udp_listener) 146 | - [`webhooks`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/webhooks) 147 | 148 | ### Future work: 149 | 150 | There are a couple of additional plugins that could/should possibly be supported but are not yet: 151 | - `telegraf-s` 152 | - [`smnp`](https://github.com/influxdata/telegraf/tree/master/plugins/smnp) 153 | - `telegraf-ds` 154 | - [`jolokia`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/jolokia) 155 | - [`bcache`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/bcache) 156 | - [`cgroup`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/cgroup) 157 | - [`conntrack`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/conntrack) 158 | - [`exec`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec) 159 | - [`filestat`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/filestat) 160 | - [`hddtemp`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/hddtemp) 161 | - [`ipmi_sensor`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ipmi_sensor) 162 | - [`iptables`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/iptables) 163 | - [`leofs`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/leofs) 164 | - [`logparser`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/logparser) 165 | - [`nstat`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/nstat) 166 | - [`ntpq`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ntpq) 167 | - [`passenger`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/passenger) 168 | - [`powerdns`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/powerdns) 169 | - [`procstat`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/procstat) 170 | - [`puppetagent`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/puppetagent) 171 | - [`sysstat`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sysstat) 172 | - [`varnish`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/varnish) 173 | - [`win_perf_counters`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters) 174 | - [`zfs`](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/zfs) 175 | -------------------------------------------------------------------------------- /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 empty .Values.config.outputs.influxdb.urls }} 10 | 11 | Need to set an InfluxDB url for either s daemonset to deploy this instance: 12 | 13 | .Values.config.outputs.influxdb.urls 14 | 15 | {{- end }} -------------------------------------------------------------------------------- /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 $output, $config := . }} 54 | [[outputs.{{ $output }}]] 55 | {{- if $config }} 56 | {{- range $key, $value := $config -}} 57 | {{- $tp := typeOf $value }} 58 | {{- if eq $tp "string"}} 59 | {{ $key }} = {{ $value | quote }} 60 | {{- end }} 61 | {{- if eq $tp "float64"}} 62 | {{ $key }} = {{ $value | int64 }} 63 | {{- end }} 64 | {{- if eq $tp "int"}} 65 | {{ $key }} = {{ $value | int64 }} 66 | {{- end }} 67 | {{- if eq $tp "bool"}} 68 | {{ $key }} = {{ $value }} 69 | {{- end }} 70 | {{- if eq $tp "[]interface {}" }} 71 | {{ $key }} = [ 72 | {{- $numOut := len $value }} 73 | {{- $numOut := sub $numOut 1 }} 74 | {{- range $b, $val := $value }} 75 | {{- $i := int64 $b }} 76 | {{- if eq $i $numOut }} 77 | {{ $val | quote }} 78 | {{- else }} 79 | {{ $val | quote }}, 80 | {{- end }} 81 | {{- end }} 82 | ] 83 | {{- end }} 84 | {{- end }} 85 | {{- end }} 86 | {{- end }} 87 | {{- end -}} 88 | 89 | {{- define "inputs" -}} 90 | {{- range $input, $config := . -}} 91 | [[inputs.{{- $input }}]] 92 | {{- if $config -}} 93 | {{- range $key, $value := $config -}} 94 | {{- $tp := typeOf $value -}} 95 | {{- if eq $tp "string" }} 96 | {{ $key }} = {{ $value | quote }} 97 | {{- end }} 98 | {{- if eq $tp "float64" }} 99 | {{ $key }} = {{ $value | int64 }} 100 | {{- end }} 101 | {{- if eq $tp "int" }} 102 | {{ $key }} = {{ $value | int64 }} 103 | {{- end }} 104 | {{- if eq $tp "bool" }} 105 | {{ $key }} = {{ $value }} 106 | {{- end }} 107 | {{- if eq $tp "[]interface {}" }} 108 | {{ $key }} = [ 109 | {{- $numOut := len $value }} 110 | {{- $numOut := sub $numOut 1 }} 111 | {{- range $b, $val := $value }} 112 | {{- $i := int64 $b }} 113 | {{- $tp := typeOf $val }} 114 | {{- if eq $i $numOut }} 115 | {{- if eq $tp "string" }} 116 | {{ $val | quote }} 117 | {{- end }} 118 | {{- if eq $tp "float64" }} 119 | {{ $val | int64 }} 120 | {{- end }} 121 | {{- else }} 122 | {{- if eq $tp "string" }} 123 | {{ $val | quote }}, 124 | {{- end}} 125 | {{- if eq $tp "float64" }} 126 | {{ $val | int64 }}, 127 | {{- end }} 128 | {{- end }} 129 | {{- end }} 130 | ] 131 | {{- end }} 132 | {{- if eq $tp "map[string]interface {}" }} 133 | [[inputs.{{ $input }}.{{ $key }}]] 134 | {{- range $k, $v := $value }} 135 | {{- $tps := typeOf $v }} 136 | {{- if eq $tps "string" }} 137 | {{ $k }} = {{ $v }} 138 | {{- end }} 139 | {{- if eq $tps "[]interface {}"}} 140 | {{ $k }} = [ 141 | {{- $numOut := len $value }} 142 | {{- $numOut := sub $numOut 1 }} 143 | {{- range $b, $val := $v }} 144 | {{- $i := int64 $b }} 145 | {{- if eq $i $numOut }} 146 | {{ $val | quote }} 147 | {{- else }} 148 | {{ $val | quote }}, 149 | {{- end }} 150 | {{- end }} 151 | ] 152 | {{- end }} 153 | {{- if eq $tps "map[string]interface {}"}} 154 | [[inputs.{{ $input }}.{{ $key }}.{{ $k }}]] 155 | {{- range $foo, $bar := $v }} 156 | {{ $foo }} = {{ $bar | quote }} 157 | {{- end }} 158 | {{- end }} 159 | {{- end }} 160 | {{- end }} 161 | {{- end }} 162 | {{- end }} 163 | {{ end }} 164 | {{- end -}} -------------------------------------------------------------------------------- /telegraf-s/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if gt (len .Values.config.outputs.influxdb.urls) 0 }} 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 -}} 17 | {{- end -}} -------------------------------------------------------------------------------- /telegraf-s/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{- if gt (len .Values.config.outputs.influxdb.urls) 0 }} 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | spec: 11 | replicas: 1 12 | template: 13 | metadata: 14 | labels: 15 | app: {{ template "fullname" . }} 16 | spec: 17 | containers: 18 | - name: {{ template "fullname" . }} 19 | image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}" 20 | imagePullPolicy: {{ default "" .Values.image.pullPolicy | quote }} 21 | resources: 22 | {{ toYaml .Values.resources | indent 10 }} 23 | volumeMounts: 24 | - name: config 25 | mountPath: /etc/telegraf 26 | volumes: 27 | - name: config 28 | configMap: 29 | name: {{ template "fullname" . }} 30 | {{- end -}} -------------------------------------------------------------------------------- /telegraf-s/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.service.enabled -}} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ template "fullname" . }} 6 | labels: 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | spec: 9 | type: {{ .Values.service.type }} 10 | ports: 11 | {{- range $key, $value := .Values.config.inputs }} 12 | {{- if eq $key "http_listener" }} 13 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 14 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 15 | name: "http-listener" 16 | {{- end }} 17 | {{- if eq $key "statsd" }} 18 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 19 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 20 | name: "statsd" 21 | {{- end }} 22 | {{- if eq $key "tcp-listener" }} 23 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 24 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 25 | name: "tcp_listener" 26 | {{- end }} 27 | {{- if eq $key "udp-listener" }} 28 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 29 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 30 | name: "udp_listener" 31 | {{- end }} 32 | {{- if eq $key "webhooks" }} 33 | - port: {{ trimPrefix ":" $value.service_address | int64 }} 34 | targetPort: {{ trimPrefix ":" $value.service_address | int64 }} 35 | name: "webhooks" 36 | {{- end }} 37 | {{- end }} 38 | selector: 39 | app: {{ template "fullname" . }} 40 | {{- end -}} -------------------------------------------------------------------------------- /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.2.0-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 | ## Configure the service for this telegraf instance. If you are running 20 | ## Any of the service plugins you will need this enabled 21 | ## Service Plugins: http_listener, statsd, tcp_listener, udp_listener 22 | ## ref: http://kubernetes.io/docs/user-guide/services/ 23 | service: 24 | enabled: true 25 | type: ClusterIP 26 | 27 | ## Exposed telegraf configuration 28 | ## For full list of possible values see `/docs/all-config-values.yaml` and `/docs/all-config-values.toml` 29 | ## ref: https://docs.influxdata.com/telegraf/v1.1/administration/configuration/ 30 | config: 31 | ## global_tags: 32 | ## dc: "us-east-1" 33 | ## user: "$USER" 34 | agent: 35 | interval: "10s" 36 | round_interval: true 37 | metric_batch_size: 1000 38 | metric_buffer_limit: 10000 39 | collection_jitter: "0s" 40 | flush_interval: "10s" 41 | flush_jitter: "0s" 42 | precision: "" 43 | debug: false 44 | quiet: false 45 | logfile: "" 46 | hostname: "telegraf-polling-service" 47 | omit_hostname: false 48 | outputs: 49 | influxdb: 50 | urls: 51 | - "http://data-influxdb.tick:8086" 52 | database: "telegraf" 53 | ## retention_policy: "" 54 | ## write_consistency: "any" 55 | ## timeout: "5s" 56 | ## username: "telegraf" 57 | ## password: "metricsmetricsmetricsmetrics" 58 | ## user_agent: "telegraf" 59 | ## udp_payload: 512 60 | ## ssl_ca: "/etc/telegraf/ca.pem" 61 | ## ssl_cert: "/etc/telegraf/cert.pem" 62 | ## ssl_key: "/etc/telegraf/key.pem" 63 | ## insecure_skip_verify: false 64 | ## amqp: 65 | ## url: "amqp://localhost:5672/influxdb" 66 | ## exchange: "telegraf" 67 | ## auth_method: "PLAIN" 68 | ## routing_tag: "host" 69 | ## retention_policy: "default" 70 | ## database: "telegraf" 71 | ## precision: "s" 72 | ## ssl_ca: "/etc/telegraf/ca.pem" 73 | ## ssl_cert: "/etc/telegraf/cert.pem" 74 | ## ssl_key: "/etc/telegraf/key.pem" 75 | ## insecure_skip_verify: false 76 | ## data_format: "influx" 77 | ## kafka: 78 | ## brokers: 79 | ## - "localhost:9092" 80 | ## topic: "telegraf" 81 | ## routing_tag: "host" 82 | ## compression_codec: 0 83 | ## required_acks: -1 84 | ## max_retry: 3 85 | ## ssl_ca: "/etc/telegraf/ca.pem" 86 | ## ssl_cert: "/etc/telegraf/cert.pem" 87 | ## ssl_key: "/etc/telegraf/key.pem" 88 | ## insecure_skip_verify: false 89 | ## data_format: "influx" 90 | ## mqtt: 91 | ## servers: 92 | ## - "localhost:1883" 93 | ## topic_prefix: "telegraf" 94 | ## username: "telegraf" 95 | ## password: "metricsmetricsmetricsmetrics" 96 | ## ssl_ca: "/etc/telegraf/ca.pem" 97 | ## ssl_cert: "/etc/telegraf/cert.pem" 98 | ## ssl_key: "/etc/telegraf/key.pem" 99 | ## insecure_skip_verify: false 100 | ## data_format: "influx" 101 | ## nats: 102 | ## servers: 103 | ## - "nats://localhost:4222" 104 | ## username: "" 105 | ## password: "" 106 | ## subject: "telegraf" 107 | ## ssl_ca: "/etc/telegraf/ca.pem" 108 | ## ssl_cert: "/etc/telegraf/cert.pem" 109 | ## ssl_key: "/etc/telegraf/key.pem" 110 | ## insecure_skip_verify: false 111 | ## data_format: "influx" 112 | ## nsq: 113 | ## server: "localhost:4150" 114 | ## topic: "telegraf" 115 | ## data_format: "influx" 116 | 117 | # CPU and System is required for chronograf 118 | # This may show errors in the logs, but this does not affect performance or functionality 119 | inputs: 120 | cpu: 121 | percpu: false 122 | totalcpu: true 123 | system: 124 | ## aerospike: 125 | ## servers: 126 | ## - "localhost:3000" 127 | ## apache: 128 | ## urls: 129 | ## - "http://localhost/server-status?auto" 130 | ## cassandra: 131 | ## context: "/jolokia/read" 132 | ## servers: 133 | ## - "myuser:mypassword@10.10.10.1:8778" 134 | ## - "10.10.10.2:8778" 135 | ## - ":8778" 136 | ## metrics : 137 | ## - "/java.lang:type=Memory/HeapMemoryUsage" 138 | ## - "/org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=ReadLatency" 139 | ## cloudwatch: 140 | ## region: "us-east-1" 141 | ## access_key: "" 142 | ## secret_key: "" 143 | ## token: "" 144 | ## role_arn: "" 145 | ## profile: "" 146 | ## shared_credential_file: "" 147 | ## period: "5m" 148 | ## delay: "5m" 149 | ## interval: "5m" 150 | ## cache_ttl: "10m" 151 | ## namespace: "AWS/ELB" 152 | ## ratelimit: 10 153 | ## metrics: 154 | ## names: 155 | ## - "Latency" 156 | ## - "RequestCount" 157 | ## dimensions: 158 | ## name: "LoadBalancerName" 159 | ## value: "p-example" 160 | ## consul: 161 | ## address: "localhost" 162 | ## scheme: "http" 163 | ## token: "" 164 | ## username: "" 165 | ## password: "" 166 | ## datacentre: "" 167 | ## couchbase: 168 | ## servers: 169 | ## - "http://localhost:8091" 170 | ## couchdb: 171 | ## hosts: 172 | ## - "http://localhost:8086/_stats" 173 | ## disque: 174 | ## servers: 175 | ## - "localhost" 176 | ## dns_query: 177 | ## servers: 178 | ## - "8.8.8.8" 179 | ## domains: 180 | ## - "." 181 | ## record_type: "A" 182 | ## port: 53 183 | ## timeout: 2 184 | ## dovecot: 185 | ## servers: 186 | ## - "localhost:24242" 187 | ## type: "global" 188 | ## filters: 189 | ## - "" 190 | ## elasticsearch: 191 | ## servers: 192 | ## - "http://localhost:9200" 193 | ## http_timeout: "5s" 194 | ## local: true 195 | ## cluster_health: false 196 | ## ssl_ca: "/etc/telegraf/ca.pem" 197 | ## ssl_cert: "/etc/telegraf/cert.pem" 198 | ## ssl_key: "/etc/telegraf/key.pem" 199 | ## insecure_skip_verify: false 200 | ## graylog: 201 | ## servers: 202 | ## - "http://[graylog-server-ip]:12900/system/metrics/multiple" 203 | ## metrics: 204 | ## - "jvm.cl.loaded" 205 | ## - "jvm.memory.pools.Metaspace.committed" 206 | ## username: "" 207 | ## password: "" 208 | ## ssl_ca: "/etc/telegraf/ca.pem" 209 | ## ssl_cert: "/etc/telegraf/cert.pem" 210 | ## ssl_key: "/etc/telegraf/key.pem" 211 | ## insecure_skip_verify: false 212 | ## haproxy: 213 | ## servers: 214 | ## - "http://myhaproxy.com:1936/haproxy?stats" 215 | influxdb: 216 | urls: 217 | - "http://data-influxdb.tick:8086/debug/vars" 218 | timeout: "5s" 219 | ## lustre2: 220 | ## ost_procfiles: 221 | ## - "/proc/fs/lustre/obdfilter/*/stats" 222 | ## - "/proc/fs/lustre/osd-ldiskfs/*/stats" 223 | ## - "/proc/fs/lustre/obdfilter/*/job_stats" 224 | ## mds_procfiles: 225 | ## - "/proc/fs/lustre/mdt/*/md_stats" 226 | ## - "/proc/fs/lustre/mdt/*/job_stats" 227 | ## mailchimp: 228 | ## api_key: "" 229 | ## days_old: 0 230 | ## campaign_id: "" 231 | ## memcached: 232 | ## servers: 233 | ## - "localhost:11211" 234 | ## unix_sockets: 235 | ## - "/var/run/memcached.sock" 236 | ## mesos: 237 | ## timeout: 100 238 | ## masters: 239 | ## - "localhost:5050" 240 | ## master_collections: 241 | ## - "resources" 242 | ## - "master" 243 | ## - "system" 244 | ## - "agents" 245 | ## - "frameworks" 246 | ## - "tasks" 247 | ## - "messages" 248 | ## - "evqueue" 249 | ## - "registrar" 250 | ## slaves: 251 | ## - 252 | ## slave_collections: 253 | ## - "resources" 254 | ## - "agent" 255 | ## - "system" 256 | ## - "executors" 257 | ## - "tasks" 258 | ## - "messages" 259 | ## mongodb: 260 | ## servers: 261 | ## - "mongodb://user:password@127.0.0.1:27017" 262 | ## gather_perdb_stats: false 263 | ## mysql: 264 | ## servers: 265 | ## - "tcp(127.0.0.1:3306)?tls=false" 266 | ## perf_events_statements_digest_text_limit : 120 267 | ## perf_events_statements_limit: 250 268 | ## perf_events_statements_time_limit : 86400 269 | ## table_schema_databases: [] 270 | ## gather_table_schema: false 271 | ## gather_process_list: true 272 | ## gather_info_schema_auto_inc: true 273 | ## gather_slave_status: true 274 | ## gather_binary_logs: false 275 | ## gather_table_io_waits: false 276 | ## gather_table_lock_waits: false 277 | ## gather_index_io_waits: false 278 | ## gather_event_waits: false 279 | ## gather_file_events_stats: false 280 | ## gather_perf_events_statements: false 281 | ## interval_slow: "30m" 282 | ## net_response: 283 | ## protocol: "tcp" 284 | ## address: "github.com:80" 285 | ## timeout: "1s" 286 | ## send: "ssh" 287 | ## expect: "ssh" 288 | ## read_timeout: "1s" 289 | ## nginx: 290 | ## urls: 291 | ## - "http://nginx.kube-system:18080/status" 292 | ## nsq: 293 | ## endpoints: 294 | ## - "http://localhost:4151" 295 | ## phpfpm: 296 | ## urls: 297 | ## - "http://localhost/status" 298 | ## ping: 299 | ## urls: 300 | ## - "www.google.com" 301 | ## count: 1 302 | ## ping_interval: 1.0 303 | ## timeout: 1.0 304 | ## interface: "" 305 | ## postgresql: 306 | ## address: "postgres://user:password@localhost?sslmode=disable" 307 | ## ignored_databases: 308 | ## - "postgres" 309 | ## databases: 310 | ## - "app_production" 311 | ## - "testing" 312 | prometheus: 313 | urls: 314 | - "https://kubernetes.default:443/metrics" 315 | name_prefix: "prom_" 316 | bearer_token: "/var/run/secrets/kubernetes.io/serviceaccount/token" 317 | insecure_skip_verify: true 318 | ## ssl_ca: /path/to/cafile 319 | ## ssl_cert: /path/to/certfile 320 | ## ssl_key: /path/to/keyfile 321 | ## rabbitmq: 322 | ## url: "http://localhost:15672" 323 | ## name: "rmq-server-1" 324 | ## username: "guest" 325 | ## password: "guest" 326 | ## ssl_ca: "/etc/telegraf/ca.pem" 327 | ## ssl_cert: "/etc/telegraf/cert.pem" 328 | ## ssl_key: "/etc/telegraf/key.pem" 329 | ## insecure_skip_verify: false 330 | ## nodes: 331 | ## - "rabbit@node1" 332 | ## - "rabbit@node2" 333 | ## raindrops: 334 | ## urls: 335 | ## - "http://localhost:8080/_raindrops" 336 | ## redis: 337 | ## servers: 338 | ## - "tcp://localhost:6379" 339 | ## rethinkdb: 340 | ## servers: 341 | ## - "127.0.0.1:28015" 342 | ## riak: 343 | ## servers: 344 | ## - "http://localhost:8098" 345 | ## sqlserver: 346 | ## servers: 347 | ## - "Server=192.168.1.10;Port=1433;User Id=;Password=;app name=telegraf;log=1;" 348 | ## twemproxy: 349 | ## addr: "localhost:22222" 350 | ## pools: 351 | ## - "redis_pool" 352 | ## - "mc_pool" 353 | ## zookeeper: 354 | ## servers: 355 | ## - "localhost:2181" 356 | ## http_listener: 357 | ## service_address: ":8186" 358 | ## read_timeout: "10s" 359 | ## write_timeout: "10s" 360 | ## max_body_size: 0 361 | ## max_line_size: 0 362 | statsd: 363 | service_address: ":8125" 364 | percentiles: 365 | - 50 366 | - 95 367 | - 99 368 | metric_separator: "_" 369 | allowed_pending_messages: 10000 370 | percentile_limit: 1000 --------------------------------------------------------------------------------