1 Star 0 Fork 23

skymysky/devops-k8s

forked from zhangyu/devops-k8s 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
doclever-dp-svc.yaml 2.33 KB
一键复制 编辑 原始数据 按行查看 历史
Edgar 提交于 2021-06-07 15:34 . 1
apiVersion: v1
kind: PersistentVolume
metadata:
name: devops-doclever-pv
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain #回收策略
nfs:
path: /doclever-devops-dispute/
server: xxxxx.cn-beijing.nas.aliyuncs.com # ----replace------
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
namespace: devops
name: devops-doclever-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
---
apiVersion: v1
kind: Service
metadata:
name: doclever
namespace: devops
labels:
app: doclever
spec:
selector:
app: doclever
ports:
- name: doclever
protocol: TCP
port: 10000
targetPort: 10000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: doclever
namespace: devops
labels:
app: doclever
spec:
selector:
matchLabels:
app: doclever
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
replicas: 1
template:
metadata:
labels:
app: doclever
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 60
preference:
matchExpressions:
- {key: devops-node, operator: In, values: ["beijing-node"]}
containers:
- name: doclever
image: lw96/doclever:latest
imagePullPolicy: IfNotPresent
env:
- name: DB_HOST
value: mongodb://mongodb:27017/DOClever
- name: TZ
value: Asia/Shanghai
ports:
- name: doclever
containerPort: 10000
resources:
requests:
memory: 100M
limits:
memory: 500M
volumeMounts:
- name: devops-doclerver-disk
mountPath: "/root/DOClever/data/file"
subPath: file
- name: devops-doclerver-disk
mountPath: "/root/DOClever/data/img"
subPath: img
- name: devops-doclerver-disk
mountPath: /root/DOClever/data/tmp
subPath: tmp
volumes:
- name: devops-doclerver-disk
persistentVolumeClaim:
claimName: devops-doclever-pvc
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/skyzou/devops-k8s.git
[email protected]:skyzou/devops-k8s.git
skyzou
devops-k8s
devops-k8s
master

搜索帮助