33
44# This is a dirty hack to get two K8s nodes running on a single machine.
55# Use the shortname if hostname returns the FQDN or vice versa.
6+ if [ " $( hostname -s) " = " $( hostname -f) " ]; then
7+ echo " Shortname matches FQDN. Host must have a dot in its hostname."
8+ exit 1
9+ fi
10+
611if [ " $( hostname) " = " $( hostname -f) " ]; then
712 K8S_HOSTNAME=` /usr/bin/hostname -s`
813else
@@ -192,27 +197,31 @@ function install_stackable_agent {
192197function deploy_zookeeper {
193198 echo " Deploying Apache Zookeeper"
194199 kubectl apply -f - << EOF
195- apiVersion: zookeeper.stackable.tech/v1
200+ ---
201+ apiVersion: zookeeper.stackable.tech/v1alpha1
196202kind: ZookeeperCluster
197203metadata:
198204 name: simple
199205spec:
200- version: 3.4.14
206+ version: 3.5.8
201207 servers:
202- selectors :
208+ roleGroups :
203209 default:
204210 selector:
205211 matchLabels:
206212 kubernetes.io/hostname: ${K8S_HOSTNAME}
207- instances: 1
208- instancesPerNode: 1
213+ replicas: 3
214+ config:
215+ adminPort: 12000
216+ metricsPort: 9505
209217EOF
210218}
211219
212220function deploy_kafka {
213221 echo Deploying Apache Kafka
214222 kubectl apply -f - << EOF
215- apiVersion: kafka.stackable.tech/v1
223+ ---
224+ apiVersion: kafka.stackable.tech/v1alpha1
216225kind: KafkaCluster
217226metadata:
218227 name: simple
@@ -222,17 +231,16 @@ spec:
222231 zookeeperReference:
223232 namespace: default
224233 name: simple
225- opaReference:
226- namespace: default
227- name: simple-opacluster
228234 brokers:
229- selectors :
235+ roleGroups :
230236 default:
231237 selector:
232238 matchLabels:
233239 kubernetes.io/hostname: ${K8S_HOSTNAME}
234- instances: 1
235- instancesPerNode: 1
240+ replicas: 3
241+ config:
242+ logDirs: "/tmp/kafka-logs"
243+ metricsPort: 9606
236244EOF
237245}
238246
@@ -285,28 +293,29 @@ EOF
285293function deploy_nifi {
286294echo Deploying Apache Nifi
287295kubectl apply -f - << EOF
288- apiVersion: nifi.stackable.tech/v1
296+ ---
297+ apiVersion: nifi.stackable.tech/v1alpha1
289298kind: NifiCluster
290299metadata:
291- name: simple-nificluster
300+ name: simple
292301spec:
302+ metricsPort: 8428
293303 version: "1.13.2"
294304 zookeeperReference:
295305 name: simple
296306 namespace: default
297307 chroot: /nifi
298308 nodes:
299- selectors :
309+ roleGroups :
300310 default:
301311 selector:
302312 matchLabels:
303313 kubernetes.io/hostname: ${K8S_HOSTNAME}
304- instances: 1
305- instancesPerNode: 1
314+ replicas: 3
306315 config:
307- httpPort : 10000
308- nodeProtocolPort : 10443
309- nodeLoadBalancingPort : 6342
316+ nifiWebHttpPort : 10000
317+ nifiClusterNodeProtocolPort : 10443
318+ nifiClusterLoadBalancePort : 6342
310319EOF
311320}
312321
0 commit comments