【发布时间】:2020-02-25 01:39:12
【问题描述】:
我想在 Kubernetes 节点中运行 Eventstore。我用minikube start 启动节点,然后应用这个yaml 文件:
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
部署、副本集和 pod 启动,但没有任何反应:Eventstore 没有打印到日志,我无法打开它的仪表板。其他服务也无法连接到 eventstore:1113。没有错误,豆荚也不会崩溃。 我在日志中看到的唯一内容是“所选容器尚未记录任何消息”。
我尝试了一个带有不同 vm 驱动程序的干净 vanilla minukube 节点,以及一个配置了 Ambassador + Linkerd 的节点。结果是一样的。
但是当我通过 docker-compose
使用这个 yaml 文件在 Docker 中运行 Eventstore 时eventstore:
image: eventstore/eventstore
ports:
- '1113:1113'
- '2113:2113'
一切正常:Eventstore 输出到日志,其他服务可以连接到它,我可以在 2113 端口上打开它的仪表板。
更新: Eventstore 在部署后大约 30-40 分钟后开始工作。我试了好几次,只能等。其他 pod 在部署后几乎立即开始工作(30 秒 - 1 分钟)。
【问题讨论】:
-
您能提供更多信息吗?我试图重现您的情况,但是一切对我来说都正常。你在 minikube 上有足够的资源吗?您是否在裸机或云提供商上尝试过这个?
-
也许在yaml文件中指定资源(比默认值高)、cpu和内存?
-
@PjoterS 是的,问题在于 VM 性能。现在我使用 Kind 而不是 Minikube,一切都像魅力一样工作
标签: docker kubernetes containers kubernetes-pod eventstoredb