1

I want to run Eventstore in Kubernetes node. I start the node with minikube start, then I apply this yaml file:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: eventstore-deployment
spec:
  selector:
    matchLabels:
      app: eventstore
  replicas: 1
  template:
    metadata:
      labels:
        app: eventstore
    spec:
      containers:
      - name: eventstore
        image: eventstore/eventstore
        ports:
        - containerPort: 1113
          protocol: TCP
        - containerPort: 2113
          protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
  name: eventstore
spec:
  selector:
    app: eventstore
  ports:
  - protocol: TCP
    port: 1113
    targetPort: 1113
---
apiVersion: v1
kind: Service
metadata:
  name: eventstore-dashboard
spec:
  selector:
    app: eventstore
  ports:
  - protocol: TCP
    port: 2113
    targetPort: 2113
    nodePort: 30113
  type: NodePort

the deployment, the replica set and the pod starts, but nothing happens: Eventstore doesn't print to the log, I can't open its dashboard. Also other services can't connect to eventstore:1113. No errors and the pods doesn't crash. The only I see in logs is "The selected container has not logged any messages yet".

enter image description here enter image description here

I've tried a clean vanilla minukube node with different vm drivers, and also a node with configured Ambassador + Linkerd. The results are the same.

But when I run Eventstore in Docker with this yaml file via docker-compose

eventstore:
    image: eventstore/eventstore
    ports:
      - '1113:1113'
      - '2113:2113'

Everything works fine: Eventstore outputs to logs, other services can connect to it and I can open its dashboard on 2113 port.

UPDATE: Eventstore started working after about 30-40 minutes after deployment. I've tried several times, and had to wait. Other pods start working almost immediately (30 secs - 1 min) after deployment.

4

1 回答 1

2

正如@ligowsky 在评论部分确认的那样,问题是由于 VM 性能引起的。将其发布为社区 Wiki 以获得更好的可见性。

Minikube默认使用2 CPUsand运行2048 Memory。更多细节可以在这里找到。

如果您的 VM 有更多资源,您可以更改此设置。

- 在 Minikube 启动期间

$ sudo minikube start --cpus 2 --memory 8192 --vm-driver=<driverType>

- 当 Minikube 运行时,需要重启 minikube

$ minikube config set memory 4096
⚠️  These changes will take effect upon a minikube delete and then a minikube start

更多命令可以在Minikube 文档中找到。

在我的情况下,当Minikube资源是 4CPU 和 8192 内存时,我对eventstore.

OP的解决方案

OP 使用Kind来运行eventstore部署。

Kind 是一种使用 Docker 容器“节点”运行本地 Kubernetes 集群的工具。kind 主要用于测试 Kubernetes 1.11+

Kind文档可以在这里找到。

于 2019-10-31T12:25:57.047 回答