Kubernetes Dashboard Chart (#808)

* Kubernetes Dashboard Chart

Adds support for managing the Kubernetes Dashboard lifecycle via
Helm.

* Add notes.

* Fix namespaceing issues and remove extra defaults.

* Fix namespaceing issue in svc.

* Fix ws issues.

* Change default resource limits to match GKE.

* Fix min length of name.

* Fix ImagePullPolicy typo

* Remove namespace and remove extra release info.

* Use name instead of fullname in labels.

* Fix misaligned label selector.

* Fix misspecified target port.

* Use deployment release name in the svc selector as well as named port.

* Fix dashboard notes.

* Add ingress, bump version, fix notes label selector.

* Fix bad port number in notes.

* Fix ingress template scope issue.

* [stable/kubernetes-dashboard] use github username in maintainers
This commit is contained in:
kfox1111
2017-06-16 12:43:52 +02:00
committed by Reinhard Nägele
parent a4075e0426
commit 10e159ee76
7 changed files with 200 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
name: kubernetes-dashboard
version: 0.1.0
appVersion: 1.6.1
description: General-purpose web UI for Kubernetes clusters
keywords:
- kubernetes
- dashboard
maintainers:
- name: kfox1111
email: Kevin.Fox@pnnl.gov
@@ -0,0 +1,25 @@
*********************************************************************************
*** PLEASE BE PATIENT: kubernetes-dashboard may take a few minutes to install ***
*********************************************************************************
Get the Kubernetes Dashboard URL by running:
{{- if contains "NodePort" .Values.serviceType }}
export NODE_PORT=$(kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/
{{- else if contains "LoadBalancer" .Values.serviceType }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc -w {{ template "fullname" . }}'
export SERVICE_IP=$(kubectl get svc {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP/
{{- else if contains "ClusterIP" .Values.serviceType }}
export POD_NAME=$(kubectl get pods -n {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:9090/
kubectl -n {{ .Release.Namespace }} port-forward $POD_NAME 9090:9090
{{- end }}
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{ define "name" }}{{ default "kubernetes-dashboard" .Values.nameOverride | trunc 63 }}{{ end }}
{{/*
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" }}
{{- $name := default "kubernetes-dashboard" .Values.nameOverride -}}
{{ printf "%s-%s" .Release.Name $name | trunc 63 -}}
{{ end }}
@@ -0,0 +1,48 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: {{ template "name" . }}
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
kubernetes.io/cluster-service: "true"
spec:
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 10 }}
containers:
- name: main
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: {{ .Values.imagePullPolicy }}
resources:
{{ toYaml .Values.resources | indent 10 }}
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9090
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 30
ports:
- name: http
containerPort: 9090
protocol: TCP
@@ -0,0 +1,32 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "fullname" . }}
{{- $httpPort := .Values.httpPort }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
app: {{ template "name" . }}
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
name: {{ template "fullname" . }}
spec:
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: /
backend:
serviceName: {{ $fullName }}
servicePort: {{ $httpPort }}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
@@ -0,0 +1,22 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
kubernetes.io/cluster-service: "true"
spec:
type: {{ .Values.serviceType }}
ports:
- name: http
port: {{ .Values.httpPort }}
targetPort: http
{{- if hasKey .Values "nodePort" }}
nodePort: {{ .Values.nodePort }}
{{- end }}
selector:
app: {{ template "name" . }}
release: {{ .Release.Name | quote }}
+47
View File
@@ -0,0 +1,47 @@
# Default values for kubernetes-dashboard
# This is a YAML-formatted file.
# Declare name/value pairs to be passed into your templates.
# name: value
image: gcr.io/google_containers/kubernetes-dashboard-amd64
imageTag: "v1.6.1"
imagePullPolicy: "IfNotPresent"
nodeSelector: {}
httpPort: 80
serviceType: ClusterIP
resources:
limits:
cpu: 100m
memory: 50Mi
requests:
cpu: 100m
memory: 50Mi
ingress:
## If true, Kubernetes Dashboard Ingress will be created.
##
enabled: false
## Kubernetes Dashboard Ingress annotations
##
# annotations:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: 'true'
## Kubernetes Dashboard Ingress hostnames
## Must be provided if Ingress is enabled
##
# hosts:
# - kubernetes-dashboard.domain.com
## Kubernetes Dashboard Ingress TLS configuration
## Secrets must be manually created in the namespace
##
# tls:
# - secretName: kubernetes-dashboard-tls
# hosts:
# - kubernetes-dashboard.domain.com