Commit 266cea40 authored by kevinschumacher's avatar kevinschumacher Committed by Michael Goodness

[stable/chronograf] #1785 namespace defined templates with chart name (#1981)

parent 6041e328
name: chronograf
version: 0.2.2
description: Open-source web application written in Go and React.js that provides the tools to visualize your monitoring data and easily create alerting and automation rules.
version: 0.3.0
description: Open-source web application written in Go and React.js that provides
the tools to visualize your monitoring data and easily create alerting and automation
rules.
keywords:
- chronograf
- visualizaion
......
Chronograf can be accessed via port 80 on the following DNS name from within your cluster:
- http://{{ template "fullname" . }}.{{ .Release.Namespace }}
- http://{{ template "chronograf.fullname" . }}.{{ .Release.Namespace }}
You can easily connect to the remote instance from your browser. Forward the webserver port to localhost:8888
- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8888
- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "chronograf.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8888
You can also connect to the container running Chronograf. To open a shell session in the pod run the following:
- 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
- kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "chronograf.fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh
To trail the logs for the Chronograf pod run the following:
- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }} -o jsonpath='{ .items[0].metadata.name }')
- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ template "chronograf.fullname" . }} -o jsonpath='{ .items[0].metadata.name }')
{{- if eq .Values.service.type "LoadBalancer" }}
To watch for the LoadBalancer IP run the following
- kubectl get svc -w --namespace {{ .Release.Namespace }} -l app={{ template "fullname" . }}
- kubectl get svc -w --namespace {{ .Release.Namespace }} -l app={{ template "chronograf.fullname" . }}
{{- end }}
{{- if .Values.ingress.enabled }}
......
......@@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- define "chronograf.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
......@@ -10,7 +10,7 @@ Expand the name of the chart.
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- define "chronograf.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "chronograf.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
......@@ -12,7 +12,7 @@ spec:
template:
metadata:
labels:
app: {{ template "fullname" . }}
app: {{ template "chronograf.fullname" . }}
spec:
containers:
- name: {{ .Chart.Name }}
......@@ -23,62 +23,62 @@ spec:
- name: TOKEN_SECRET
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: token_secret
{{- if .Values.oauth.github.enabled }}
- name: GH_CLIENT_ID
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: gh_client_id
- name: GH_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: gh_client_secret
- name: GH_ORGS
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: gh_orgs
{{- end }}
{{- if .Values.oauth.heroku.enabled }}
- name: HEROKU_CLIENT_ID
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: he_client_id
- name: HEROKU_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: he_client_secret
- name: HEROKU_ORGS
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: he_orgs
{{- end }}
{{- if .Values.oauth.google.enabled }}
- name: GOOGLE_CLIENT_ID
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: go_client_id
- name: GOOGLE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: go_client_secret
- name: GOOGLE_DOMAINS
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: go_domains
- name: PUBLIC_URL
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
key: go_public_url
{{- end }}
{{- end }}
......@@ -102,7 +102,7 @@ spec:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}
claimName: {{ template "chronograf.fullname" . }}
{{ else }}
emptyDir: {}
{{ end }}
......@@ -2,9 +2,9 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "chronograf.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
......@@ -15,7 +15,7 @@ spec:
tls:
- hosts:
- {{ .Values.ingress.hostname | quote }}
secretName: {{ .Values.ingress.secretName | default (printf "%s-tls" (include "fullname" .)) }}
secretName: {{ .Values.ingress.secretName | default (printf "%s-tls" (include "chronograf.fullname" .)) }}
{{- end }}
rules:
- host: {{ .Values.ingress.hostname }}
......@@ -23,6 +23,6 @@ spec:
paths:
- path: /
backend:
serviceName: {{ template "fullname" . }}
serviceName: {{ template "chronograf.fullname" . }}
servicePort: 80
{{- end -}}
\ No newline at end of file
......@@ -2,9 +2,9 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "chronograf.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
......
......@@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
type: Opaque
data:
token_secret: {{ .Values.oauth.token_secret | b64enc | quote }}
......
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
name: {{ template "chronograf.fullname" . }}
labels:
app: {{ template "fullname" . }}
app: {{ template "chronograf.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
......@@ -13,4 +13,4 @@ spec:
- port: 80
targetPort: 8888
selector:
app: {{ template "fullname" . }}
app: {{ template "chronograf.fullname" . }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment