首页
找靠谱产品
找解决方案
找靠谱公司
找案例
找对的人
专家智库
悬赏任务
SAAS
ToB门户
了解全球最新的ToB事件
论坛
潜水/灌水快乐,沉淀知识,认识更多同行。
ToB圈子
加入IT圈,遇到更多同好之人。
微博
Follow
记录
Doing
博客
Blog
文库
业界最专业的IT文库,上传资料也可以赚钱
下载
分享
Share
排行榜
Ranklist
相册
Album
应用中心
qidao123.com ToB IT社区-企服评测·应用市场
»
论坛
›
物联网/工业互联网
›
物联网
›
k8s 摆设 nexus3 详解
返回列表
发新帖
k8s 摆设 nexus3 详解
[复制链接]
发表于 2026-1-5 23:51:55
|
显示全部楼层
|
阅读模式
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要
登录
才可以下载或查看,没有账号?
立即注册
×
创建定名空间
nexus3-namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: nexus-ns
复制
代码
创建pv&pvc
nexus3-pv-pvc.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv
namespace: nexus-ns
spec:
capacity:
storage: 3Gi
accessModes:
- ReadWriteMany
nfs:
server: 10.0.2.11
path: "/root/share"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nexus-data-pvc
namespace: nexus-ns
spec:
accessModes:
- ReadWriteMany
#storageClassName: "standard"
resources:
requests:
storage: 2Gi
复制
代码
创建Deployment
nexus3-deployment.yml
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: nexus-ns
name: nexus3
labels:
app: nexus3
spec:
replicas: 1
selector:
matchLabels:
app: nexus3
template:
metadata:
labels:
app: nexus3
spec:
containers:
- name: nexus3
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/sonatype/nexus3:3.72.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8081
name: web
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 8081
initialDelaySeconds: 100
periodSeconds: 30
failureThreshold: 6
readinessProbe:
httpGet:
path: /
port: 8081
initialDelaySeconds: 100
periodSeconds: 30
failureThreshold: 6
resources:
limits:
cpu: 1000m
memory: 2Gi
requests:
cpu: 500m
memory: 2Gi
volumeMounts:
- name: nexus-data
mountPath: /nexus-data
volumes:
- name: nexus-data
persistentVolumeClaim:
claimName: nexus-data-pvc
复制
代码
创建Service
nexus3-service.yml
apiVersion: v1
kind: Service
metadata:
name: nexus3
namespace: nexus-ns
labels:
app: nexus3
spec:
selector:
app: nexus3
type: NodePort
ports:
- name: web
protocol: TCP
port: 8081
targetPort: 8081
nodePort: 31081
复制代码
参考
https://segmentfault.com/a/1190000040446848?utm_source=sf-similar-article
复制代码
回复
使用道具
举报
返回列表
浏览过的版块
分布式数据库
DevOps与敏捷开发
人工智能
.Net
数据仓库与分析
Java
SQL-Server
linux
SAAS
怀念夏天
+ 我要发帖
登录后关闭弹窗
登录参与点评抽奖 加入IT实名职场社区
去登录
微信订阅号
微信服务号
微信客服(加群)
H5
小程序
快速回复
返回顶部
返回列表