From 3263187ae69e5e258e0dcc4d62b0294a621b77a2 Mon Sep 17 00:00:00 2001 From: Andrew Kenworthy Date: Thu, 27 Jul 2023 10:40:32 +0200 Subject: [PATCH 1/2] working copy --- modules/ROOT/pages/getting_started.adoc | 97 ++++++++++++++----------- 1 file changed, 56 insertions(+), 41 deletions(-) diff --git a/modules/ROOT/pages/getting_started.adoc b/modules/ROOT/pages/getting_started.adoc index 329333e50..3256ab8fa 100644 --- a/modules/ROOT/pages/getting_started.adoc +++ b/modules/ROOT/pages/getting_started.adoc @@ -35,12 +35,6 @@ apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane - role: worker - kubeadmConfigPatches: - - | - kind: JoinConfiguration - nodeRegistration: - kubeletExtraArgs: - node-labels: node=quickstart-1 EOF ---- @@ -85,7 +79,7 @@ Stackable operators can be installed using stackablectl. Run the following comma [source,bash] ---- -stackablectl release install -i zookeeper -i kafka -i nifi -i secret 23.7 +stackablectl release install -i commons -i secret -i zookeeper -i kafka -i nifi 23.7 ---- .Using Helm instead @@ -104,10 +98,11 @@ Install the operators: [source,bash] ---- -helm install zookeeper-operator stackable-stable/zookeeper-operator --version=0.10.0 -helm install kafka-operator stackable-stable/kafka-operator --version=0.6.0 -helm install secret-operator stackable-stable/secret-operator --version=0.5.0 -helm install nifi-operator stackable-stable/nifi-operator --version=0.6.0 +helm install zookeeper-operator stackable-stable/zookeeper-operator --version=23.7 +helm install kafka-operator stackable-stable/kafka-operator --version=23.7 +helm install secret-operator stackable-stable/secret-operator --version=23.7 +helm install commons-operator stackable-stable/commons-operator --version=23.7 +helm install nifi-operator stackable-stable/nifi-operator --version=23.7 ---- ==== @@ -115,10 +110,11 @@ You can check which operators are installed using `stackablectl operator install ---- OPERATOR VERSION NAMESPACE STATUS LAST UPDATED -kafka 0.6.0 default deployed 2022-06-30 17:01:17.552606 +0100 BST -nifi 0.6.0 default deployed 2022-06-30 17:01:31.895733 +0100 BST -secret 0.5.0 default deployed 2022-06-30 17:07:48.542761 +0100 BST -zookeeper 0.10.0 default deployed 2022-06-30 17:01:47.032154 +0100 BST +commons 23.7.0 default deployed 2023-07-27 09:41:05.769685041 +0200 CEST +kafka 23.7.0 default deployed 2023-07-27 09:41:27.685845379 +0200 CEST +nifi 23.7.0 default deployed 2023-07-27 09:41:40.928558978 +0200 CEST +secret 23.7.0 default deployed 2023-07-27 09:41:51.820834174 +0200 CEST +zookeeper 23.7.0 default deployed 2023-07-27 09:41:54.972145417 +0200 CEST ---- == Deploying Stackable Services @@ -136,13 +132,26 @@ kind: ZookeeperCluster metadata: name: simple-zk spec: + image: + productVersion: "3.8.1" + stackableVersion: "23.7" + clusterConfig: + tls: + serverSecretClass: null servers: roleGroups: primary: replicas: 1 config: myidOffset: 10 - version: 3.8.0-stackable0 +--- +apiVersion: zookeeper.stackable.tech/v1alpha1 +kind: ZookeeperZnode +metadata: + name: simple-zk-znode +spec: + clusterRef: + name: simple-zk EOF ---- @@ -158,8 +167,13 @@ kind: KafkaCluster metadata: name: simple-kafka spec: - version: 2.8.1-stackable0 - zookeeperConfigMapName: simple-kafka-znode + image: + productVersion: "3.4.0" + stackableVersion: "23.7" + clusterConfig: + zookeeperConfigMapName: simple-kafka-znode + tls: + serverSecretClass: null brokers: roleGroups: brokers: @@ -204,23 +218,22 @@ kind: NifiCluster metadata: name: simple-nifi spec: - version: 1.16.3-stackable0.1.0 - zookeeperConfigMapName: simple-nifi-znode - config: + image: + productVersion: "1.21.0" + stackableVersion: "23.7" + clusterConfig: + listenerClass: external-unstable + zookeeperConfigMapName: simple-nifi-znode authentication: method: singleUser: adminCredentialsSecret: nifi-admin-credentials-simple - autoGenerate: true sensitiveProperties: keySecret: nifi-sensitive-property-key autoGenerate: true nodes: roleGroups: default: - config: - log: - rootLogLevel: INFO replicas: 1 EOF ---- @@ -228,17 +241,19 @@ EOF You can check the status of the services using `kubectl get pods`. This will retrieve the status of all pods running in the default namespace. ---- -NAME READY STATUS RESTARTS AGE -nifi-operator-deployment-64c98c779c-nw6h8 1/1 Running 0 24m -kafka-operator-deployment-54df9f86c7-psqgd 1/1 Running 0 24m -zookeeper-operator-deployment-767458d4f5-2czb9 1/1 Running 0 24m -secret-operator-daemonset-pddkv 2/2 Running 0 24m -simple-zk-server-primary-0 1/1 Running 0 23m -simple-kafka-broker-brokers-0 2/2 Running 0 21m -simple-nifi-node-default-0 1/1 Running 0 22m +NAME READY STATUS RESTARTS AGE +commons-operator-deployment-598c744f6f-gfj2h 1/1 Running 0 15m +kafka-operator-deployment-7c4bd694d5-xjwsj 1/1 Running 0 15m +nifi-operator-deployment-748d748487-qg885 1/1 Running 0 15m +secret-operator-daemonset-wr57f 3/3 Running 0 14m +simple-kafka-broker-brokers-0 2/2 Running 0 7m50s +simple-nifi-create-reporting-task-1-21-0-jltpv 0/1 Completed 4 5m13s +simple-nifi-node-default-0 1/1 Running 0 5m13s +simple-zk-server-primary-0 1/1 Running 0 14m +zookeeper-operator-deployment-64fcccc797-pckhf 1/1 Running 0 14m ---- -Since this is the first time that each of these services has been deployed to these nodes, it will take some time to download the software from the Stackable repository and deploy the services. Once all of the pods are in the running state your cluster is ready to use. +Since this is the first time that each of these services has been deployed to these nodes, it will take some time to download the software from the Stackable repository and deploy the services. Once all the pods are in the running state your cluster is ready to use. == Testing your cluster If all has gone well then you will have successfully deployed a Stackable cluster and used it to start three services that should now be ready for you. @@ -255,7 +270,7 @@ The shell should connect automatically to the ZooKeeper server running on the po ---- [zk: localhost:2181(CONNECTED) 0] ls / -[nifi, znode-17b28a7e-0d45-450b-8209-871225c6efa1, zookeeper] +[znode-81484420-e097-4b13-a121-84f0211b99db, znode-9076785e-39d0-49cc-b067-30be25bf4faa, znode-a4b12f66-48c2-40dc-91d8-a42135eaf371, zookeeper] ---- === Apache Kafka @@ -283,11 +298,11 @@ To get the IP address we need to connect to (in this case `172.18.0.2`), run: [source,bash] ---- -kubectl get nodes --selector=node=quickstart-1 -o wide +kubectl get nodes --selector=kubernetes.io/hostname=quickstart-worker -o wide ---- ---- -NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME -quickstart-worker Ready 45m v1.21.1 172.18.0.2 Ubuntu 21.04 5.15.0-25-generic containerd://1.5.2 +NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME +quickstart-worker Ready 25m v1.25.3 172.18.0.2 Ubuntu 22.04.1 LTS 5.14.0-1052-oem containerd://1.6.9 ---- @@ -299,11 +314,11 @@ kubectl get svc simple-nifi ---- ---- -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -simple-nifi NodePort 10.43.75.25 8443:30247/TCP 49m +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +simple-nifi NodePort 10.96.88.205 8443:30166/TCP 8m5s ---- -Browse to the address of your Kubernetes node on port `30247` e.g. https://172.18.0.2:30247/nifi and you should see the NiFi login screen. +Browse to the address of your Kubernetes node on port `30166` e.g. https://172.18.0.2:30166/nifi and you should see the NiFi login screen. image:nifi_login_screen.png[The Apache NiFi web interface login screen] From a14fc07c7f6b71f199106690af129a2f69982fb0 Mon Sep 17 00:00:00 2001 From: Andrew Kenworthy Date: Thu, 27 Jul 2023 11:09:29 +0200 Subject: [PATCH 2/2] simplify to single node --- modules/ROOT/pages/getting_started.adoc | 38 ++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/ROOT/pages/getting_started.adoc b/modules/ROOT/pages/getting_started.adoc index 3256ab8fa..1ad4cf53e 100644 --- a/modules/ROOT/pages/getting_started.adoc +++ b/modules/ROOT/pages/getting_started.adoc @@ -24,18 +24,11 @@ Kind offers a very quick and easy way to bootstrap your Kubernetes infrastructur If you don't already have Docker then visit https://docs.docker.com/get-docker/[Docker Website] to find out how to install Docker. Kind is a single executable that performs the tasks of installing and configuring Kubernetes for you within Docker containers. The https://kind.sigs.k8s.io/docs/user/quick-start/[Kind Website] has instructions for installing Kind on your system. -Once you have both of these installed then you can build a Kubernetes cluster in Docker. We're going to create a 2 node cluster to test out Stackable, one node hosting the Kubernetes control plane and the other hosting the Stackable services. +Once you have both of these installed then you can build a Kubernetes cluster in Docker. We're going to create a simple, single node cluster to test out Stackable, with the one node hosting both the Kubernetes control plane and the Stackable services. [source, bash] ---- -kind create cluster --name quickstart --config - << EOF ---- -kind: Cluster -apiVersion: kind.x-k8s.io/v1alpha4 -nodes: -- role: control-plane -- role: worker -EOF +kind create cluster --name quickstart ---- === Installing Kubernetes using K3s @@ -43,7 +36,7 @@ K3s provides a quick way of installing Kubernetes. On your control node run the [source,bash] ---- -curl -sfL https://get.k3s.io | sh -s - --node-label 'node=quickstart-1' --write-kubeconfig-mode 644 +curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644 ---- So long as you have an Internet connection K3s will download and automatically configure a simple Kubernetes environment. @@ -64,7 +57,14 @@ To check if everything worked as expected you can use `kubectl cluster-info` to ---- Kubernetes control plane is running at https://127.0.0.1:6443 CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy -Metrics-server is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy +---- + +If you set up your cluster using K3s you will additionally see the metrics server: + +---- +Kubernetes control plane is running at https://127.0.0.1:6443 +CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy +Metrics-server is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/https:metrics-server:https/proxy ---- == Installing Stackable @@ -298,15 +298,15 @@ To get the IP address we need to connect to (in this case `172.18.0.2`), run: [source,bash] ---- -kubectl get nodes --selector=kubernetes.io/hostname=quickstart-worker -o wide +kubectl get nodes -o wide ---- ---- -NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME -quickstart-worker Ready 25m v1.25.3 172.18.0.2 Ubuntu 22.04.1 LTS 5.14.0-1052-oem containerd://1.6.9 +NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME +quickstart-control-plane Ready control-plane 9m59s v1.25.3 172.18.0.2 Ubuntu 22.04.1 LTS 5.14.0-1052-oem containerd://1.6.9 ---- -With the following command we get the port (in this case `30247`): +With the following command we get the port (in this case `31931`): [source,bash] ---- @@ -314,15 +314,15 @@ kubectl get svc simple-nifi ---- ---- -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -simple-nifi NodePort 10.96.88.205 8443:30166/TCP 8m5s +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +simple-nifi NodePort 10.96.82.80 8443:31931/TCP 7m51s ---- -Browse to the address of your Kubernetes node on port `30166` e.g. https://172.18.0.2:30166/nifi and you should see the NiFi login screen. +Browse to the address of your Kubernetes node on port `31931` e.g. https://172.18.0.2:31931/nifi and you should see the NiFi login screen. image:nifi_login_screen.png[The Apache NiFi web interface login screen] -The Apache NiFi operator will automatically generate the admin user credentials with a random password and store it as a Kubernetes secret in order to provide some security out of the box. You can retrieve this password for the `admin` user with the following kubectl command. +If a password has not been specified for the admin user the Apache NiFi operator will automatically generate the admin user credentials with a random password and store it as a Kubernetes secret in order to provide some security out of the box. In the example above we have provided our own secret, but you can retrieve and confirm this password for the `admin` user with the following kubectl command. [source,bash] ----