Confluent Kafka 설치하기 with Kubernetes

2023. 10. 24. 22:29·Kafka

Confluent Kafka를 docker-compose를 이용해 설치하는 방법을 소개했었지만 다른 리소스들과 함께 관리 및 사용하고자 Kubernetes에 올리는 방법도 소개하고자 한다.

arm 칩을 사용하는 mac 기준으로 작성되었다.

대상 독자

  • 쿠버네티스에 Confluent를 구축하고자 하는 개발자

Steps

  1. 로컬 환경에 Kubernetes 구축
  2. Confluent Kafka 설치

1. 로컬 환경에 Kubernetes 구축

여러 가지 방법이 있을 수 있다. docker-desktop을 이용해 손쉽게 Enable Kubernetes 버튼을 통해서도 구축할 수 있고 k3s와 같은 경량화된 쿠버네티스를 구축해도 된다. 다만 여기선 minikube를 통해 쿠버네티스(이하 k8s)를 구축하려 한다.

minikube를 설치하자.

brew install minikube

나는 v1.31.2 버전이 설치되었다.

K8s 구축

minikube start --driver=docker

이제 구축이 완료되었다.

kubectl을 통해 Pod를 조회해 보자. (kubectl 설치는 brew install kubectl 로 쉽게 할 수 있다)

kubectl get pods -A

 

2. Confluent Kafka 설치

공식 문서를 따라 설치하면 나의 경우 Out-Of-Memory(OOM)이 발생하여 설치가 어려워 singlenode로 배포하기 위한 방법을 정리했다.

Confluent Operator 설치

kubectl create namespace confluent
kubectl config set-context --current --namespace confluent

helm repo add confluentinc https://packages.confluent.io/helm
helm repo update

helm upgrade --install \
  confluent-operator confluentinc/confluent-for-kubernetes \
  --set kRaftEnabled=true

설치 확인

kubectl get pods

Confluent Platform 설치

kubectl apply -f https://gist.githubusercontent.com/Ssuwani/b5becd37c155fa8e2e6381212ff13905/raw/fe8a844b6530d858d06f1ec0406aa7901c52bb00/confluent-platform-singlenode.yaml

이를 통해 아래와 같은 리소스들이 설치된다. (서로 간의 의존성이 있어 조금 시간이 걸린다)

  • zookeeper
  • kafka
  • connect
  • ksqldb
  • controlcenter
  • schemaregistry
  • kafkarestproxy

control-center 접근

kubectl port-forward controlcenter-0 9021:9021

이후 localhost:9021에 접근하면 된다.

'Kafka' 카테고리의 다른 글
  • 같은 키를 갖는 메시지는 "항상" 같은 파티션에 들어갈까?
  • 카프카 메시지를 Consume한 뒤 처리하기 위한 방법들
  • 4. Schema Registry와 함께 안전하게 카프카 메시지 Consume 하기
  • 3. Schema Registry와 함께 안전하게 카프카 메시지 Produce 하기
ssuwani
ssuwani
  • ssuwani
    Oops!!
    ssuwani
  • 전체
    오늘
    어제
    • 분류 전체보기 (69)
      • MLOps (19)
      • 데이터 엔지니어링 (4)
      • Kubernetes (5)
      • Kafka (10)
      • 📚책 (3)
      • 라즈베리파이 (1)
      • ETC (8)
      • Python (6)
      • 언어모델 (5)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    Spark
    Kubeflow
    BentoML
    MLOps
    producer
    Confluent Cloud
    asyncronous
    Github Actions
    datadrift
    fluentbit
    FastAPI
    topic
    LangChain
    auto tagging
    Kubernetes
    evidently ai
    mlflow
    redis
    태그2
    Schema Registry
    Docker
    consumer
    gcp
    LLM
    Prometheus
    Airflow
    태그1
    Python
    Kafka
    RDD
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.1
ssuwani
Confluent Kafka 설치하기 with Kubernetes
상단으로

티스토리툴바