【发布时间】:2019-09-24 22:41:33
【问题描述】:
是请求帮助吗?
是的
我想做什么?
我正在尝试在启用副本集的主图表中使用 stable/mongodb 作为 子图表
执行的步骤
- 在图表文件夹中添加了 mongodb 作为子图表
- 在 requirements.yaml 中提及此图表的依赖关系
dependencies:
- name: mongodb
version: "5.17.0"
repository: "file://charts/mongodb"
- 覆盖主图表中的子图表值
mongodb:
usePassword: true
existingSecret: skeleton
mongodbUsername: skeleton
mongodbDatabase: skeleton
replicaSet:
## Whether to create a MongoDB replica set for high availability or not
enabled: true
useHostnames: true
name: rs0
replicas:
secondary: 1
arbiter: 1
- 为此定义秘密 为骷髅秘密
apiVersion: v1
kind: Secret
metadata:
name: skeleton
type: Opaque
data:
# mongo ha---
mongodb-root-password: <64-bit-encoded-root-password>
mongodb-replica-set-key: <64-bit-encoded-Key>
mongodb-password: <64-bit-encoded-password>
-在deployment.yaml中提供了headless service url mongodb url来连接这个
来自同一个 k8s 集群中托管的应用程序
mongodb://<mongodbUsername-value-define-in-value.yaml>:<mongodb-password-value-present-in-secret>@skeleton-mongodb-headless:27017/skeleton?authSource=admin&replicaSet=rs0
- 我遇到了错误 使用无头服务时
[1;30m2019-05-07 05:06:16,085[0;39m => [34mINFO [0;39m [[32mmain[0;39m] [33mcom.mongodb.diagnostics.logging.SLF4JLogger[0;39m: Cluster created with settings {hosts=[skeleton-mongodb-headless:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500, requiredReplicaSetName='rs0'}
[1;30m2019-05-07 05:06:16,085[0;39m => [34mINFO [0;39m [[32mmain[0;39m] [33mcom.mongodb.diagnostics.logging.SLF4JLogger[0;39m: Adding discovered server skeleton-mongodb-headless:27017 to client view of cluster
[1;30m2019-05-07 05:06:16,175[0;39m => [34mINFO [0;39m [[32mmain[0;39m] [33mcom.mongodb.diagnostics.logging.SLF4JLogger[0;39m: No server chosen by com.mongodb.Mongo$4@359ff4d9 from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=skeleton-mongodb-headless:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
[1;30m2019-05-07 05:06:16,182[0;39m => [34mINFO [0;39m [[32mcluster-ClusterId{value='5cd11248b2cfc400017b5805', description='null'}-skeleton-mongodb-headless:27017[0;39m] [33mcom.mongodb.diagnostics.logging.SLF4JLogger[0;39m: Exception in monitor thread while connecting to server skeleton-mongodb-headless:27017
com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='skeleton', source='admin', password=<hidden>, mechanismProperties={}}
at com.mongodb.connection.SaslAuthenticator.wrapException(SaslAuthenticator.java:162)
at com.mongodb.connection.SaslAuthenticator.access$200(SaslAuthenticator.java:39)
at com.mongodb.connection.SaslAuthenticator$1.run(SaslAuthenticator.java:68)
at com.mongodb.connection.SaslAuthenticator$1.run(SaslAuthenticator.java:46)
at com.mongodb.connection.SaslAuthenticator.doAsSubject(SaslAuthenticator.java:168)
at com.mongodb.connection.SaslAuthenticator.authenticate(SaslAuthenticator.java:46)
查询
- 我是否缺少连接的东西
- 我们是否需要在连接 url 中提供密钥以进行内部通信?
【问题讨论】:
-
不,它不是重复的。这是两个不同的舵图。我正在检查两个图表的可行性
-
对了,那个是replicataset
标签: mongodb kubernetes kubernetes-helm azure-aks