-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default naming to not include release name
- Loading branch information
1 parent
be5fd8d
commit 7580133
Showing
14 changed files
with
157 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- /* | ||
Common labels | ||
*/}} | ||
{{- define "binderhub-service.labels" -}} | ||
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{ include "binderhub-service.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{- /* | ||
Selector labels | ||
*/}} | ||
{{- define "binderhub-service.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ .Values.nameOverride | default .Chart.Name | trunc 63 | trimSuffix "-" }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{{- /* | ||
These helpers encapsulates logic on how we name resources. They also enable | ||
parent charts to reference these dynamic resource names. | ||
To avoid duplicating documentation, for more information, please see the the | ||
fullnameOverride entry the jupyterhub chart's configuration reference: | ||
https://z2jh.jupyter.org/en/latest/resources/reference.html#fullnameOverride | ||
*/}} | ||
{{- /* | ||
Utility templates | ||
*/}} | ||
{{- /* | ||
Renders to a prefix for the chart's resource names. This prefix is assumed to | ||
make the resource name cluster unique. | ||
*/}} | ||
{{- define "binderhub-service.fullname" -}} | ||
{{- /* | ||
We have implemented a trick to allow a parent chart depending on this | ||
chart to call these named templates. | ||
Caveats and notes: | ||
1. While parent charts can reference these, grandparent charts can't. | ||
2. Parent charts must not use an alias for this chart. | ||
3. There is no failsafe workaround to above due to | ||
https://github.com/helm/helm/issues/9214. | ||
4. .Chart is of its own type (*chart.Metadata) and needs to be casted | ||
using "toYaml | fromYaml" in order to be able to use normal helm | ||
template functions on it. | ||
*/}} | ||
{{- $fullname_override := .Values.fullnameOverride }} | ||
{{- $name_override := .Values.nameOverride }} | ||
{{- if ne .Chart.Name "binderhub-service" }} | ||
{{- if .Values.jupyterhub }} | ||
{{- $fullname_override = .Values.jupyterhub.fullnameOverride }} | ||
{{- $name_override = .Values.jupyterhub.nameOverride }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if eq (typeOf $fullname_override) "string" }} | ||
{{- $fullname_override }} | ||
{{- else }} | ||
{{- $name := $name_override | default .Chart.Name }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name }} | ||
{{- else }} | ||
{{- .Release.Name }}-{{ $name }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- /* | ||
Renders to a blank string or if the fullname template is truthy renders to it | ||
with an appended dash. | ||
*/}} | ||
{{- define "binderhub-service.fullname.dash" -}} | ||
{{- if (include "binderhub-service.fullname" .) }} | ||
{{- include "binderhub-service.fullname" . }}- | ||
{{- end }} | ||
{{- end }} | ||
{{- /* | ||
Namespaced resources | ||
*/}} | ||
{{- /* binderhub resources' default name */}} | ||
{{- define "binderhub-service.binderhub.fullname" -}} | ||
{{- include "binderhub-service.fullname.dash" . }}binderhub | ||
{{- end }} | ||
|
||
{{- /* binderhub's ServiceAccount name */}} | ||
{{- define "binderhub-service.binderhub.serviceaccount.fullname" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- .Values.serviceAccount.name | default (include "binderhub-service.binderhub.fullname" .) }} | ||
{{- else }} | ||
{{- .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
{{- /* binderhub's Ingress name */}} | ||
{{- define "binderhub-service.binderhub.ingress.fullname" -}} | ||
{{- if (include "binderhub-service.fullname" .) }} | ||
{{- include "binderhub-service.fullname" . }} | ||
{{- else -}} | ||
binderhub | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- /* docker-api resources' default name */}} | ||
{{- define "binderhub-service.docker-api.fullname" -}} | ||
{{- include "binderhub-service.fullname.dash" . }}docker-api | ||
{{- end }} | ||
{{- /* build-pods-docker-config name */}} | ||
{{- define "binderhub-service.build-pods-docker-config.fullname" -}} | ||
{{- include "binderhub-service.fullname.dash" . }}build-pods-docker-config | ||
{{- end }} | ||
{{- /* | ||
Cluster wide resources | ||
We enforce uniqueness of names for our cluster wide resources. We assume that | ||
the prefix from setting fullnameOverride to null or a string will be cluster | ||
unique. | ||
*/}} | ||
{{- /* | ||
We currently have no cluster wide resources, but if you add one below in the | ||
future, remove this comment and add an entry mimicing how the jupyterhub helm | ||
chart does it. | ||
*/}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters