udpate prod mongo

main
ycz008 2024-04-19 17:16:30 +08:00
parent 678a4ec3ad
commit 9fa12c7a41
1 changed files with 20 additions and 10 deletions

View File

@ -24,14 +24,18 @@ spec:
sysctl -w net.ipv4.tcp_keepalive_time=300 sysctl -w net.ipv4.tcp_keepalive_time=300
sysctl -w net.ipv4.tcp_keepalive_intvl=10 sysctl -w net.ipv4.tcp_keepalive_intvl=10
sysctl -w net.ipv4.tcp_keepalive_probes=3 sysctl -w net.ipv4.tcp_keepalive_probes=3
# chown 999 /etc/mongodb/keyfile.key cp /etc/keyfile.0 /etc/mongodb/keyfile.0
# chmod 400 /etc/mongodb/keyfile.key chown 999 /etc/mongodb/keyfile.0
chmod 400 /etc/mongodb/keyfile.0
securityContext: securityContext:
privileged: true privileged: true
# volumeMounts: volumeMounts:
# - name: mongo-keyfile - name: mongo-conf
# mountPath: /etc/mongodb/keyfile.key mountPath: /etc/mongodb
# subPath: keyfile.key - name: mongo-keyfile
mountPath: /etc/keyfile.0
subPath: keyfile.0
readOnly: true
containers: containers:
- name: mongo - name: mongo
image: mongo:6.0 image: mongo:6.0
@ -39,25 +43,31 @@ spec:
args: args:
- "--bind_ip_all" - "--bind_ip_all"
- "--replSet=bfs-mongo-rs0" - "--replSet=bfs-mongo-rs0"
- "--keyFile=/etc/mongodb/keyfile.key" - "--keyFile=/etc/mongodb/keyfile.0"
ports: ports:
- containerPort: 27017 - containerPort: 27017
volumeMounts: volumeMounts:
- name: mongo-data - name: mongo-data
mountPath: /data/db mountPath: /data/db
- name: mongo-conf
mountPath: /etc/mongodb
- name: mongo-keyfile - name: mongo-keyfile
mountPath: /etc/mongodb/keyfile.key mountPath: /etc/keyfile.0
subPath: keyfile.key subPath: keyfile.0
readOnly: true
volumes: volumes:
- name: mongo-data - name: mongo-data
hostPath: hostPath:
path: /data/mongodb/rs0 path: /data/mongodb/rs0
- name: mongo-conf
emptyDir:
sizeLimit: 10Mi
- name: mongo-keyfile - name: mongo-keyfile
configMap: configMap:
name: mongo-keyfile name: mongo-keyfile
items: items:
- key: keyFile - key: keyFile
path: keyfile.key path: keyfile.0
affinity: affinity:
nodeAffinity: nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution: requiredDuringSchedulingIgnoredDuringExecution: