1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
3
4
- # DO NOT EDIT THE SCRIPT
4
+ # DO NOT EDIT THE RENDERED SCRIPT
5
5
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
6
6
7
7
# The getting started guide script
@@ -29,7 +29,6 @@ echo "Installing Operators with Helm"
29
29
helm install --wait commons-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/commons-operator --version {{ versions.commons }}
30
30
helm install --wait secret-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/secret-operator --version {{ versions.secret }}
31
31
helm install --wait listener-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/listener-operator --version {{ versions.listener }}
32
- helm install --wait zookeeper-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/zookeeper-operator --version {{ versions.zookeeper }}
33
32
helm install --wait nifi-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/nifi-operator --version {{ versions.nifi }}
34
33
# end::helm-install-operators[]
35
34
;;
@@ -40,7 +39,6 @@ stackablectl operator install \
40
39
commons={{ versions.commons }} \
41
40
secret={{ versions.secret }} \
42
41
listener={{ versions.listener }} \
43
- zookeeper={{ versions.zookeeper }} \
44
42
nifi={{ versions.nifi }}
45
43
# end::stackablectl-install-operators[]
46
44
;;
@@ -50,62 +48,6 @@ exit 1
50
48
;;
51
49
esac
52
50
53
- internal=true
54
- if [ $# -eq 2 ]
55
- then
56
- case " $2 " in
57
- " InternalIP" )
58
- internal=true
59
- ;;
60
- " ExternalIP" )
61
- internal=false
62
- ;;
63
- * )
64
- echo " Need to provide 'InternalIP' or 'ExternalIP' as the connection type argument."
65
- exit 1
66
- ;;
67
- esac
68
- fi
69
-
70
- echo " Installing ZooKeeper"
71
- # tag::install-zookeeper[]
72
- kubectl apply -f - << EOF
73
- ---
74
- apiVersion: zookeeper.stackable.tech/v1alpha1
75
- kind: ZookeeperCluster
76
- metadata:
77
- name: simple-zk
78
- spec:
79
- image:
80
- productVersion: 3.9.3
81
- servers:
82
- roleGroups:
83
- default:
84
- replicas: 1
85
- EOF
86
- # end::install-zookeeper[]
87
-
88
- echo " Create a ZNode"
89
- # tag::install-znode[]
90
- kubectl apply -f - << EOF
91
- ---
92
- apiVersion: zookeeper.stackable.tech/v1alpha1
93
- kind: ZookeeperZnode
94
- metadata:
95
- name: simple-nifi-znode
96
- spec:
97
- clusterRef:
98
- name: simple-zk
99
- EOF
100
- # end::install-znode[]
101
-
102
- sleep 15
103
-
104
- echo " Awaiting ZooKeeper rollout finish"
105
- # tag::watch-zookeeper-rollout[]
106
- kubectl rollout status --watch --timeout=5m statefulset/simple-zk-server-default
107
- # end::watch-zookeeper-rollout[]
108
-
109
51
echo " Create NiFi admin credentials"
110
52
# tag::install-nifi-credentials[]
111
53
kubectl apply -f - << EOF
@@ -139,14 +81,13 @@ metadata:
139
81
name: simple-nifi
140
82
spec:
141
83
image:
142
- productVersion: 1.28.1
84
+ productVersion: 2.4.0
143
85
clusterConfig:
144
86
authentication:
145
87
- authenticationClass: simple-nifi-users
146
88
sensitiveProperties:
147
89
keySecret: nifi-sensitive-property-key
148
90
autoGenerate: true
149
- zookeeperConfigMapName: simple-nifi-znode
150
91
nodes:
151
92
roleConfig:
152
93
listenerClass: external-unstable
@@ -156,61 +97,26 @@ spec:
156
97
EOF
157
98
# end::install-nifi[]
158
99
159
- sleep 5
160
-
161
100
echo " Awaiting NiFi rollout finish"
162
101
# tag::wait-nifi-rollout[]
163
- kubectl wait -l statefulset.kubernetes.io/pod-name=simple-nifi-node-default-0 \
164
- --for=condition=ready pod --timeout=1200s
102
+ kubectl wait --for=condition=available --timeout=20m nificluster/simple-nifi
165
103
# end::wait-nifi-rollout[]
166
104
167
- sleep 5
168
-
169
105
case " $1 " in
170
106
" helm" )
107
+ echo " Getting the NiFi URL with kubectl"
171
108
172
- echo " Get a single node where a NiFi pod is running"
173
- # tag::get-nifi-node-name[]
174
- nifi_node_name=$( kubectl get endpoints simple-nifi --output=jsonpath=' {.subsets[0].addresses[0].nodeName}' ) && \
175
- echo " NodeName: $nifi_node_name "
176
- # end::get-nifi-node-name[]
177
-
178
-
179
- if [ " $internal " = true ] ; then
180
- echo " List $nifi_node_name node internal ip"
181
- # tag::get-nifi-node-ip-internal[]
182
- nifi_node_ip=$( kubectl get nodes -o jsonpath=" {.items[?(@.metadata.name==\" $nifi_node_name \" )].status.addresses[?(@.type==\" InternalIP\" )].address}" ) && \
183
- echo " NodeIp: $nifi_node_ip "
184
- # end::get-nifi-node-ip-internal[]
185
- else
186
- echo " List $nifi_node_name node external ip"
187
- # tag::get-nifi-node-ip-external[]
188
- nifi_node_ip=$( kubectl get nodes -o jsonpath=" {.items[?(@.metadata.name==\" $nifi_node_name \" )].status.addresses[?(@.type==\" ExternalIP\" )].address}" ) && \
189
- echo " NodeIp: $nifi_node_ip "
190
- # end::get-nifi-node-ip-external[]
191
- fi
192
-
193
- echo " Get node port from service"
194
- # tag::get-nifi-service-port[]
195
- nifi_service_port=$( kubectl get service -o jsonpath=" {.items[?(@.metadata.name==\" simple-nifi\" )].spec.ports[?(@.name==\" https\" )].nodePort}" ) && \
196
- echo " NodePort: $nifi_service_port "
197
- # end::get-nifi-service-port[]
198
-
199
- echo " Create NiFi url"
200
- # tag::create-nifi-url[]
201
- nifi_url=" https://$nifi_node_ip :$nifi_service_port " && \
202
- echo " NiFi web interface: $nifi_url "
203
- # end::create-nifi-url[]
204
-
109
+ # tag::get-nifi-url[]
110
+ nifi_url=$( kubectl get listener simple-nifi-node -o ' jsonpath=https://{.status.ingressAddresses[0].address}:{.status.ingressAddresses[0].ports.https}' ) && \
111
+ echo " NiFi URL: $nifi_url "
112
+ # end::get-nifi-url[]
205
113
;;
206
114
" stackablectl" )
207
-
208
- echo " Getting NiFi endpoint with stackablectl ..."
115
+ echo " Getting NiFi URL with stackablectl ..."
209
116
# tag::stackablectl-nifi-url[]
210
- nifi_url=$( stackablectl stacklet ls -o json | jq --raw-output ' .[] | select(.name == "simple-nifi") | .endpoints. https' )
117
+ nifi_url=$( stackablectl stacklet ls -o json | jq --raw-output ' .[] | select(.name == "simple-nifi") | .endpoints["node- https"] ' )
211
118
# end::stackablectl-nifi-url[]
212
- echo " Endpoint: $nifi_url "
213
-
119
+ echo " NiFi URL: $nifi_url "
214
120
;;
215
121
* )
216
122
echo " Need to provide 'helm' or 'stackablectl' as an argument for which installation method to use!"
0 commit comments