๋ฐ์ดํ„ฐ ์—”์ง€๋‹ˆ์–ด๋ง

๋ฐ์ดํ„ฐ ๋ถ„์„ ํ™˜๊ฒฝ ๊ตฌ์ถ• - 04. Kafka UI ํ™˜๊ฒฝ ๊ตฌ์„ฑ(Redpanda Console)

Tempo 2025. 3. 27. 08:00

์ด์ „ Apache Kafka ์„ค์น˜ ํ›„ ํ† ํ”ฝ ์ƒ์„ฑ, ๋ชฉ๋ก ํ™•์ธ์— ์˜ค๋ฅ˜๊ฐ€ ์žˆ์–ด kafka ๊ตฌ์„ฑ์ด ์–ด๋ ค์› ์Šต๋‹ˆ๋‹ค. ์ด์— UI ํ™˜๊ฒฝ์„ ๊ตฌ์„ฑํ•˜์—ฌ kafka ํ† ํ”ฝ์„ ์‰ฝ๊ฒŒ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋„๋ก Console ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ’ก ์ด ๊ธ€์—์„œ ๋‹ค๋ฃฐ ๋‚ด์šฉ:

  • Redpanda Console์ด๋ž€?
  • Helm์„ ์‚ฌ์šฉํ•ด Redpanda Console ๋ฐฐํฌ
  • Kafka์™€ ์—ฐ๊ฒฐ ๋ฐ UI์—์„œ ํ† ํ”ฝ ์ƒ์„ฑ
  • ๋ฉ”์‹œ์ง€ Produce ํ…Œ์ŠคํŠธ

1. Redpanda Console์ด๋ž€?

Redpanda Console์€ Kafka ํด๋Ÿฌ์Šคํ„ฐ๋ฅผ ์‰ฝ๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ์›น UI์ž…๋‹ˆ๋‹ค.
Kafka์˜ ๊ธฐ๋ณธ CLI๋ณด๋‹ค ํŽธ๋ฆฌํ•˜๊ฒŒ ํ† ํ”ฝ ์ƒ์„ฑ, ๋ฉ”์‹œ์ง€ ์กฐํšŒ, ์†Œ๋น„์ž ๊ทธ๋ฃน ๋ชจ๋‹ˆํ„ฐ๋ง ๋“ฑ์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

โ— Redpanda Console์€ Kafka์™€ ์™„์ „ํžˆ ํ˜ธํ™˜๋˜๋ฏ€๋กœ Kafka ํด๋Ÿฌ์Šคํ„ฐ์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

2. Redpanda Console์„ Kubernetes์— ๋ฐฐํฌ

๐Ÿ”น 1) Helm ์ €์žฅ์†Œ ์ถ”๊ฐ€ ๋ฐ ์—…๋ฐ์ดํŠธ

helm repo add redpanda-data https://charts.redpanda.com
helm repo update

๐Ÿ”น 2) Redpanda Console ๋ฐฐํฌ ํŒŒ์ผ ์ž‘์„ฑ (value.yaml)

 

console 0.3.3 · redpanda/redpanda-data

Helm chart to deploy Redpanda Console.

artifacthub.io

 

ํ•ด๋‹น ๋งํฌ์—์„œ values.yaml ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์Šต๋‹ˆ๋‹ค. ๊ธฐ์กด ํ”„๋กœ์ ํŠธ ํด๋”์—์„œ redpanda/ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ํ•˜์œ„์— values.yaml ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. values.yaml์—์„œ ์•„๋ž˜ ์‚ฌํ•ญ๋“ค์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.

# line9 - repository
repository: redpandadata/console

# line:63 - resources:
resources:
  limits:
    cpu: 100m
    memory: 128Mi
  requests:
    cpu: 100m
    memory: 128Mi

# line: 88 - console: broker ์ •๋ณด์™€ ์ ‘์† ์ •๋ณด๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. kafka ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ๋ฐฐํฌํ–ˆ๊ธฐ์— kafka.kafka๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  config:
    kafka:
      brokers:
        - "kafka.kafka.svc.cluster.local:9092"
      clientId: redpanda-console
      sasl:
        enabled: true
        mechanism: SCRAM-SHA-512
        username: user1
        password: <์‚ฌ์šฉ์ž password ์ž…๋ ฅ>

# ๊ธฐํƒ€ ๋ณ€๊ฒฝ์‚ฌํ•ญ
- extraVolumeMounts: []
- extraEnvFrom: []
- extraVolumes: []
- extraEnv: []
- extraContainers: []

 

๋ฐ˜์‘ํ˜•

๐Ÿ”น 3) Redpanda Console ๋ฐฐํฌ

์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด k8s์— redpanda console์„ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค.

helm install console redpanda/console -f ./redpanda/values.yaml -n kafka

๐Ÿ”น 4) ๋ฐฐํฌ๋œ ์„œ๋น„์Šค ํ™•์ธ

kubectl get svc -n kafka

์ถœ๋ ฅ ์˜ˆ์‹œ:

NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      
console                     ClusterIP   10.100.12.81     <none>        8080/TCP                     
kafka                       ClusterIP   10.108.250.227   <none>        9092/TCP                     
kafka-broker-headless       ClusterIP   None             <none>        9094/TCP,9092/TCP            
kafka-controller-headless   ClusterIP   None             <none>        9094/TCP,9092/TCP,9093/TCP

๐Ÿ”น 5) Redpanda Console UI ์ ‘์†

kubectl port-forward svc/console 8080:8080

๋ธŒ๋ผ์šฐ์ €์—์„œ http://localhost:8080 ์œผ๋กœ ์ ‘์†ํ•˜๋ฉด Kafka ํ† ํ”ฝ์„ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” UI๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

3. Redpanda Console์—์„œ Kafka ํ† ํ”ฝ ์ƒ์„ฑ ๋ฐ ๋ฉ”์‹œ์ง€ ํ…Œ์ŠคํŠธ

๐Ÿ”น 1) Redpanda Console์—์„œ ํ† ํ”ฝ ์ƒ์„ฑ

Redpanda console ๋ฉ”์ธ ํ™”๋ฉด

  1. Redpanda Console (http://localhost:8080) ์ ‘์†
  2. "Topics" ๋ฉ”๋‰ด ํด๋ฆญ
  3. "Create topic" ๋ฒ„ํŠผ ํด๋ฆญ
  4. ํ† ํ”ฝ ์ด๋ฆ„ ์ž…๋ ฅ (์˜ˆ: test-topic)
  5. Partition ๊ฐœ์ˆ˜ ๋ฐ ์„ค์ • ์„ ํƒ ํ›„ "Create" ํด๋ฆญ

๐Ÿ‘‰ Kafka ํด๋Ÿฌ์Šคํ„ฐ์— ์ƒˆ๋กœ์šด ํ† ํ”ฝ์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

๐Ÿ”น 2) ๋ฉ”์‹œ์ง€ ์ „์†ก (Producer ์‹คํ–‰)

Redpanda Console์—์„œ test-topic์„ ํด๋ฆญํ•œ ํ›„,

  • "Produce message" ๋ฒ„ํŠผ ํด๋ฆญ
  • Key & Value๋ฅผ ์ž…๋ ฅ ํ›„ "Send" ํด๋ฆญ

โœ… Kafka CLI ์—†์ด๋„ UI์—์„œ ๋ฉ”์‹œ์ง€๋ฅผ ์ง์ ‘ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค! ๐ŸŽ‰

๋ฐ˜์‘ํ˜•