전체 글(975)
-
Broker 외부에 노출하기
Service: node별로 생성apiVersion: v1kind: Servicemetadata: name: kafka-0-svc namespace: kafkaspec: type: LoadBalancer ports: - port: 9092 # Kafka default port targetPort: 9092 selector: statefulset.kubernetes.io/pod-name: kafka-0ConfigMapapiVersion: v1kind: ConfigMapmetadata: name: kafka-external-config namespace: kafkadata: kafka-0: "PLAINTEXT://{LoadBalancer1 IP}:9092" kafka-1:..
2025.03.10 -
port 확인
nc -zv 192.168.1.242 9092
2025.03.09 -
imagePullPolicy: Always or IfNotPresent
IfNotPresent: 이미지가 local에 있으면, tag가 변경되지 않으면, 이미지를 pull하지 않음Always: tag에 상관없이 무조건 이미지를 pull함 containers: - name: kafka-producer image: test/kafka:0.0002 imagePullPolicy: Always #IfNotPresent
2025.03.09 -
@PostConstruct 사용
서비스 기동할때 출력하고 싶은 값이 있을 때 사용클래스가 호출되면, printMode가 작동 @PostConstruct public void printMode() { log.info("🔥 Application is running in app.mode: {} 🔥", mode.toUpperCase()); log.info("🔥 Application is running in spring.kafka.bootstrap-servers: {} 🔥", bootstrapServers); }
2025.03.09 -
@Slf4j 로그 설정하기
pom.xml org.projectlombok lombok provided application.ymllogging: level: com.yourpackage: DEBUG사용@Slf4jpublic class abc { String a = "abc"; @PostConstruct public void printMode() { log.info("test: {}", a); } }
2025.03.09 -
kafka-ui에 schema registry 연결하기
DeploymentKAFKA_CLUSTERS_0_SCHEMAREGISTRY 추가apiVersion: apps/v1kind: Deploymentmetadata: name: kafka-ui namespace: kafkaspec: replicas: 1 selector: matchLabels: app: kafka-ui template: metadata: labels: app: kafka-ui spec: containers: - name: kafka-ui image: provectuslabs/kafka-ui:{tage} ports: - containerPort: 8080 ..
2025.03.09