udpate prod mongo

main
ycz008 2024-04-19 16:35:41 +08:00
parent 8dd5d85c68
commit f821e8dbc1
1 changed files with 20 additions and 13 deletions

View File

@ -24,34 +24,41 @@ spec:
sysctl -w net.ipv4.tcp_keepalive_time=300
sysctl -w net.ipv4.tcp_keepalive_intvl=10
sysctl -w net.ipv4.tcp_keepalive_probes=3
chmod 400 /etc/mongodb/keyfile.key
securityContext:
privileged: true
volumeMounts:
- name: mongo-keyfile
mountPath: /etc/mongodb/keyfile.key
subPath: keyfile.key
readOnly: true
containers:
- name: mongo
image: mongo:6.0
args:
- "--replSet=bfs-mongo-rs0"
imagePullPolicy: IfNotPresent
env:
- name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
secretKeyRef:
name: mongo
key: initdb_root_username
- name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mongo
key: initdb_root_password
args:
- "--bind_ip_all"
- "--replSet=bfs-mongo-rs0"
- "--keyFile=/etc/mongodb/keyfile.key"
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-data
mountPath: /data/db
- name: mongo-keyfile
mountPath: /etc/mongodb/keyfile.key
subPath: keyfile.key
readOnly: true
volumes:
- name: mongo-data
hostPath:
path: /data/mongodb/rs0
- name: mongo-keyfile
configMap:
name: mongo-keyfile
items:
- key: keyFile
path: keyfile.key
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution: