

k8s学习配置harbor的nfs对接以及配置为helm仓库
source link: https://blog.51cto.com/u_11555417/5525924
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

k8s学习配置harbor的nfs对接以及配置为helm仓库
推荐 原创羊草 2022-07-29 12:18:59 博主文章分类:docker&k8s ©著作权
文章标签 上传 git 服务器 文章分类 kubernetes 云计算 阅读数335
harbor可以对接NFS作为远端存储,提高harbor仓库的存储空间
配置nfs
nfs服务器配置省略,主要配置nfs-client
# showmount -e $(nfs服务器的IP)
showmount -e 192.168.85.6
# 输出结果如下所示
Export list for 192.168.85.6:
/root/nfs_root *
mkdir /root/nfsmount
# mount -t nfs $(nfs服务器的IP):/root/nfs_root /root/nfsmount
mount -t nfs 192.168.85.6/root/nfs_root /root/nfsmount
配置完成后,检查挂载是否生效

修改harbor的yaml配置文件,如下配置

1 取消#storage_service的注释
2 修改data_volume 为 挂载目录
配置helm
由于新版的harbor默认没有安装helm等组件,需要添加参数安装
关于组件和配置文件的说明,参考官网
海港文档 |配置海港 YML 文件 (goharbor.io)
启动harbor
显示项目中带有helm标签,表示配置成功

配置了trivy 扫描器后,harbor就可以对上传到仓库的镜像进行扫描

使用helm上传chart到harbor
在使用helm完成了chart打包之后,就可以将chart上传到harbor了
首先使用helm添加harbor仓库
helm repo list

在使用helm push之前,必须先安装helm插件,helm默认是没有这个插件的
yum install git -y
#然后安装插件
helm plugin install https://github.com/chartmuseum/helm-push
#heml plugin list


然后上传chart

登录harbor,确认存在


使用harbor页面上传chart
将chart的安装包,上传到harbor中,通过页面方式


确认上传成功
进入chart后,可以看到添加仓库和安装chart的方法

使用helm install 安装harbor仓库的的chart
在使用之前,首先必须更新仓库,避免找不到chart包

然后使用helm从harbor安装
helm list

已确认从harbor安装chart
- 打赏
- 1赞
- 收藏
- 评论
- 分享
- 举报
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK