diff --git a/comcast/README.md b/comcast/README.md index 4758a2dd..4b89de68 100644 --- a/comcast/README.md +++ b/comcast/README.md @@ -1,4 +1,4 @@ -# Comcast Data Cap Usage Collector For InfluxDB and Grafana** +# Comcast Data Cap Usage Collector For InfluxDB and Grafana ![Screenshot](https://github.com/billimek/comcastUsage-for-influxdb/raw/master/images/comcast_grafana_example.png) diff --git a/uptimerobot/Chart.yaml b/uptimerobot/Chart.yaml index b60e4499..1cf5287f 100644 --- a/uptimerobot/Chart.yaml +++ b/uptimerobot/Chart.yaml @@ -1,14 +1,14 @@ apiVersion: v1 name: uptimerobot -version: 1.0.0 -appVersion: 1.0.0 +version: 1.1.2 +appVersion: 1.1.0 description: A tool to get statistics from Uptime Robot and log it into InfluxDB keywords: - uptimerobot - influxdb -home: https://github.com/billimek/node-influx-uptimerobot +home: https://github.com/trojanc/node-influx-uptimerobot sources: -- https://github.com/billimek/node-influx-uptimerobot +- https://github.com/trojanc/node-influx-uptimerobot - https://github.com/billimek/billimek-charts maintainers: - name: billimek diff --git a/uptimerobot/README.md b/uptimerobot/README.md index d794f567..34de6f2a 100644 --- a/uptimerobot/README.md +++ b/uptimerobot/README.md @@ -50,6 +50,8 @@ The following tables lists the configurable parameters of the Sentry chart and t | `config.influxdb.port` | InfluxDB port | `8086` | | `config.influxdb.database` | InfluxDB database | `uptimerobot` | | `config.influxdb.protocol` | InfluxDB protocol | `http` | +| `config.influxdb.username` | InfluxDB username | `` | +| `config.influxdb.password` | InfluxDB password | `` | | `config.uptimerobot.apikey` | uptimerobot API key (REQUIRED) | `someapikey` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/uptimerobot/templates/_helpers.tpl b/uptimerobot/templates/_helpers.tpl index 7e472da7..78bb3974 100644 --- a/uptimerobot/templates/_helpers.tpl +++ b/uptimerobot/templates/_helpers.tpl @@ -24,4 +24,11 @@ If release name contains chart name it will be used as a full name. {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "uptimerobot.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} \ No newline at end of file diff --git a/uptimerobot/templates/configmap.yaml b/uptimerobot/templates/configmap.yaml deleted file mode 100644 index cbae8ac2..00000000 --- a/uptimerobot/templates/configmap.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "uptimerobot.fullname" . }} - labels: - app: {{ template "uptimerobot.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -data: - config.json: | - { - "uptimerobot" : { - "apikey" : "{{ .Values.config.uptimerobot.apikey }}" - }, - "influx" : { - "host" : "{{ .Values.config.influxdb.host }}", - "port" : {{ .Values.config.influxdb.port }}, - "protocol" : "{{ .Values.config.influxdb.protocol }}", - "database" : "{{ .Values.config.influxdb.database }}" - } - } \ No newline at end of file diff --git a/uptimerobot/templates/deployment.yaml b/uptimerobot/templates/deployment.yaml index e0578857..7fe1cf93 100644 --- a/uptimerobot/templates/deployment.yaml +++ b/uptimerobot/templates/deployment.yaml @@ -24,22 +24,46 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - - name: DELAY + - name: UPTIMEROBOT_API_KEY + valueFrom: + secretKeyRef: + name: {{ template "uptimerobot.fullname" . }} + key: uptimerobot-apikey + {{- if .Values.config.influxdb.username }} + - name: INFLUX_USERNAME + valueFrom: + configMapKeyRef: + name: {{ template "uptimerobot.fullname" . }} + key: influxdb-username + {{- end }} + {{- if .Values.config.influxdb.password }} + - name: INFLUX_PASSWORD + valueFrom: + configMapKeyRef: + name: {{ template "uptimerobot.fullname" . }} + key: influxdb-password + {{- end }} + - name: APPLICATION_INTERVAL value: "{{ .Values.delay }}" + {{- if .Values.config.uptimerobot.logs_limit }} + - name: UPTIMEROBOT_LOGS_LIMIT + value: "{{ .Values.config.uptimerobot.logs_limit }}" + {{- end }} + {{- if .Values.config.uptimerobot.response_times_limit }} + - name: UPTIMEROBOT_RESPONSE_TIMES_LIMIT + value: "{{ .Values.config.uptimerobot.response_times_limit }}" + {{- end }} + - name: INFLUX_HOST + value: "{{ .Values.config.influxdb.host }}" + - name: INFLUX_PORT + value: "{{ .Values.config.influxdb.port }}" + - name: INFLUX_PROTOCOL + value: "{{ .Values.config.influxdb.protocol }}" + - name: INFLUX_DATABASE + value: "{{ .Values.config.influxdb.database }}" resources: {{ toYaml .Values.resources | indent 12 }} - volumeMounts: - - name: {{ template "uptimerobot.name" . }} - mountPath: /usr/src/node-influx-uptimerobot/config.json - subPath: config.json {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} - {{- end }} - volumes: - - name: {{ template "uptimerobot.name" . }} - configMap: - name: {{ template "uptimerobot.fullname" . }} - items: - - key: config.json - path: config.json \ No newline at end of file + {{- end }} \ No newline at end of file diff --git a/uptimerobot/templates/secret.yaml b/uptimerobot/templates/secret.yaml new file mode 100644 index 00000000..39709f1c --- /dev/null +++ b/uptimerobot/templates/secret.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "uptimerobot.fullname" . }} + labels: + app: {{ template "uptimerobot.name" . }} + chart: {{ template "uptimerobot.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +data: + uptimerobot-apikey: {{ .Values.config.uptimerobot.apikey | b64enc | quote }} + {{- if .Values.config.influxdb.username }} + influxdb-username: {{ .Values.config.influxdb.username | b64enc | quote }} + {{- end }} + {{- if .Values.config.influxdb.password }} + influxdb-password: {{ .Values.config.influxdb.password | b64enc | quote }} + {{- end }} \ No newline at end of file diff --git a/uptimerobot/values.yaml b/uptimerobot/values.yaml index 90b189d7..ba1b1b6f 100644 --- a/uptimerobot/values.yaml +++ b/uptimerobot/values.yaml @@ -3,9 +3,9 @@ # Declare variables to be passed into your templates. replicaCount: 1 image: - repository: billimek/uptimerobot-influxdb + repository: billimek/node-influx-uptimerobot tag: latest - pullPolicy: IfNotPresent + pullPolicy: Always resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little @@ -26,6 +26,11 @@ config: port: 8086 protocol: http database: uptimerobot + # username: + # password: uptimerobot: # API key is mandatory and must be populated apikey: someapikey + # logs_limit: 100 + # response_times_limit: 100 +