github.com/replicatedhq/ship@v0.55.0/integration/failing/init/jaeger-helm/expected/.ship/upstream/templates/_helpers.tpl (about) 1 {{/* vim: set filetype=mustache: */}} 2 3 {{/* 4 Return the appropriate apiVersion for cronjob APIs. 5 */}} 6 {{- define "cronjob.apiVersion" -}} 7 {{- if .Capabilities.APIVersions.Has "batch/v1beta1" -}} 8 "batch/v1beta1" 9 {{- else -}} 10 "batch/v2alpha1" 11 {{- end -}} 12 {{- end -}} 13 14 {{/* 15 Expand the name of the chart. 16 */}} 17 {{- define "jaeger.name" -}} 18 {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 19 {{- end -}} 20 21 {{/* 22 Create a default fully qualified app name. 23 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec) 24 If release name contains chart name it will be used as a full name. 25 */}} 26 {{- define "jaeger.fullname" -}} 27 {{- if .Values.fullnameOverride -}} 28 {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 29 {{- else -}} 30 {{- $name := default .Chart.Name .Values.nameOverride -}} 31 {{- if contains $name .Release.Name -}} 32 {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 33 {{- else -}} 34 {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 35 {{- end -}} 36 {{- end -}} 37 {{- end -}} 38 39 {{/* 40 Create a fully qualified query name. 41 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 42 */}} 43 {{- define "jaeger.query.name" -}} 44 {{- $nameGlobalOverride := printf "%s-query" (include "jaeger.fullname" .) -}} 45 {{- if .Values.query.fullnameOverride -}} 46 {{- printf "%s" .Values.query.fullnameOverride | trunc 63 | trimSuffix "-" -}} 47 {{- else -}} 48 {{- printf "%s" $nameGlobalOverride | trunc 63 | trimSuffix "-" -}} 49 {{- end -}} 50 {{- end -}} 51 52 {{/* 53 Create a fully qualified agent name. 54 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 55 */}} 56 {{- define "jaeger.agent.name" -}} 57 {{- $nameGlobalOverride := printf "%s-agent" (include "jaeger.fullname" .) -}} 58 {{- if .Values.agent.fullnameOverride -}} 59 {{- printf "%s" .Values.agent.fullnameOverride | trunc 63 | trimSuffix "-" -}} 60 {{- else -}} 61 {{- printf "%s" $nameGlobalOverride | trunc 63 | trimSuffix "-" -}} 62 {{- end -}} 63 {{- end -}} 64 65 {{/* 66 Create a fully qualified collector name. 67 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 68 */}} 69 {{- define "jaeger.collector.name" -}} 70 {{- $nameGlobalOverride := printf "%s-collector" (include "jaeger.fullname" .) -}} 71 {{- if .Values.collector.fullnameOverride -}} 72 {{- printf "%s" .Values.collector.fullnameOverride | trunc 63 | trimSuffix "-" -}} 73 {{- else -}} 74 {{- printf "%s" $nameGlobalOverride | trunc 63 | trimSuffix "-" -}} 75 {{- end -}} 76 {{- end -}} 77 78 {{- define "cassandra.host" -}} 79 {{- if .Values.provisionDataStore.cassandra -}} 80 {{- if .Values.storage.cassandra.nameOverride }} 81 {{- printf "%s" .Values.storage.cassandra.nameOverride | trunc 63 | trimSuffix "-" }} 82 {{- else }} 83 {{- printf "%s-%s" .Release.Name "cassandra" | trunc 63 | trimSuffix "-" -}} 84 {{- end -}} 85 {{- else }} 86 {{- .Values.storage.cassandra.host }} 87 {{- end -}} 88 {{- end -}} 89 90 {{- define "cassandra.contact_points" -}} 91 {{- $port := .Values.storage.cassandra.port | toString }} 92 {{- if .Values.provisionDataStore.cassandra -}} 93 {{- if .Values.storage.cassandra.nameOverride }} 94 {{- $host := printf "%s" .Values.storage.cassandra.nameOverride | trunc 63 | trimSuffix "-" -}} 95 {{- printf "%s:%s" $host $port }} 96 {{- else }} 97 {{- $host := printf "%s-%s" .Release.Name "cassandra" | trunc 63 | trimSuffix "-" -}} 98 {{- printf "%s:%s" $host $port }} 99 {{- end -}} 100 {{- else }} 101 {{- printf "%s:%s" .Values.storage.cassandra.host $port }} 102 {{- end -}} 103 {{- end -}} 104 105 {{/* 106 Create a default fully qualified app name. 107 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 108 */}} 109 {{- define "elasticsearch.client.url" -}} 110 {{- $port := .Values.storage.elasticsearch.port | toString -}} 111 {{- if .Values.provisionDataStore.elasticsearch -}} 112 {{- if .Values.storage.elasticsearch.nameOverride }} 113 {{- $host := printf "%s" .Values.storage.elasticsearch.nameOverride | trunc 63 | trimSuffix "-" -}} 114 {{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme $host $port }} 115 {{- else }} 116 {{- $host := printf "%s-%s-%s" .Release.Name "elasticsearch" "client" | trunc 63 | trimSuffix "-" -}} 117 {{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme $host $port }} 118 {{- end -}} 119 {{- else }} 120 {{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme .Values.storage.elasticsearch.host $port }} 121 {{- end -}} 122 {{- end -}} 123 124 {{- define "jaeger.collector.host-port" -}} 125 {{- if .Values.agent.collector.host }} 126 {{- printf "%s:%s" .Values.agent.collector.host (default .Values.collector.service.tchannelPort .Values.agent.collector.port | toString) }} 127 {{- else }} 128 {{- printf "%s:%s" (include "jaeger.collector.name" .) (default .Values.collector.service.tchannelPort .Values.agent.collector.port | toString) }} 129 {{- end -}} 130 {{- end -}} 131 132 {{- define "jaeger.hotrod.tracing.host" -}} 133 {{- $host := printf "%s-agent" (include "jaeger.agent.name" .) -}} 134 {{- default $host .Values.hotrod.tracing.host -}} 135 {{- end -}} 136 137 {{/* 138 Configure list of IP CIDRs allowed access to load balancer (if supported) 139 */}} 140 {{- define "loadBalancerSourceRanges" -}} 141 {{- if .service.loadBalancerSourceRanges }} 142 loadBalancerSourceRanges: 143 {{- range $cidr := .service.loadBalancerSourceRanges }} 144 - {{ $cidr }} 145 {{- end }} 146 {{- end }} 147 {{- end -}}