링크 : community.cloudera.com/t5/Community-Articles/Deploy-NiFi-On-Kubernetes/ta-p/269758
위의 글이 사라지기 전에 여기 복붙해둔다.
sunile_manjee Created on 09-04-2019 11:47 AM - edited 09-04-2019 01:53 PM
My Kubernetes series (Part1, Part2) was strictly focused on MiNiFi on K8S. NiFi and MiNiFi may communicate over Site 2 Site; however, often the pattern is to leverage Kafka for a clean message handoff. NiFi within these patterns is generally the central router and transformer of messages. Think of it like "FedEx" for data. Till now most have deployed NiFi on bare metal or VMs. Natural evolution kicks in. Deploy NiFi on k8s and yes it's super simple. In this article I will demonstrate how to deploy both a NiFi and ZooKeeper cluster (none being a single pod!) on Azure Kubernetes Service (AKS); however, all artifacts may be leveraged to deploy on virtually any kubernetes offering.
Prerequisites
- Some knowledge of Kubernetes and NiFi
- AKS / k8s Cluster
- kubectl cli
- NiFi image available in a registry (ie dockerhub)
Deployment
All the contents in the ymls below can be placed into single file for deployment. For this demonstration, chucking it into smaller components makes it easier to explain.
I have loaded a NiFi image into Azure Container Repository. You can use the NiFi image available here in DockerHub.
Zookeeper
NiFi uses ZooKeeper for several state management functions. More on that here. ZooKeeper for NiFi can be deployed using embedded or stand alone mode. Here I will deploy 3 pods of ZK on k8s. Deploying ZK on k8s is super simple.
kubectl apply -f https://k8s.io/examples/application/zookeeper/zookeeper.yaml |
(위 zookeeper.yaml 파일은 아래서 받을 수 있음)
After a few minutes 3 pods of ZK will be available for NiFi to use. Once ZK pods become available, proceed to deploy NiFi on k8s
kubectl get pods -w -l app=zk |
NiFi
Below is the k8s deployment yml for NiFi (named nifi.yml). Few fields to highlight
- replicas
- This will be number of NiFi pods to deploy (Cluster)
- Image
- Replace with your image location
To deploy this NiFi k8s manifest:
kubectl apply -f nifi.yml |
(위 nifi.yaml 파일은 아래서 받을 수 있음)
Few minutes later you will have a fully functioning NiFi cluster on Kubernetes
I use super simple a lot. I know. Deploying MiNiFi & NiFi on k8s is just that, super simple. Enjoy.
'NiFi' 카테고리의 다른 글
[NiFi] Kubernetes 위에서 NiFi 구동 경험 링크 (0) | 2020.11.25 |
---|---|
[Nifi] Developer’s Guide 공부 필기 (0) | 2020.11.17 |
[Nifi] Getting Started with Apache NiFi 공부 필기 (0) | 2020.11.09 |
[Nifi] Overview 공부 필기 (0) | 2020.11.09 |
[Nifi] listSFTP/fetchSFTP 동작 방식 설명 (0) | 2020.11.03 |