Repository for dip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

9.9 KiB

Kafbat UI (구 Kafka-UI) 배포

1. 배포 방법

1) 배포시 주의 사항

  • Kafbat UI는 Apache Kafka 클러스터에 연결하여 모니터링 및 관리 기능을 제공하는 웹 UI입니다.
  • Kafka 클러스터의 bootstrap 서버 정보와 인증 설정이 필요합니다.
  • SASL 인증을 사용하는 경우 올바른 사용자 자격 증명을 설정해야 합니다.
  • Ingress를 통해 외부 접근을 허용할 경우 보안 설정을 반드시 확인해야 합니다.

2) 배포 방법

git clone https://github.com/paasup/service-catalog.git
cd charts/kafka-ui
helm upgrade kafka-ui ./ -f custom-values.yaml --install -n kafka-ui --create-namespace

2. custom-values.yaml 예시

다음은 배포 시 사용할 수 있는 custom-values.yaml 파일의 예시입니다:

# 이미지 설정
image:
  registry: ghcr.io
  repository: kafbat/kafka-ui
  pullPolicy: IfNotPresent

# Kafbat UI 애플리케이션 설정
yamlApplicationConfig:
  kafka:
    clusters:
    - name: kafka-cluster
      bootstrapServers: SASL_PLAINTEXT://kafka.kafka.svc.cluster.local:9092
      properties:
        security.protocol: SASL_PLAINTEXT
        sasl.mechanism: SCRAM-SHA-512        
        sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="user1" password="itkJJu5hLe";
  
  # 인증 설정 (비활성화)
  auth:
    type: disable
  
  # OAuth 2.0 설정 (선택사항)
  # spring:
  #   security:
  #     oauth2:
  
  # 헬스체크 설정
  management:
    health:
      ldap:
        enabled: false

# Ingress 설정
ingress:
  enabled: true
  annotations:
    cert-manager.io/issuer: "root-ca-issuer"
    kubernetes.io/ingress.class: kong
    konghq.com/protocols: https
    konghq.com/https-redirect-status-code: "301"
  host: "kafka-ui.example.org"
  tls:
    enabled: true
    secretName: "kafka-ui-tls"

3. custom-values.yaml 설정 설명

1) 이미지 설정

Name 설명 기본값
image.registry Kafbat UI 이미지 레지스트리 ghcr.io
image.repository Kafbat UI 이미지 리포지토리 kafbat/kafka-ui
image.pullPolicy 이미지 풀 정책 IfNotPresent
image.tag 이미지 태그 (빈 문자열이면 Chart.yaml의 appVersion 사용) ""

2) 애플리케이션 설정

Name 설명 기본값
yamlApplicationConfig Kafbat UI 설정을 YAML 형식으로 정의 {}
existingConfigMap 기존 ConfigMap 이름 (환경 변수 포함) ""
existingSecret 기존 Secret 이름 (환경 변수 포함) ""

Kafka 클러스터 설정

yamlApplicationConfig:
  kafka:
    clusters:
    - name: "클러스터 이름"
      bootstrapServers: "Kafka 부트스트랩 서버"
      properties:
        security.protocol: "보안 프로토콜"
        sasl.mechanism: "SASL 메커니즘"
        sasl.jaas.config: "JAAS 설정"

인증 설정

yamlApplicationConfig:
  auth:
    type: disable  # disable, oauth2, ldap

3) 서비스 설정

Name 설명 기본값
service.type Kubernetes 서비스 타입 ClusterIP
service.port 서비스 포트 80

4) Ingress 설정

Name 설명 기본값
ingress.enabled Ingress 활성화 여부 false
ingress.annotations Ingress 어노테이션 {}
ingress.host Ingress 호스트명 ""
ingress.path Ingress 경로 "/"
ingress.pathType Ingress 경로 타입 "Prefix"
ingress.tls.enabled TLS 활성화 여부 false
ingress.tls.secretName TLS 시크릿 이름 ""

5) 리소스 및 스케일링 설정

