From e16462f5d086d359d130941966fd8327e49a65ae Mon Sep 17 00:00:00 2001 From: Kevin Schumacher Date: Wed, 4 Oct 2017 14:55:12 -0400 Subject: [PATCH] [stable/rethinkdb] #1785 namespace defined templates with chart name (#2158) --- stable/rethinkdb/Chart.yaml | 2 +- stable/rethinkdb/templates/NOTES.txt | 16 ++++++++-------- stable/rethinkdb/templates/_helpers.tpl | 4 ++-- .../templates/rethinkdb-admin-service.yaml | 6 +++--- .../templates/rethinkdb-cluster-service.yaml | 6 +++--- .../rethinkdb-cluster-stateful-set.yaml | 18 +++++++++--------- .../rethinkdb-cluster-storage-class.yaml | 4 ++-- .../templates/rethinkdb-proxy-deployment.yaml | 16 ++++++++-------- .../templates/rethinkdb-proxy-service.yaml | 6 +++--- .../rethinkdb/templates/rethinkdb-secrets.yaml | 4 ++-- 10 files changed, 41 insertions(+), 41 deletions(-) diff --git a/stable/rethinkdb/Chart.yaml b/stable/rethinkdb/Chart.yaml index 34a588dc6c..5be90777c4 100644 --- a/stable/rethinkdb/Chart.yaml +++ b/stable/rethinkdb/Chart.yaml @@ -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 diff --git a/stable/rethinkdb/templates/NOTES.txt b/stable/rethinkdb/templates/NOTES.txt index dcbc6744f8..c341d08302 100644 --- a/stable/rethinkdb/templates/NOTES.txt +++ b/stable/rethinkdb/templates/NOTES.txt @@ -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 diff --git a/stable/rethinkdb/templates/_helpers.tpl b/stable/rethinkdb/templates/_helpers.tpl index f0d83d2edb..30cca97746 100644 --- a/stable/rethinkdb/templates/_helpers.tpl +++ b/stable/rethinkdb/templates/_helpers.tpl @@ -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 -}} diff --git a/stable/rethinkdb/templates/rethinkdb-admin-service.yaml b/stable/rethinkdb/templates/rethinkdb-admin-service.yaml index ba4a5e78bf..fdc7347104 100644 --- a/stable/rethinkdb/templates/rethinkdb-admin-service.yaml +++ b/stable/rethinkdb/templates/rethinkdb-admin-service.yaml @@ -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 }} diff --git a/stable/rethinkdb/templates/rethinkdb-cluster-service.yaml b/stable/rethinkdb/templates/rethinkdb-cluster-service.yaml index 865bca32d0..c3c0ab262b 100644 --- a/stable/rethinkdb/templates/rethinkdb-cluster-service.yaml +++ b/stable/rethinkdb/templates/rethinkdb-cluster-service.yaml @@ -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 }} diff --git a/stable/rethinkdb/templates/rethinkdb-cluster-stateful-set.yaml b/stable/rethinkdb/templates/rethinkdb-cluster-stateful-set.yaml index d316a8d8a7..c0c5488ffa 100644 --- a/stable/rethinkdb/templates/rethinkdb-cluster-stateful-set.yaml +++ b/stable/rethinkdb/templates/rethinkdb-cluster-stateful-set.yaml @@ -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 }} diff --git a/stable/rethinkdb/templates/rethinkdb-cluster-storage-class.yaml b/stable/rethinkdb/templates/rethinkdb-cluster-storage-class.yaml index fd30f29ef5..6c5d2874d1 100644 --- a/stable/rethinkdb/templates/rethinkdb-cluster-storage-class.yaml +++ b/stable/rethinkdb/templates/rethinkdb-cluster-storage-class.yaml @@ -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 }} diff --git a/stable/rethinkdb/templates/rethinkdb-proxy-deployment.yaml b/stable/rethinkdb/templates/rethinkdb-proxy-deployment.yaml index 662ef25dec..ec40081585 100644 --- a/stable/rethinkdb/templates/rethinkdb-proxy-deployment.yaml +++ b/stable/rethinkdb/templates/rethinkdb-proxy-deployment.yaml @@ -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" . }} diff --git a/stable/rethinkdb/templates/rethinkdb-proxy-service.yaml b/stable/rethinkdb/templates/rethinkdb-proxy-service.yaml index 1fb7d4d23a..cc74d8942e 100644 --- a/stable/rethinkdb/templates/rethinkdb-proxy-service.yaml +++ b/stable/rethinkdb/templates/rethinkdb-proxy-service.yaml @@ -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 }} diff --git a/stable/rethinkdb/templates/rethinkdb-secrets.yaml b/stable/rethinkdb/templates/rethinkdb-secrets.yaml index d9cdc506a2..508461955d 100644 --- a/stable/rethinkdb/templates/rethinkdb-secrets.yaml +++ b/stable/rethinkdb/templates/rethinkdb-secrets.yaml @@ -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 }}"