From 0980e06c745b9868df53e75efc3a63f1d9f5fe83 Mon Sep 17 00:00:00 2001 From: Kevin Schumacher Date: Fri, 17 Nov 2017 03:28:38 -0500 Subject: [PATCH] [stable/phabricator] #1785 namespace defined templates with chart name (#2162) --- stable/phabricator/Chart.yaml | 2 +- stable/phabricator/templates/NOTES.txt | 18 ++++++------ stable/phabricator/templates/_helpers.tpl | 12 ++++---- stable/phabricator/templates/apache-pvc.yaml | 4 +-- stable/phabricator/templates/deployment.yaml | 28 +++++++++---------- .../templates/phabricator-pvc.yaml | 4 +-- stable/phabricator/templates/secrets.yaml | 4 +-- stable/phabricator/templates/svc.yaml | 6 ++-- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/stable/phabricator/Chart.yaml b/stable/phabricator/Chart.yaml index 4f8571b891..a62ce8501d 100644 --- a/stable/phabricator/Chart.yaml +++ b/stable/phabricator/Chart.yaml @@ -1,5 +1,5 @@ name: phabricator -version: 0.4.27 +version: 0.5.0 appVersion: 2017.45.0 description: Collection of open source web applications that help software companies build better software. keywords: diff --git a/stable/phabricator/templates/NOTES.txt b/stable/phabricator/templates/NOTES.txt index 918b7142f8..37ae456e93 100644 --- a/stable/phabricator/templates/NOTES.txt +++ b/stable/phabricator/templates/NOTES.txt @@ -1,4 +1,4 @@ -{{- if empty (include "host" .) -}} +{{- if empty (include "phabricator.host" .) -}} ############################################################################### ### ERROR: You did not provide an external host in your 'helm install' call ### ############################################################################### @@ -10,18 +10,18 @@ host. To configure Phabricator with the URL of your service: {{- if contains "NodePort" .Values.serviceType }} - export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") + export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "phabricator.fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") {{- 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 --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "phabricator.fullname" . }}' - export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") - export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.phabricator-password}" | base64 --decode) + export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "phabricator.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") + export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "phabricator.fullname" . }} -o jsonpath="{.data.phabricator-password}" | base64 --decode) {{- if .Values.mariadb.mariadbRootPassword }} - export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) + export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "phabricator.mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) {{- end }} {{- end }} @@ -35,16 +35,16 @@ host. To configure Phabricator with the URL of your service: {{- if eq .Values.serviceType "ClusterIP" }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "phabricator.fullname" . }}" -o jsonpath="{.items[0].metadata.name}") echo http://127.0.0.1:8080/ kubectl port-forward $POD_NAME 8080:80 {{- else }} - echo URL : http://{{ include "host" . }}/ + echo URL : http://{{ include "phabricator.host" . }}/ {{- end }} 2. Get your Phabricator login credentials by running: echo Username: {{ .Values.phabricatorUsername }} - echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.phabricator-password}" | base64 --decode) + echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "phabricator.fullname" . }} -o jsonpath="{.data.phabricator-password}" | base64 --decode) {{- end }} diff --git a/stable/phabricator/templates/_helpers.tpl b/stable/phabricator/templates/_helpers.tpl index 2463906531..196d93969c 100644 --- a/stable/phabricator/templates/_helpers.tpl +++ b/stable/phabricator/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "name" -}} +{{- define "phabricator.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 "phabricator.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -19,7 +19,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this 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 "mariadb.fullname" -}} +{{- define "phabricator.mariadb.fullname" -}} {{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -27,7 +27,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this Get the user defined LoadBalancerIP for this release. Note, returns 127.0.0.1 if using ClusterIP. */}} -{{- define "serviceIP" -}} +{{- define "phabricator.serviceIP" -}} {{- if eq .Values.serviceType "ClusterIP" -}} 127.0.0.1 {{- else -}} @@ -39,7 +39,7 @@ Note, returns 127.0.0.1 if using ClusterIP. Gets the host to be used for this application. If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value will be empty. */}} -{{- define "host" -}} +{{- define "phabricator.host" -}} {{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}} -{{- default (include "serviceIP" .) $host -}} +{{- default (include "phabricator.serviceIP" .) $host -}} {{- end -}} diff --git a/stable/phabricator/templates/apache-pvc.yaml b/stable/phabricator/templates/apache-pvc.yaml index 1ae6762ef2..c2465dcea4 100644 --- a/stable/phabricator/templates/apache-pvc.yaml +++ b/stable/phabricator/templates/apache-pvc.yaml @@ -2,9 +2,9 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ template "fullname" . }}-apache + name: {{ template "phabricator.fullname" . }}-apache labels: - app: {{ template "fullname" . }} + app: {{ template "phabricator.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" diff --git a/stable/phabricator/templates/deployment.yaml b/stable/phabricator/templates/deployment.yaml index 333eca5a26..cc0f54e519 100644 --- a/stable/phabricator/templates/deployment.yaml +++ b/stable/phabricator/templates/deployment.yaml @@ -1,10 +1,10 @@ -{{- if include "host" . -}} +{{- if include "phabricator.host" . -}} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ template "fullname" . }} + name: {{ template "phabricator.fullname" . }} labels: - app: {{ template "fullname" . }} + app: {{ template "phabricator.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -12,30 +12,30 @@ spec: template: metadata: labels: - app: {{ template "fullname" . }} + app: {{ template "phabricator.fullname" . }} spec: containers: - - name: {{ template "fullname" . }} + - name: {{ template "phabricator.fullname" . }} image: "{{ .Values.image }}" imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} env: - name: MARIADB_HOST - value: {{ template "mariadb.fullname" . }} + value: {{ template "phabricator.mariadb.fullname" . }} - name: MARIADB_PORT_NUMBER value: "3306" - name: MARIADB_PASSWORD valueFrom: secretKeyRef: - name: {{ template "mariadb.fullname" . }} + name: {{ template "phabricator.mariadb.fullname" . }} key: mariadb-root-password - name: PHABRICATOR_HOST - value: {{ include "host" . | quote }} + value: {{ include "phabricator.host" . | quote }} - name: PHABRICATOR_USERNAME value: {{ default "" .Values.phabricatorUsername | quote }} - name: PHABRICATOR_PASSWORD valueFrom: secretKeyRef: - name: {{ template "fullname" . }} + name: {{ template "phabricator.fullname" . }} key: phabricator-password - name: PHABRICATOR_EMAIL value: {{ default "" .Values.phabricatorEmail | quote }} @@ -52,7 +52,7 @@ spec: - name: SMTP_PASSWORD valueFrom: secretKeyRef: - name: {{ template "fullname" . }} + name: {{ template "phabricator.fullname" . }} key: smtp-password - name: SMTP_PROTOCOL value: {{ default "" .Values.smtpProtocol | quote }} @@ -67,7 +67,7 @@ spec: port: http httpHeaders: - name: Host - value: {{ include "host" . | quote }} + value: {{ include "phabricator.host" . | quote }} initialDelaySeconds: 180 timeoutSeconds: 5 failureThreshold: 6 @@ -77,7 +77,7 @@ spec: port: http httpHeaders: - name: Host - value: {{ include "host" . | quote }} + value: {{ include "phabricator.host" . | quote }} initialDelaySeconds: 30 timeoutSeconds: 3 periodSeconds: 5 @@ -92,14 +92,14 @@ spec: - name: phabricator-data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "fullname" . }}-phabricator + claimName: {{ template "phabricator.fullname" . }}-phabricator {{- else }} emptyDir: {} {{- end }} - name: apache-data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "fullname" . }}-apache + claimName: {{ template "phabricator.fullname" . }}-apache {{- else }} emptyDir: {} {{- end }} diff --git a/stable/phabricator/templates/phabricator-pvc.yaml b/stable/phabricator/templates/phabricator-pvc.yaml index b780d1cfc4..43fa8a116c 100644 --- a/stable/phabricator/templates/phabricator-pvc.yaml +++ b/stable/phabricator/templates/phabricator-pvc.yaml @@ -2,9 +2,9 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ template "fullname" . }}-phabricator + name: {{ template "phabricator.fullname" . }}-phabricator labels: - app: {{ template "fullname" . }} + app: {{ template "phabricator.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" diff --git a/stable/phabricator/templates/secrets.yaml b/stable/phabricator/templates/secrets.yaml index 013c9f8751..0fa0a62b7f 100644 --- a/stable/phabricator/templates/secrets.yaml +++ b/stable/phabricator/templates/secrets.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Secret metadata: - name: {{ template "fullname" . }} + name: {{ template "phabricator.fullname" . }} labels: - app: {{ template "fullname" . }} + app: {{ template "phabricator.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" diff --git a/stable/phabricator/templates/svc.yaml b/stable/phabricator/templates/svc.yaml index 1fc9f08699..8dbc8d6c5e 100644 --- a/stable/phabricator/templates/svc.yaml +++ b/stable/phabricator/templates/svc.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }} + name: {{ template "phabricator.fullname" . }} labels: - app: {{ template "fullname" . }} + app: {{ template "phabricator.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" @@ -20,4 +20,4 @@ spec: port: 443 targetPort: https selector: - app: {{ template "fullname" . }} + app: {{ template "phabricator.fullname" . }}