Name 설명 기본값
replicaCount 복제본 수 1
resources CPU/메모리 리소스 설정 {}
autoscaling.enabled 자동 스케일링 활성화 false
autoscaling.minReplicas 최소 복제본 수 1
autoscaling.maxReplicas 최대 복제본 수 100

6) 보안 설정

Name 설명 기본값
podSecurityContext Pod 보안 컨텍스트 {}
securityContext 컨테이너 보안 컨텍스트 {}
serviceAccount.create ServiceAccount 생성 여부 true
serviceAccount.name ServiceAccount 이름 ""

4. Kafka 클러스터 연결 설정

1) SASL_PLAINTEXT 연결 (기본)

yamlApplicationConfig:
  kafka:
    clusters:
    - name: kafka-cluster
      bootstrapServers: SASL_PLAINTEXT://kafka:9092
      properties:
        security.protocol: SASL_PLAINTEXT
        sasl.mechanism: PLAIN
        sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="user1" password="password";

2) SASL_SSL 연결

yamlApplicationConfig:
  kafka:
    clusters:
    - name: kafka-cluster
      bootstrapServers: SASL_SSL://kafka:9093
      properties:
        security.protocol: SASL_SSL
        sasl.mechanism: SCRAM-SHA-512
        sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="user1" password="password";
        ssl.truststore.location: /path/to/truststore.jks
        ssl.truststore.password: truststore-password

3) PLAINTEXT 연결 (비보안)

yamlApplicationConfig:
  kafka:
    clusters:
    - name: kafka-cluster
      bootstrapServers: PLAINTEXT://kafka:9092
      properties:
        security.protocol: PLAINTEXT

5. 인증 설정

1) 인증 비활성화 (기본)

yamlApplicationConfig:
  auth:
    type: disable

2) OAuth 2.0 인증 (GitHub)

yamlApplicationConfig:
  auth:
    type: oauth2
  spring:
    security:
      oauth2:
        client:
          registration:
            github:
              client-id: your-github-client-id
              client-secret: your-github-client-secret
          provider:
            github:
              user-name-attribute: login

6. 주요 기능

1) 다중 클러스터 관리

  • 여러 Kafka 클러스터를 하나의 UI에서 관리
  • 클러스터별 독립적인 인증 설정 지원

2) 토픽 관리

  • 토픽 생성, 수정, 삭제
  • 파티션 및 복제 설정 관리
  • 메시지 브라우징 및 생성

3) 컨슈머 그룹 모니터링

  • 컨슈머 그룹 상태 및 지연(lag) 모니터링
  • 파티션별 오프셋 정보 확인

4) Schema Registry 지원

  • Avro, JSON Schema, Protobuf 스키마 관리
  • 스키마 버전 관리 및 호환성 확인

5) Kafka Connect 지원

  • 커넥터 상태 모니터링
  • 커넥터 설정 관리

7. 트러블슈팅

1) 일반적인 문제

  • Kafka 연결 실패: bootstrap 서버 주소 및 인증 정보 확인
  • UI 접근 불가: Ingress 설정 및 네트워크 정책 확인
  • 권한 오류: Kafka 사용자 권한 및 ACL 설정 확인

2) 로그 확인

# Kafbat UI 로그 확인
kubectl logs -n kafka-ui deployment/kafka-ui

# Pod 상태 확인
kubectl get pods -n kafka-ui

3) 설정 확인

# ConfigMap 확인
kubectl get configmap -n kafka-ui

# Secret 확인 (인증 정보)
kubectl get secret -n kafka-ui

8. 보안 고려사항

1) 네트워크 보안

  • Ingress를 통한 외부 접근 시 HTTPS 사용 권장
  • 네트워크 정책을 통한 접근 제한

2) 인증 및 권한

  • 프로덕션 환경에서는 OAuth 2.0 또는 LDAP 인증 사용 권장
  • Kafka ACL을 통한 세밀한 권한 제어

3) 데이터 보호

  • 민감한 데이터가 포함된 토픽의 경우 데이터 마스킹 기능 활용
  • 로그 레벨 조정을 통한 민감 정보 노출 방지