I'm deploying rocketmq on a managed GKE Kubernetes cluster. The name server starts correctly, but the broker runs in error and I cannot recognize which kind of problem occurs. It follows the yaml configuration:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: rocketmq-broker-log-storage
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-standard
fstype: ext4
replication-type: none
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: rocketmq-broker-store-storage
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-standard
fstype: ext4
replication-type: none
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: rocketmq-namesrv-storage
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-standard
fstype: ext4
replication-type: none
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rocketmq-broker-log-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
storageClassName: rocketmq-broker-log-storage
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rocketmq-broker-store-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
storageClassName: rocketmq-broker-store-storage
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rocketmq-namesrv-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
storageClassName: rocketmq-namesrv-storage
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: rocketmq-namesrv
spec:
replicas: 1
selector:
matchLabels:
app: rocketmq-namesrv
template:
metadata:
labels:
app: rocketmq-namesrv
spec:
containers:
- name: namesrv
image: myrepo/rocketmq:4.9.3-alpine
command: ["sh", "mqnamesrv"]
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9876
volumeMounts:
- name: namesrv-log
mountPath: /var/log
volumes:
- name: namesrv-log
persistentVolumeClaim:
claimName: rocketmq-namesrv-pvc
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: rocketmq-broker
spec:
replicas: 1
selector:
matchLabels:
app: rocketmq-broker
template:
metadata:
labels:
app: rocketmq-broker
spec:
containers:
- name: broker
image: myrepo/rocketmq:4.9.3-alpine
command: ["sh", "mqbroker", "-n", "rocketmq-namesrv:9876"]
imagePullPolicy: IfNotPresent
ports:
- containerPort: 10909
- containerPort: 10911
volumeMounts:
- name: broker-log
mountPath: /home/rocketmq/logs
- name: broker-store
mountPath: /home/rocketmq/store
volumes:
- name: broker-log
persistentVolumeClaim:
claimName: rocketmq-broker-log-pvc
- name: broker-store
persistentVolumeClaim:
claimName: rocketmq-broker-store-pvc
---
apiVersion: v1
kind: Service
metadata:
name: rocketmq-namesrv
spec:
type: NodePort
selector:
app: rocketmq-namesrv
ports:
- name: namesrv
port: 9876
---
apiVersion: v1
kind: Service
metadata:
name: rocketmq-broker
spec:
type: NodePort
selector:
app: rocketmq-broker
ports:
- name: broker1
port: 10909
- name: broker2
port: 10911
The image rocketmq:4.9.3-alpine
was created following the procedure on the apache/rocketmq-docker
repo.
I tried kubectl logs
and kubectl describe
, but I cannot figure out what could be the problem because they give me no information.
What could be the problem?