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 name: chronograf
version: 0.2.2 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. 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: keywords:
- chronograf - chronograf
- visualizaion - visualizaion
......
Chronograf can be accessed via port 80 on the following DNS name from within your cluster: 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 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: 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: 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" }} {{- if eq .Values.service.type "LoadBalancer" }}
To watch for the LoadBalancer IP run the following 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 }} {{- end }}
{{- if .Values.ingress.enabled }} {{- if .Values.ingress.enabled }}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{{/* {{/*
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "name" -}} {{- define "chronograf.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
...@@ -10,7 +10,7 @@ Expand the name of the chart. ...@@ -10,7 +10,7 @@ Expand the name of the chart.
Create a default fully qualified app name. 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). 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 -}} {{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
labels: labels:
app: {{ template "fullname" . }} app: {{ template "chronograf.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}" release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}" heritage: "{{ .Release.Service }}"
...@@ -12,7 +12,7 @@ spec: ...@@ -12,7 +12,7 @@ spec:
template: template:
metadata: metadata:
labels: labels:
app: {{ template "fullname" . }} app: {{ template "chronograf.fullname" . }}
spec: spec:
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
...@@ -23,62 +23,62 @@ spec: ...@@ -23,62 +23,62 @@ spec:
- name: TOKEN_SECRET - name: TOKEN_SECRET
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: token_secret key: token_secret
{{- if .Values.oauth.github.enabled }} {{- if .Values.oauth.github.enabled }}
- name: GH_CLIENT_ID - name: GH_CLIENT_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: gh_client_id key: gh_client_id
- name: GH_CLIENT_SECRET - name: GH_CLIENT_SECRET
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: gh_client_secret key: gh_client_secret
- name: GH_ORGS - name: GH_ORGS
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: gh_orgs key: gh_orgs
{{- end }} {{- end }}
{{- if .Values.oauth.heroku.enabled }} {{- if .Values.oauth.heroku.enabled }}
- name: HEROKU_CLIENT_ID - name: HEROKU_CLIENT_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: he_client_id key: he_client_id
- name: HEROKU_CLIENT_SECRET - name: HEROKU_CLIENT_SECRET
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: he_client_secret key: he_client_secret
- name: HEROKU_ORGS - name: HEROKU_ORGS
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: he_orgs key: he_orgs
{{- end }} {{- end }}
{{- if .Values.oauth.google.enabled }} {{- if .Values.oauth.google.enabled }}
- name: GOOGLE_CLIENT_ID - name: GOOGLE_CLIENT_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: go_client_id key: go_client_id
- name: GOOGLE_CLIENT_SECRET - name: GOOGLE_CLIENT_SECRET
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: go_client_secret key: go_client_secret
- name: GOOGLE_DOMAINS - name: GOOGLE_DOMAINS
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: go_domains key: go_domains
- name: PUBLIC_URL - name: PUBLIC_URL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
key: go_public_url key: go_public_url
{{- end }} {{- end }}
{{- end }} {{- end }}
...@@ -102,7 +102,7 @@ spec: ...@@ -102,7 +102,7 @@ spec:
- name: data - name: data
{{- if .Values.persistence.enabled }} {{- if .Values.persistence.enabled }}
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ template "fullname" . }} claimName: {{ template "chronograf.fullname" . }}
{{ else }} {{ else }}
emptyDir: {} emptyDir: {}
{{ end }} {{ end }}
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
labels: labels:
app: {{ template "fullname" . }} app: {{ template "chronograf.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}" release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}" heritage: "{{ .Release.Service }}"
...@@ -15,7 +15,7 @@ spec: ...@@ -15,7 +15,7 @@ spec:
tls: tls:
- hosts: - hosts:
- {{ .Values.ingress.hostname | quote }} - {{ .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 }} {{- end }}
rules: rules:
- host: {{ .Values.ingress.hostname }} - host: {{ .Values.ingress.hostname }}
...@@ -23,6 +23,6 @@ spec: ...@@ -23,6 +23,6 @@ spec:
paths: paths:
- path: / - path: /
backend: backend:
serviceName: {{ template "fullname" . }} serviceName: {{ template "chronograf.fullname" . }}
servicePort: 80 servicePort: 80
{{- end -}} {{- end -}}
\ No newline at end of file
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
labels: labels:
app: {{ template "fullname" . }} app: {{ template "chronograf.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}" release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}" heritage: "{{ .Release.Service }}"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
type: Opaque type: Opaque
data: data:
token_secret: {{ .Values.oauth.token_secret | b64enc | quote }} token_secret: {{ .Values.oauth.token_secret | b64enc | quote }}
......
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ template "fullname" . }} name: {{ template "chronograf.fullname" . }}
labels: labels:
app: {{ template "fullname" . }} app: {{ template "chronograf.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}" release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}" heritage: "{{ .Release.Service }}"
...@@ -13,4 +13,4 @@ spec: ...@@ -13,4 +13,4 @@ spec:
- port: 80 - port: 80
targetPort: 8888 targetPort: 8888
selector: 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