[英]Deploying MongoDB in kubernetes does not create pods/services
I'm following this https://github.com/mongodb/mongodb-enterprise-kubernetes and https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator/ to deploy mongodb inside a Kubernetes cluster on DigitalOcean. 我正在关注这个https://github.com/mongodb/mongodb-enterprise-kubernetes和https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator/在Kubernetes集群中部署mongodb在DigitalOcean上。
So far everything worked except the last step. 到目前为止,除最后一步外,其他所有操作均有效。 Deploying mongodb. 部署mongodb。 I'm trying to do like suggested in the documentation: 我正在尝试按照文档中的建议进行操作:
---
apiVersion: mongodb.com/v1
kind: MongoDbReplicaSet
metadata:
name: mongodb-rs
namespace: mongodb
spec:
members: 3
version: 4.0.4
persistent: true
project: project-0
credentials: mongodb-do-ops
It doesn't work. 没用 The resource of type MongoDbReplicaSet is created, but no pods and services are deployed like written in docs. 创建了MongoDbReplicaSet类型的资源,但是没有像在文档中那样部署任何pod和服务。
kubectl --kubeconfig="iniside-k8s-test-kubeconfig.yaml" describe MongoDbReplicaSet mongodb-rs -n mongodb kubectl --kubeconfig =“ iniside-k8s-test-kubeconfig.yaml”描述MongoDbReplicaSet mongodb-rs -n mongodb
Name: mongodb-rs
Namespace: mongodb
Labels: <none>
Annotations: <none>
API Version: mongodb.com/v1
Kind: MongoDbReplicaSet
Metadata:
Creation Timestamp: 2018-11-21T21:35:30Z
Generation: 1
Resource Version: 2948350
Self Link: /apis/mongodb.com/v1/namespaces/mongodb/mongodbreplicasets/mongodb-rs
UID: 5e83c7b0-edd5-11e8-88f5-be6ffc4e4dde
Spec:
Credentials: mongodb-do-ops
Members: 3
Persistent: true
Project: project-0
Version: 4.0.4
Events: <none>
I got it working. 我知道了 As It stands in documentation here: https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator/ 如此处文档所示: https : //docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator/
data.projectName data.projectName
Is not optional. 不是可选的。 After looking at operator logs, operator cloudn't create replica set deployment because projectName was missing in ConfigMap. 查看操作员日志后,操作员无法创建副本集部署,因为ConfigMap中缺少projectName。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.