-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy path_helpers.tpl
More file actions
64 lines (57 loc) · 1.58 KB
/
_helpers.tpl
File metadata and controls
64 lines (57 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{{/*
Expand the name of the chart.
*/}}
{{- define "api-service.name" -}}
{{ .Values.name }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "api-service.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "api-service.labels" -}}
helm.sh/chart: {{ include "api-service.chart" . }}
{{ include "api-service.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
{{- with .Values.global.labels }}
{{ toYaml . }}
{{- end }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "api-service.selectorLabels" -}}
{{- if .Values.global.selectorLabels }}
{{ tpl (toYaml .Values.global.selectorLabels) . }}
{{- end }}
{{- end }}
{{- define "api-service.backendAddr" -}}
{{ if .Values.backendAddr }}
{{- .Values.backendAddr -}}
{{ else }}
{{- printf "http://envhub.%s.svc.cluster.local:8083" .Values.global.namespace -}}
{{ end }}
{{ end }}
{{- define "api-service.scheduleAddr" -}}
{{ if .Values.scheduleAddr }}
{{- .Values.scheduleAddr -}}
{{ else }}
{{- printf "http://controller.%s.svc.cluster.local:8080" .Values.global.namespace -}}
{{ end }}
{{ end }}
{{- define "api-service.scheduleType" -}}
{{ if .Values.scheduleType }}
{{- .Values.scheduleType -}}
{{ else }}
{{- printf "k8s" -}}
{{ end }}
{{ end }}
{{- define "api-service.qps" -}}
{{- if .Values.qps }}{{ printf "%v" .Values.qps }}{{ else }}{{ "10" }}{{ end }}
{{- end }}