配置文件 values-nodeport.yaml
global:
storageClass: "rook-ceph-block"
architecture: replicaset
auth:
enabled: true
rootUser: root
rootPassword: "root"
replicaCount: 3
externalAccess:
enabled: true
service:
type: NodePort
nodePorts: ["30001", "30002", "30003"]
serviceAccount:
create: true
rbac:
create: true
persistence:
enabled: true
size: 2Gi
service:
annotations: {}
type: loadBalancer
port: 27017
root@node1:~# kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 26h
mongodb-cluster-0-external NodePort 10.108.100.58 <none> 27017:30001/TCP 2m20s
mongodb-cluster-1-external NodePort 10.107.31.139 <none> 27017:30002/TCP 2m20s
mongodb-cluster-2-external NodePort 10.96.114.91 <none> 27017:30003/TCP 2m20s
mongodb-cluster-arbiter-headless ClusterIP None <none> 27017/TCP 2m20s
mongodb-cluster-headless ClusterIP None <none> 27017/TCP 2m20s