Replaced rabbitMQ with Kafka, fixed regcred

This commit is contained in:
PB
2025-11-08 18:20:44 +01:00
parent 4e812b3b22
commit 3907be917d
8 changed files with 131 additions and 74 deletions

View File

@@ -1,4 +1,31 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: api-eventbus-pv
namespace: egommerce
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
storageClassName: api-eventbus-pv
hostPath:
path: "/home/keedosn/.egommerce/kafka" # Ensure this path exists on the node
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: api-eventbus-pvc
namespace: egommerce
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: api-eventbus-pv
---
apiVersion: v1
kind: Service
metadata:
name: api-eventbus
@@ -10,25 +37,22 @@ spec:
selector:
app: api-eventbus
ports:
- name: api-eventbus
- name: api-eventbus-main
protocol: TCP
port: 5672
port: 9092
nodePort: 31200
- name: api-eventbus-mngmnt
- name: api-eventbus-controller
protocol: TCP
port: 15672
port: 9093
nodePort: 31299
# - name: api-eventbus-metrics
# protocol: TCP
# port: 15692
# nodePort: 31201
---
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: api-eventbus
namespace: egommerce
spec:
serviceName: "api-eventbus"
replicas: 1
selector:
matchLabels:
@@ -39,32 +63,35 @@ spec:
app: api-eventbus
spec:
containers:
- name: api-eventbus
image: git.ego.freeddns.org/egommerce/api-eventbus:dev
imagePullPolicy: Always
command: [
"rabbitmq-server"
]
env:
- name: APP_NAME
value: api-eventbus
- name: RABBITMQ_ERLANG_COOKIE
value: rabbitmq
volumeMounts:
- name: eventbus-data
mountPath: /var/lib/rabbitmq
- name: eventbus-logs
mountPath: /var/log/rabbitmq
resources:
limits:
cpu: "1"
memory: 1G
ports:
- containerPort: 5672
- containerPort: 15672
- containerPort: 15692
- name: api-eventbus
image: apache/kafka:latest
imagePullPolicy: Always # For future image
ports:
- containerPort: 9092
name: eventbus
- containerPort: 9093
name: eventbus-ctrl
volumeMounts:
- name: api-eventbus-storage
mountPath: /var/lib/kafka/data
env:
- name: KAFKA_PROCESS_ROLES
value: "broker,controller"
- name: KAFKA_CONTROLLER_LISTENER_NAMES
value: "CONTROLLER"
- name: KAFKA_LISTENERS
value: "PLAINTEXT://:9092,CONTROLLER://:9093"
- name: KAFKA_CONTROLLER_QUORUM_VOTERS
value: "1@localhost:9093"
- name: KAFKA_NODE_ID
value: "1"
- name: KAFKA_ADVERTISED_LISTENERS
value: "PLAINTEXT://localhost:9092"
- name: KAFKA_LOG_DIRS
value: "/var/lib/kafka/data"
imagePullSecrets:
- name: regcred
volumes:
- name: eventbus-data
emptyDir:
- name: eventbus-logs
emptyDir:
- name: api-eventbus-storage
persistentVolumeClaim:
claimName: api-eventbus-pvc