From d00c64a2dc4716e71541a651d236af3a525942f8 Mon Sep 17 00:00:00 2001 From: "Keerthan Reddy Mala (kmala)" Date: Wed, 5 Oct 2016 16:52:25 -0600 Subject: [PATCH] feat(charts): Add helm charts for monitor --- charts/monitor/Chart.yaml | 7 ++ charts/monitor/charts/grafana/Chart.yaml | 7 ++ .../templates/monitor-grafana-deployment.yaml | 49 ++++++++++ .../templates/monitor-grafana-svc.yaml | 19 ++++ charts/monitor/charts/influxdb/Chart.yaml | 7 ++ .../templates/monitor-influxdb-api-svc.yaml | 19 ++++ .../monitor-influxdb-deployment.yaml | 55 +++++++++++ .../templates/monitor-influxdb-ui-svc.yaml | 19 ++++ charts/monitor/charts/telegraf/Chart.yaml | 7 ++ .../templates/monitor-telegraf-daemon.yaml | 95 +++++++++++++++++++ .../monitor-telegraf-service-account.yaml | 6 ++ charts/monitor/values.yaml | 18 ++++ 12 files changed, 308 insertions(+) create mode 100644 charts/monitor/Chart.yaml create mode 100644 charts/monitor/charts/grafana/Chart.yaml create mode 100644 charts/monitor/charts/grafana/templates/monitor-grafana-deployment.yaml create mode 100644 charts/monitor/charts/grafana/templates/monitor-grafana-svc.yaml create mode 100644 charts/monitor/charts/influxdb/Chart.yaml create mode 100644 charts/monitor/charts/influxdb/templates/monitor-influxdb-api-svc.yaml create mode 100644 charts/monitor/charts/influxdb/templates/monitor-influxdb-deployment.yaml create mode 100644 charts/monitor/charts/influxdb/templates/monitor-influxdb-ui-svc.yaml create mode 100644 charts/monitor/charts/telegraf/Chart.yaml create mode 100644 charts/monitor/charts/telegraf/templates/monitor-telegraf-daemon.yaml create mode 100644 charts/monitor/charts/telegraf/templates/monitor-telegraf-service-account.yaml create mode 100644 charts/monitor/values.yaml diff --git a/charts/monitor/Chart.yaml b/charts/monitor/Chart.yaml new file mode 100644 index 0000000..e984a43 --- /dev/null +++ b/charts/monitor/Chart.yaml @@ -0,0 +1,7 @@ +name: monitor +home: https://github.com/deis/monitor +version: +description: Monitoring for Deis Workflow. +maintainers: + - name: Deis Team + email: engineering@deis.com diff --git a/charts/monitor/charts/grafana/Chart.yaml b/charts/monitor/charts/grafana/Chart.yaml new file mode 100644 index 0000000..8168f1e --- /dev/null +++ b/charts/monitor/charts/grafana/Chart.yaml @@ -0,0 +1,7 @@ +name: grafana +home: https://github.com/deis/monitor/tree/master/grafana +version: +description: Monitoring for Deis Workflow. +maintainers: + - name: Deis Team + email: engineering@deis.com diff --git a/charts/monitor/charts/grafana/templates/monitor-grafana-deployment.yaml b/charts/monitor/charts/grafana/templates/monitor-grafana-deployment.yaml new file mode 100644 index 0000000..dffbd69 --- /dev/null +++ b/charts/monitor/charts/grafana/templates/monitor-grafana-deployment.yaml @@ -0,0 +1,49 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: deis-monitor-grafana + labels: + heritage: deis + annotations: + component.deis.io/version: {{ .Values.docker_tag }} +spec: + replicas: 1 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + selector: + matchLabels: + app: deis-monitor-grafana + template: + metadata: + labels: + app: deis-monitor-grafana + spec: + containers: + - name: deis-monitor-grafana + image: quay.io/{{.Values.org}}/grafana:{{.Values.docker_tag}} + imagePullPolicy: {{.Values.pull_policy}} +{{- if or (.Values.limits_cpu) (.Values.limits_memory)}} + resources: + limits: +{{- if (.Values.limits_cpu) }} + cpu: {{.Values.limits_cpu}} +{{- end}} +{{- if (.Values.limits_memory) }} + memory: {{.Values.limits_memory}} +{{- end}} +{{- end}} + env: + - name: "INFLUXDB_URLS" + value: http://$(DEIS_MONITOR_INFLUXAPI_SERVICE_HOST):$(DEIS_MONITOR_INFLUXAPI_SERVICE_PORT_TRANSPORT) + - name: "BIND_PORT" + value: "3500" + - name: "DEFAULT_USER" + value: {{.Values.user}} + - name: "DEFAULT_USER_PASSWORD" + value: {{.Values.password}} + ports: + - containerPort: 3500 + name: ui diff --git a/charts/monitor/charts/grafana/templates/monitor-grafana-svc.yaml b/charts/monitor/charts/grafana/templates/monitor-grafana-svc.yaml new file mode 100644 index 0000000..eaf1206 --- /dev/null +++ b/charts/monitor/charts/grafana/templates/monitor-grafana-svc.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: deis-monitor-grafana + labels: + heritage: deis + app: deis-monitor-grafana + router.deis.io/routable: "true" + annotations: + router.deis.io/domains: grafana + router.deis.io/connectTimeout: "10" + router.deis.io/tcpTimeout: "1200" +spec: + ports: + - port: 80 + name: ui + targetPort: ui + selector: + app: deis-monitor-grafana diff --git a/charts/monitor/charts/influxdb/Chart.yaml b/charts/monitor/charts/influxdb/Chart.yaml new file mode 100644 index 0000000..a300431 --- /dev/null +++ b/charts/monitor/charts/influxdb/Chart.yaml @@ -0,0 +1,7 @@ +name: influxdb +home: https://github.com/deis/monitor/tree/master/influxdb +version: +description: Monitoring for Deis Workflow. +maintainers: + - name: Deis Team + email: engineering@deis.com diff --git a/charts/monitor/charts/influxdb/templates/monitor-influxdb-api-svc.yaml b/charts/monitor/charts/influxdb/templates/monitor-influxdb-api-svc.yaml new file mode 100644 index 0000000..6391529 --- /dev/null +++ b/charts/monitor/charts/influxdb/templates/monitor-influxdb-api-svc.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: deis-monitor-influxapi + labels: + heritage: deis + app: deis-monitor-influxapi + router.deis.io/routable: "true" + annotations: + router.deis.io/domains: influxapi + router.deis.io/connectTimeout: "10" + router.deis.io/tcpTimeout: "1200" +spec: + ports: + - port: 80 + name: transport + targetPort: transport + selector: + app: deis-monitor-influxdb diff --git a/charts/monitor/charts/influxdb/templates/monitor-influxdb-deployment.yaml b/charts/monitor/charts/influxdb/templates/monitor-influxdb-deployment.yaml new file mode 100644 index 0000000..2ff462f --- /dev/null +++ b/charts/monitor/charts/influxdb/templates/monitor-influxdb-deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: deis-monitor-influxdb + labels: + heritage: deis + annotations: + component.deis.io/version: {{ .Values.docker_tag }} +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: deis-monitor-influxdb + template: + metadata: + labels: + app: deis-monitor-influxdb + spec: + containers: + - name: deis-monitor-influxdb + image: quay.io/{{.Values.org}}/influxdb:{{.Values.docker_tag}} + imagePullPolicy: {{.Values.pull_policy}} +{{- if or (.Values.limits_cpu) (.Values.limits_memory)}} + resources: + limits: +{{- if (.Values.limits_cpu) }} + cpu: {{.Values.limits_cpu}} +{{- end}} +{{- if (.Values.limits_memory) }} + memory: {{.Values.limits_memory}} +{{- end}} +{{- end}} + ports: + - containerPort: 8083 + name: admin + - containerPort: 8086 + name: transport + protocol: TCP + - containerPort: 8084 + name: ssltransport + protocol: TCP + livenessProbe: + httpGet: + path: /ping + port: 8086 + initialDelaySeconds: 1 + timeoutSeconds: 1 + readinessProbe: + httpGet: + path: /ping + port: 8086 + initialDelaySeconds: 1 + timeoutSeconds: 1 diff --git a/charts/monitor/charts/influxdb/templates/monitor-influxdb-ui-svc.yaml b/charts/monitor/charts/influxdb/templates/monitor-influxdb-ui-svc.yaml new file mode 100644 index 0000000..ed15e3e --- /dev/null +++ b/charts/monitor/charts/influxdb/templates/monitor-influxdb-ui-svc.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: deis-monitor-influxui + labels: + heritage: deis + app: deis-monitor-influxui + router.deis.io/routable: "true" + annotations: + router.deis.io/domains: influx + router.deis.io/connectTimeout: "10" + router.deis.io/tcpTimeout: "1200" +spec: + ports: + - port: 80 + name: admin + targetPort: admin + selector: + app: deis-monitor-influxdb diff --git a/charts/monitor/charts/telegraf/Chart.yaml b/charts/monitor/charts/telegraf/Chart.yaml new file mode 100644 index 0000000..663c7e0 --- /dev/null +++ b/charts/monitor/charts/telegraf/Chart.yaml @@ -0,0 +1,7 @@ +name: telegraf +home: https://github.com/deis/monitor/tree/master/telegraf +version: +description: Monitoring for Deis Workflow. +maintainers: + - name: Deis Team + email: engineering@deis.com diff --git a/charts/monitor/charts/telegraf/templates/monitor-telegraf-daemon.yaml b/charts/monitor/charts/telegraf/templates/monitor-telegraf-daemon.yaml new file mode 100644 index 0000000..b66f799 --- /dev/null +++ b/charts/monitor/charts/telegraf/templates/monitor-telegraf-daemon.yaml @@ -0,0 +1,95 @@ +apiVersion: extensions/v1beta1 +kind: DaemonSet +metadata: + name: deis-monitor-telegraf + labels: + heritage: deis + annotations: + component.deis.io/version: {{ .Values.docker_tag }} +spec: + template: + metadata: + labels: + app: deis-monitor-telegraf + spec: + serviceAccount: deis-monitor-telegraf + containers: + - name: deis-monitor-telegraf + image: quay.io/{{.Values.org}}/telegraf:{{.Values.docker_tag}} + imagePullPolicy: {{.Values.pull_policy}} +{{- if or (.Values.limits_cpu) (.Values.limits_memory)}} + resources: + limits: +{{- if (.Values.limits_cpu) }} + cpu: {{.Values.limits_cpu}} +{{- end}} +{{- if (.Values.limits_memory) }} + memory: {{.Values.limits_memory}} +{{- end}} +{{- end}} + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - 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: "HOST_PROC" + value: "/rootfs/proc" + - name: "HOST_SYS" + value: "/rootfs/sys" + - name: "AGENT_QUIET" + value: "true" + - name: "AGENT_BUFFER_LIMIT" + value: "100000" + - name: "ENABLE_INFLUXDB_INPUT" + value: "true" + - name: "ENABLE_PROMETHEUS" + value: "true" + - name: "NSQ_CONSUMER_SERVER" + value: "$(DEIS_NSQD_SERVICE_HOST):$(DEIS_NSQD_SERVICE_PORT_TRANSPORT)" + - name: "NSQ_CONSUMER_TOPIC" + value: "metrics" + - name: "NSQ_ENDPOINTS" + value: "\"http://$(DEIS_NSQD_SERVICE_HOST):$(DEIS_NSQD_SERVICE_PORT_HTTP)\"" + {{- if ne .Values.global.logger_redis_location "off-cluster" }} + - name: DEIS_LOGGER_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: logger-redis-creds + key: password + - name: "REDIS_SERVERS" + value: "\"tcp://:$(DEIS_LOGGER_REDIS_PASSWORD)@$(DEIS_LOGGER_REDIS_SERVICE_HOST):$(DEIS_LOGGER_REDIS_SERVICE_PORT)\"" + {{- end }} + volumeMounts: + - mountPath: /var/run/docker.sock + name: docker-socket + - name: sysro + mountPath: /rootfs/sys + readOnly: true + - name: procro + mountPath: /rootfs/proc + readOnly: true + - name: varrunutmpro + mountPath: /var/run/utmp + readOnly: true + - name: logger-redis-creds + mountPath: /var/run/secrets/deis/redis/creds + volumes: + - name: docker-socket + hostPath: + path: /var/run/docker.sock + - name: sysro + hostPath: + path: /sys + - name: procro + hostPath: + path: /proc + - name: varrunutmpro + hostPath: + path: /var/run/utmp + - name: logger-redis-creds + secret: + secretName: logger-redis-creds diff --git a/charts/monitor/charts/telegraf/templates/monitor-telegraf-service-account.yaml b/charts/monitor/charts/telegraf/templates/monitor-telegraf-service-account.yaml new file mode 100644 index 0000000..82888c6 --- /dev/null +++ b/charts/monitor/charts/telegraf/templates/monitor-telegraf-service-account.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: deis-monitor-telegraf + labels: + heritage: deis diff --git a/charts/monitor/values.yaml b/charts/monitor/values.yaml new file mode 100644 index 0000000..d6d9101 --- /dev/null +++ b/charts/monitor/values.yaml @@ -0,0 +1,18 @@ +grafana: + org: "deisci" + pull_policy: "Always" + docker_tag: canary + # limits_cpu: "100m" + # limits_memory: "50Mi" +influxdb: + org: "deisci" + pull_policy: "Always" + docker_tag: canary + # limits_cpu: "100m" + # limits_memory: "50Mi" +telegraf: + org: "deisci" + pull_policy: "Always" + docker_tag: canary + # limits_cpu: "100m" + # limits_memory: "50Mi"