[stable/rethinkdb] #1785 namespace defined templates with chart name (#2158)

This commit is contained in:
Kevin Schumacher
2017-10-05 00:25:12 +05:30
committed by Dhilip
parent d60965ebcc
commit e16462f5d0
10 changed files with 41 additions and 41 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
name: rethinkdb
description: The open-source database for the realtime web
version: 0.0.3
version: 0.1.0
keywords:
- rethinkdb
- database
+8 -8
View File
@@ -1,22 +1,22 @@
1. Get RethinkDB Driver Details
{{- if contains "NodePort" .Values.proxy.service.type }}
echo Host: $(kubectl get no --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo Port: $(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }}-proxy -o jsonpath='{.spec.ports[0].nodePort}')
echo Port: $(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "rethinkdb.fullname" . }}-proxy -o jsonpath='{.spec.ports[0].nodePort}')
{{- else if contains "LoadBalancer" .Values.proxy.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}-proxy'
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "rethinkdb.fullname" . }}-proxy'
echo Host: $(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }}-proxy -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo Port: $(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }}-proxy -o jsonpath='{.spec.ports[0].port}')
echo Host: $(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "rethinkdb.fullname" . }}-proxy -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo Port: $(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "rethinkdb.fullname" . }}-proxy -o jsonpath='{.spec.ports[0].port}')
NOTE: If you are using Minikube, the above will provide a blank Host and the wrong Port.
The following command will open up a browser with the correct Host and Port.
minikube service {{ template "fullname" . }}-proxy
minikube service {{ template "rethinkdb.fullname" . }}-proxy
{{- else if contains "ClusterIP" .Values.proxy.service.type }}
NOTE: You will need to run a Kubernetes Port-Forward to connect to the ClusterIP Service
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }}-proxy" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "rethinkdb.name" . }}-proxy" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $POD_NAME 28015:{{ .Values.ports.driver }}
Host: 127.0.0.1
@@ -24,10 +24,10 @@
{{- end }}
echo Username: admin
echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.rethinkdb-password}" | base64 --decode)
echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "rethinkdb.fullname" . }} -o jsonpath="{.data.rethinkdb-password}" | base64 --decode)
2. Open RethinkDB Admin Console
NOTE: The RethinkDB Admin Console is not exposed externally, you will need to start a 'kubectl proxy' before you can access it.
URL: http://localhost:8001/api/v1/namespaces/{{ .Release.Namespace }}/services/{{ template "fullname" . }}-admin/proxy
URL: http://localhost:8001/api/v1/namespaces/{{ .Release.Namespace }}/services/{{ template "rethinkdb.fullname" . }}-admin/proxy
+2 -2
View File
@@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- define "rethinkdb.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 "rethinkdb.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ template "fullname" . }}-admin"
name: "{{ template "rethinkdb.fullname" . }}-admin"
labels:
app: "{{ template "name" . }}-admin"
app: "{{ template "rethinkdb.name" . }}-admin"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
@@ -13,5 +13,5 @@ spec:
- port: {{ .Values.ports.admin }}
targetPort: admin
selector:
app: "{{ template "name" . }}-proxy"
app: "{{ template "rethinkdb.name" . }}-proxy"
release: {{ .Release.Name | quote }}
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ template "fullname" . }}-cluster"
name: "{{ template "rethinkdb.fullname" . }}-cluster"
labels:
app: "{{ template "name" . }}-cluster"
app: "{{ template "rethinkdb.name" . }}-cluster"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
@@ -18,5 +18,5 @@ spec:
- port: {{ .Values.ports.cluster }}
targetPort: cluster
selector:
app: "{{ template "name" . }}-cluster"
app: "{{ template "rethinkdb.name" . }}-cluster"
release: {{ .Release.Name | quote }}
@@ -1,20 +1,20 @@
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: "{{ template "fullname" . }}-cluster"
name: "{{ template "rethinkdb.fullname" . }}-cluster"
labels:
app: "{{ template "name" . }}-cluster"
app: "{{ template "rethinkdb.name" . }}-cluster"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
spec:
serviceName: "{{ template "fullname" . }}-cluster"
serviceName: "{{ template "rethinkdb.fullname" . }}-cluster"
replicas: {{ .Values.cluster.replicas }}
template:
metadata:
name: "{{ template "fullname" . }}-cluster"
name: "{{ template "rethinkdb.fullname" . }}-cluster"
labels:
app: "{{ template "name" . }}-cluster"
app: "{{ template "rethinkdb.name" . }}-cluster"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
@@ -24,7 +24,7 @@ spec:
{{- end }}
spec:
containers:
- name: {{ template "name" . }}-cluster
- name: {{ template "rethinkdb.name" . }}-cluster
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
ports:
@@ -43,11 +43,11 @@ spec:
mountPath: "/data"
env:
- name: RETHINK_CLUSTER_SERVICE
value: "{{ template "fullname" . }}-cluster"
value: "{{ template "rethinkdb.fullname" . }}-cluster"
- name: RETHINKDB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "rethinkdb.fullname" . }}
key: rethinkdb-password
- name: POD_IP
valueFrom:
@@ -88,7 +88,7 @@ spec:
name: datadir
annotations:
{{- if .Values.cluster.storageClass.enabled }}
volume.beta.kubernetes.io/storage-class: {{ template "fullname" . }}
volume.beta.kubernetes.io/storage-class: {{ template "rethinkdb.fullname" . }}
{{- end }}
{{- range $key, $value := .Values.cluster.persistentVolume.annotations }}
{{ $key }}: {{ $value }}
@@ -7,11 +7,11 @@ apiVersion: {{ if .Capabilities.APIVersions.Has "storage.k8s.io/v1" -}}
kind: StorageClass
metadata:
labels:
app: "{{ template "name" . }}-cluster"
app: "{{ template "rethinkdb.name" . }}-cluster"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
name: {{ template "fullname" . }}
name: {{ template "rethinkdb.fullname" . }}
provisioner: {{ .Values.cluster.storageClass.provisioner }}
parameters:
{{- range $key, $value := .Values.cluster.storageClass.parameters }}
@@ -1,9 +1,9 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: "{{ template "fullname" . }}-proxy"
name: "{{ template "rethinkdb.fullname" . }}-proxy"
labels:
app: "{{ template "name" . }}-proxy"
app: "{{ template "rethinkdb.name" . }}-proxy"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
@@ -11,9 +11,9 @@ spec:
replicas: {{ .Values.proxy.replicas }}
template:
metadata:
name: {{ template "fullname" . }}-proxy
name: {{ template "rethinkdb.fullname" . }}-proxy
labels:
app: {{ template "name" . }}-proxy
app: {{ template "rethinkdb.name" . }}-proxy
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
@@ -23,7 +23,7 @@ spec:
{{- end }}
spec:
containers:
- name: {{ template "name" . }}-proxy
- name: {{ template "rethinkdb.name" . }}-proxy
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
ports:
@@ -49,11 +49,11 @@ spec:
- name: PROXY
value: "true"
- name: RETHINK_CLUSTER_SERVICE
value: "{{ template "fullname" . }}-cluster"
value: "{{ template "rethinkdb.fullname" . }}-cluster"
- name: RETHINKDB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
name: {{ template "rethinkdb.fullname" . }}
key: rethinkdb-password
- name: POD_IP
valueFrom:
@@ -75,4 +75,4 @@ spec:
projected:
sources:
- secret:
name: {{ template "fullname" . }}
name: {{ template "rethinkdb.fullname" . }}
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}-proxy
name: {{ template "rethinkdb.fullname" . }}-proxy
labels:
app: {{ template "name" . }}-proxy
app: {{ template "rethinkdb.name" . }}-proxy
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
@@ -29,5 +29,5 @@ spec:
- port: {{ .Values.ports.driver }}
targetPort: driver
selector:
app: {{ template "name" . }}-proxy
app: {{ template "rethinkdb.name" . }}-proxy
release: {{ .Release.Name }}
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}
name: {{ template "rethinkdb.fullname" . }}
labels:
app: {{ template "name" . }}
app: {{ template "rethinkdb.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"