1 Star 0 Fork 23

kar98kchen/devops-k8s

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

搜索帮助