代码拉取完成,页面将自动刷新
同步操作将从 zhangyu/devops-k8s 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
apiVersion: v1
kind: PersistentVolume
metadata:
name: devops-mongodb-pv
spec:
capacity:
storage: 50Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain #回收策略
nfs:
path: /mongo-devops-dispute/
server: xxxxxx.cn-beijing.nas.aliyuncs.com # ----replace------
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
namespace: devops
name: devops-mongodb-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 50Gi
---
apiVersion: v1
kind: Service
metadata:
name: mongodb
namespace: devops
labels:
app: mongodb
spec:
selector:
app: mongodb
ports:
- name: mongodb
protocol: TCP
port: 27017
targetPort: 27017
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mongodb
namespace: devops
labels:
app: mongodb
spec:
selector:
matchLabels:
app: mongodb
serviceName: mongodb
replicas: 1
template:
metadata:
labels:
app: mongodb
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 60
preference:
matchExpressions:
- {key: devops-node, operator: In, values: ["beijing-node"]}
containers:
- name: mongodb
image: mongo:latest
imagePullPolicy: IfNotPresent
command:
- mongod
- "--bind_ip"
- 0.0.0.0
- "--quiet"
ports:
- name: mongodb
containerPort: 27017
env:
- name: TZ
value: Asia/Shanghai
resources:
requests:
memory: 150M
limits:
memory: 1Gi
readinessProbe:
tcpSocket:
port: 27017
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
livenessProbe:
tcpSocket:
port: 27017
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
volumeMounts:
- name: devops-mongodb-disk
mountPath: "/data/db"
#subPath: mongo-devops-dispute
volumes:
- name: devops-mongodb-disk
persistentVolumeClaim:
claimName: devops-mongodb-pvc
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。