Skip to content

Commit

Permalink
Merge pull request #155 from kmala/charts
Browse files Browse the repository at this point in the history
feat(monitor): Allow for off cluster influxdb
  • Loading branch information
kmala authored Oct 24, 2016
2 parents 5812cc3 + adedd69 commit e86a018
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.global.grafana_location "on-cluster" }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
Expand Down Expand Up @@ -36,8 +37,31 @@ spec:
{{- end}}
{{- end}}
env:
{{- if eq .Values.global.influxdb_location "off-cluster" }}
- name: "INFLUXDB_SERVICE_URL"
valueFrom:
secretKeyRef:
name: influxdb-creds
key: url
- name: "INFLUXDB_DATABASE"
valueFrom:
secretKeyRef:
name: influxdb-creds
key: database
- name: "INFLUXDB_USER"
valueFrom:
secretKeyRef:
name: influxdb-creds
key: user
- name: "INFLUXDB_PASSWORD"
valueFrom:
secretKeyRef:
name: influxdb-creds
key: password
{{- else }}
- name: "INFLUXDB_URLS"
value: http://$(DEIS_MONITOR_INFLUXAPI_SERVICE_HOST):$(DEIS_MONITOR_INFLUXAPI_SERVICE_PORT_TRANSPORT)
{{- end }}
- name: "BIND_PORT"
value: "3500"
- name: "DEFAULT_USER"
Expand All @@ -47,3 +71,4 @@ spec:
ports:
- containerPort: 3500
name: ui
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.global.grafana_location "on-cluster" }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -17,3 +18,4 @@ spec:
targetPort: ui
selector:
app: deis-monitor-grafana
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.global.influxdb_location "on-cluster" }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -17,3 +18,4 @@ spec:
targetPort: transport
selector:
app: deis-monitor-influxdb
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if eq .Values.global.influxdb_location "off-cluster" }}
apiVersion: v1
kind: Secret
metadata:
name: influxdb-creds
labels:
heritage: deis
type: Opaque
data:
url: {{ .Values.url | b64enc }}
database: {{ .Values.database | b64enc }}
user: {{ .Values.user | b64enc }}
password: {{ .Values.password | b64enc }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.global.influxdb_location "on-cluster" }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
Expand Down Expand Up @@ -53,3 +54,4 @@ spec:
port: 8086
initialDelaySeconds: 1
timeoutSeconds: 1
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.global.influxdb_location "on-cluster" }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -17,3 +18,4 @@ spec:
targetPort: admin
selector:
app: deis-monitor-influxdb
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,35 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if eq .Values.global.influxdb_location "off-cluster" }}
- name: "INFLUXDB_URLS"
valueFrom:
secretKeyRef:
name: influxdb-creds
key: url
- name: "INFLUXDB_DATABASE"
valueFrom:
secretKeyRef:
name: influxdb-creds
key: database
- name: "INFLUXDB_USERNAME"
valueFrom:
secretKeyRef:
name: influxdb-creds
key: user
- name: "INFLUXDB_PASSWORD"
valueFrom:
secretKeyRef:
name: influxdb-creds
key: password
{{- else }}
- name: "INFLUXDB_URLS"
value: "\"http://$(DEIS_MONITOR_INFLUXAPI_SERVICE_HOST):$(DEIS_MONITOR_INFLUXAPI_SERVICE_PORT_TRANSPORT)\""
- name: "INFLUXDB_INPUT_URLS"
value: "\"http://$(DEIS_MONITOR_INFLUXAPI_SERVICE_HOST):$(DEIS_MONITOR_INFLUXAPI_SERVICE_PORT_TRANSPORT)/debug/vars\""
- name: "ENABLE_INFLUXDB_INPUT"
value: "true"
{{- end }}
- name: "HOST_PROC"
value: "/rootfs/proc"
- name: "HOST_SYS"
Expand All @@ -44,8 +69,6 @@ spec:
value: "true"
- name: "AGENT_BUFFER_LIMIT"
value: "100000"
- name: "ENABLE_INFLUXDB_INPUT"
value: "true"
- name: "ENABLE_KUBERNETES"
value: "true"
- name: "NSQ_CONSUMER_SERVER"
Expand Down
18 changes: 18 additions & 0 deletions charts/monitor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,27 @@ influxdb:
docker_tag: canary
# limits_cpu: "100m"
# limits_memory: "50Mi"
url: "my.influx.url"
database: "kubernetes"
user: "user"
password: "password"
telegraf:
org: "deisci"
pull_policy: "Always"
docker_tag: canary
# limits_cpu: "100m"
# limits_memory: "50Mi"

global:
# Set the location of Workflow's influxdb cluster
#
# Valid values are:
# - on-cluster: Run Influxdb within the Kubernetes cluster
# - off-cluster: Influxdb is running outside of the cluster and credentials and connection information will be provided.
influxdb_location: "on-cluster"
# Set the location of Workflow's grafana instance
#
# Valid values are:
# - on-cluster: Run Grafana within the Kubernetes cluster
# - off-cluster: Grafana is running outside of the cluster
grafana_location: "on-cluster"

0 comments on commit e86a018

Please sign in to comment.