1
+ { {/* vim: set filetype= mustache: */} }
2
+ { {/*
3
+ Expand the name of the chart.
4
+ */} }
5
+ { {- define " cp-control-center.name" -} }
6
+ { {- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix " -" -} }
7
+ { {- end -} }
8
+
9
+ { {/*
10
+ Create a default fully qualified app name.
11
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12
+ If release name contains chart name it will be used as a full name.
13
+ */} }
14
+ { {- define " cp-control-center.fullname" -} }
15
+ { {- if .Values.fullnameOverride -} }
16
+ { {- .Values.fullnameOverride | trunc 63 | trimSuffix " -" -} }
17
+ { {- else -} }
18
+ { {- $name := default .Chart.Name .Values.nameOverride -} }
19
+ { {- if contains $name .Release.Name -} }
20
+ { {- .Release.Name | trunc 63 | trimSuffix " -" -} }
21
+ { {- else -} }
22
+ { {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" -} }
23
+ { {- end -} }
24
+ { {- end -} }
25
+ { {- end -} }
26
+
27
+ { {/*
28
+ Create chart name and version as used by the chart label.
29
+ */} }
30
+ { {- define " cp-control-center.chart" -} }
31
+ { {- printf " %s-%s" .Chart.Name .Chart.Version | replace " +" " _" | trunc 63 | trimSuffix " -" -} }
32
+ { {- end -} }
33
+
34
+ { {/*
35
+ Create a default fully qualified kafka headless name.
36
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
37
+ */} }
38
+ { {- define " cp-control-center.cp-kafka-headless.fullname" -} }
39
+ { {- $name := " cp-kafka-headless" -} }
40
+ { {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" -} }
41
+ { {- end -} }
42
+
43
+ { {/*
44
+ Form the Kafka URL. If Kafka is installed as part of this chart, use k8s service discovery,
45
+ else use user-provided URL
46
+ */} }
47
+ { {- define " cp-control-center.kafka.bootstrapServers" -} }
48
+ { {- if .Values.kafka.bootstrapServers -} }
49
+ { {- .Values.kafka.bootstrapServers -} }
50
+ { {- else -} }
51
+ { {- printf " PLAINTEXT://%s:9092" (include " cp-control-center.cp-kafka-headless.fullname" .) -} }
52
+ { {- end -} }
53
+ { {- end -} }
54
+
55
+ { {/*
56
+ Create a default fully qualified schema registry name.
57
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
58
+ */} }
59
+ { {- define " cp-control-center.cp-schema-registry.fullname" -} }
60
+ { {- $name := default " cp-schema-registry" (index .Values " cp-schema-registry" " nameOverride" ) -} }
61
+ { {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" -} }
62
+ { {- end -} }
63
+
64
+ { {- define " cp-control-center.cp-schema-registry.service-name" -} }
65
+ { {- if (index .Values " cp-schema-registry" " url" ) -} }
66
+ { {- printf " %s" (index .Values " cp-schema-registry" " url" ) -} }
67
+ { {- else -} }
68
+ { {- printf " http://%s:8081" (include " cp-control-center.cp-schema-registry.fullname" .) -} }
69
+ { {- end -} }
70
+ { {- end -} }
71
+
72
+ { {/*
73
+ Create a default fully qualified connect name.
74
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
75
+ */} }
76
+ { {- define " cp-control-center.cp-kafka-connect.fullname" -} }
77
+ { {- $name := default " cp-kafka-connect" (index .Values " cp-kafka-connect" " nameOverride" ) -} }
78
+ { {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" -} }
79
+ { {- end -} }
80
+
81
+ { {- define " cp-control-center.cp-kafka-connect.service-name" -} }
82
+ { {- if (index .Values " cp-kafka-connect" " url" ) -} }
83
+ { {- printf " %s" (index .Values " cp-kafka-connect" " url" ) -} }
84
+ { {- else -} }
85
+ { {- printf " http://%s:8083" (include " cp-control-center.cp-kafka-connect.fullname" .) -} }
86
+ { {- end -} }
87
+ { {- end -} }
88
+
89
+ { {/*
90
+ Create a default fully qualified ksql name.
91
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
92
+ */} }
93
+ { {- define " cp-control-center.cp-ksql-server.fullname" -} }
94
+ { {- $name := default " cp-ksql-server" (index .Values " cp-ksql-server" " nameOverride" ) -} }
95
+ { {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" -} }
96
+ { {- end -} }
97
+
98
+ { {- define " cp-control-center.cp-ksql-server.service-name" -} }
99
+ { {- if (index .Values " cp-ksql-server" " url" ) -} }
100
+ { {- printf " %s" (index .Values " cp-ksql-server" " url" ) -} }
101
+ { {- else -} }
102
+ { {- printf " http://%s:8088" (include " cp-control-center.cp-ksql-server.fullname" .) -} }
103
+ { {- end -} }
104
+ { {- end -} }
105
+
106
+ { {/*
107
+ Create a default fully qualified zookeeper name.
108
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
109
+ */} }
110
+ { {- define " cp-control-center.cp-zookeeper.fullname" -} }
111
+ { {- $name := default " cp-zookeeper" (index .Values " cp-zookeeper" " nameOverride" ) -} }
112
+ { {- printf " %s-%s" .Release.Name $name | trunc 63 | trimSuffix " -" -} }
113
+ { {- end -} }
114
+
115
+ { {/*
116
+ Form the Zookeeper URL. If zookeeper is installed as part of this chart, use k8s service discovery,
117
+ else use user-provided URL
118
+ */} }
119
+ { {- define " cp-control-center.cp-zookeeper.service-name" } }
120
+ { {- if (index .Values " cp-zookeeper" " enabled" ) -} }
121
+ { {- $clientPort := default 2181 (index .Values " cp-zookeeper" " clientPort" ) | int -} }
122
+ { {- printf " %s:%d" (include " cp-control-center.cp-zookeeper.fullname" .) $clientPort } }
123
+ { {- else -} }
124
+ { {- $zookeeperConnect := printf " %s" (index .Values " cp-zookeeper" " url" ) } }
125
+ { {- $zookeeperConnectOverride := (index .Values " configurationOverrides" " zookeeper.connect" ) } }
126
+ { {- default $zookeeperConnect $zookeeperConnectOverride } }
127
+ { {- end -} }
128
+ { {- end -} }
0 commit comments