#mongodb-sharded 7.X版本
CHART NAME: mongodb-sharded
CHART VERSION: 7.0.5
APP VERSION: 7.0.2
helm repo add bitnami https://charts.bitnami.com/bitnami
helm pull bitnami/bitnami/mongodb-sharded --untar
默认副本数较多。我修改为3+3
搜索关键字replicaCount 修改
文章来源:https://www.toymoban.com/news/detail-779900.html
最后安装
helm install mongodb-sharded mongodb-sharded -f ./mongodb-sharded/values.yaml
再分享一个web客户端
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-express
spec:
replicas: 1
selector:
matchLabels:
app: mongo-express
template:
metadata:
labels:
app: mongo-express
spec:
containers:
- name: mongo-express
image: mongo-express:latest
ports:
- containerPort: 8081
env:
- name: ME_CONFIG_MONGODB_URL
value: mongodb://root:123000@mongodb-sharded.openim-dev.svc:27017/admin?ssl=false
- name: ME_CONFIG_MONGODB_AUTH_USERNAME
value: "admin"
- name: ME_CONFIG_MONGODB_AUTH_PASSWORD
value: "123qwe"
---
apiVersion: v1
kind: Service
metadata:
name: mongo-express
spec:
type: NodePort
selector:
app: mongo-express
ports:
- port: 80
targetPort: 8081
文章来源地址https://www.toymoban.com/news/detail-779900.html
到了这里,关于k8s部署mongodb-sharded7.X集群(多副本集)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!