chartmuseum 仓库部署
在 k8s 集群中创建 chartmuseum 命名空间,编写 yaml 文件在 chartmuseum 命名空间中 使用 chartmuseum:latest 镜像创建本地私有 chart 仓库,设置其仓库存储目录为宿主机的 /data/charts 目录。编写 service.yaml 文件,为 chart 私有仓库创建 Service 访问策略,定义其 为 ClusterIP 访问模式。编写完成后启动 chartmuseum 服务。
apiVersion: apps/v1
kind: Deployment
metadata:
name: chartmuseum
namespace: chartmuseum
spec:
replicas: 1
selector:
matchLabels:
app: chartmuseum
template:
metadata:
labels:
app: chartmuseum
spec:
containers:
- name: chartmuseum
image: chartmuseum/chartmuseum:latest
ports:
- containerPort: 8080
env:
- name: STORAGE
value: "local"
- name: STORAGE_LOCAL_ROOTDIR
value: "/charts"
volumeMounts:
- name: charts-storage
mountPath: /charts
volumes:
- name: charts-storage
hostPath:
path: /data/charts
type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
name: chartmuseum
namespace: chartmuseum
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8080
selector:
app: chartmuseum
- 点赞
- 收藏
- 关注作者
评论(0)