diff --git a/stable/chronograf/.helmignore b/stable/chronograf/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/stable/chronograf/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/stable/chronograf/Chart.yaml b/stable/chronograf/Chart.yaml new file mode 100755 index 0000000000..4f77c82745 --- /dev/null +++ b/stable/chronograf/Chart.yaml @@ -0,0 +1,12 @@ +name: chronograf +version: 0.1.0 +description: Chart for Chronograf +keywords: +- chronograf +- visualizaion +- timeseries +home: https://www.influxdata.com/time-series-platform/chronograf/ +maintainers: +- name: Jack Zampolin +- email: jack@influxdb.com +engine: gotpl \ No newline at end of file diff --git a/stable/chronograf/README.md b/stable/chronograf/README.md new file mode 100644 index 0000000000..bf40633ac5 --- /dev/null +++ b/stable/chronograf/README.md @@ -0,0 +1 @@ +# `chronograf` Chart \ No newline at end of file diff --git a/stable/chronograf/templates/NOTES.txt b/stable/chronograf/templates/NOTES.txt new file mode 100644 index 0000000000..5b1618f8cd --- /dev/null +++ b/stable/chronograf/templates/NOTES.txt @@ -0,0 +1,17 @@ +1. Get the application URL by running these commands: +{{- if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT/login +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running: + + 'kubectl get svc -w --namespace {{ .Release.Namespace }} {{ template "fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.externalPort }} +{{- end }} diff --git a/stable/chronograf/templates/_helpers.tpl b/stable/chronograf/templates/_helpers.tpl new file mode 100644 index 0000000000..234480de71 --- /dev/null +++ b/stable/chronograf/templates/_helpers.tpl @@ -0,0 +1,16 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} +{{- end -}} diff --git a/stable/chronograf/templates/deployment.yaml b/stable/chronograf/templates/deployment.yaml new file mode 100644 index 0000000000..eef0431363 --- /dev/null +++ b/stable/chronograf/templates/deployment.yaml @@ -0,0 +1,40 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "fullname" . }} + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +spec: + replicas: 1 + template: + metadata: + labels: + app: {{ template "fullname" . }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: 8888 + livenessProbe: + httpGet: + path: /ping + port: 8888 + readinessProbe: + httpGet: + path: /ping + port: 8888 + volumeMounts: + - name: data + mountPath: /var/lib/chronograf + resources: +{{ toYaml .Values.resources | indent 12 }} + volumes: + - name: data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "fullname" . }} + {{- else -}} + emptyDir: {} + {{- end -}} \ No newline at end of file diff --git a/stable/chronograf/templates/ingress.yaml b/stable/chronograf/templates/ingress.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/stable/chronograf/templates/pvc.yaml b/stable/chronograf/templates/pvc.yaml new file mode 100644 index 0000000000..d22fd2a800 --- /dev/null +++ b/stable/chronograf/templates/pvc.yaml @@ -0,0 +1,14 @@ +{{- if .Values.persistence.enabled }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "fullname" . }} + annotations: + volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} +spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} +{{- end }} diff --git a/stable/chronograf/templates/service.yaml b/stable/chronograf/templates/service.yaml new file mode 100644 index 0000000000..b8c3359f42 --- /dev/null +++ b/stable/chronograf/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "fullname" . }} + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" +spec: + type: {{ .Values.service.type }} + ports: + - port: 80 + targetPort: 8888 + selector: + app: {{ template "fullname" . }} diff --git a/stable/chronograf/values.yaml b/stable/chronograf/values.yaml new file mode 100644 index 0000000000..4fa957d623 --- /dev/null +++ b/stable/chronograf/values.yaml @@ -0,0 +1,38 @@ +image: + repository: "quay.io/influxdb/chronograf" + tag: "latest" + pullPolicy: "Always" + +## Specify a service type +## NodePort is default +## ref: http://kubernetes.io/docs/user-guide/services/ +service: + type: LoadBalancer + +## Persist data to a persitent volume +persistence: + enabled: true + storageClass: generic + accessMode: ReadWriteOnce + size: 8Gi + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: + requests: + memory: 256Mi + cpu: 0.1 + limits: + memory: 2Gi + cpu: 2 + +## Configure the ingress object to hook into existing infastructure +## ref : http://kubernetes.io/docs/user-guide/ingress/ +## +ingress: + enabled: true + tls: true + hostname: chronograf.influxdata.com + annotations: + # kubernetes.io/ingress.class: "nginx" \ No newline at end of file