k8s1.31版本最新版本集群使用容器镜像仓库Harbor

虚拟机 rocky9.4 linux master node01 node02 已部署k8s集群版本 1.31

方法

一 使用容器部署harbor

(1)

wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo

yum -y install docker-ce

systemctl enable docker && systemctl start docker

(2下载一个docker-compose工具

root@harbor \~\]# wget [https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64](https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64 "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64") curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-\`uname -s\`-\`uname -m\` \> /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose -v ![](https://i-blog.csdnimg.cn/direct/fd481ab143ce41b4b40889c1937e264c.png) 3.下载Harbor的压缩包 [https://github.com/goharbor/harbor/releases](https://github.com/goharbor/harbor/releases "https://github.com/goharbor/harbor/releases") #上传压缩包到linux,并解压 tar -xzf -offline-installer-v2.1.0_2.tgz mkdir /opt/harbor mv harbor/\* /opt/harbor cd /opt/harbor 4.修改harbor配置 #没有的话复制harbor.yml.tmpl cp -a harbor.yml.tmpl harbor.yml vim harbor.yml 修改hostname和port hostname: 192.168.10.10 port: 80 #注释掉https这段 # https related config #https: # https port for harbor, default is 443 # port: 443 # The path of cert and key files for nginx # certificate: /your/certificate/path #private_key: /your/private/key/path 5.安装harbor ./install.sh 6、访问地址与账号密码http://192.168.10.100默认账户密码:admin/Harbor12345 ![](https://i-blog.csdnimg.cn/direct/5ff7c52b71c14c12a4ab949ea61c6f14.png) 6.启动、停止、重启 docker-compose up -d 启动 docker-compose stop 停止 docker-compose restart 重新启动 7 登录harbor 新建项目 ![](https://i-blog.csdnimg.cn/direct/4f22e54268fc431fab05cdda92b55bf2.png) vim /etc/docker/daemon.json 客户端设置 { "registry-mirrors": \["https://1dmptu91.mirror.aliyuncs.com"\], "exec-opts": \["native.cgroupdriver=systemd"\], "insecure-registries": \["http://192.168.10.100"

}

root@master \~\]# systemctl restart docker 客户机登录仓库: docker login -u 'admin' -p 'Harbor12345' http://192.168.10.100 ![](https://i-blog.csdnimg.cn/direct/e8a8c40fe18e4b97949e19a1fd138015.png) docker tag nginx:1.20 192.168.10.100/yb/nginx 上传仓库 docker pull 192.168.10.100/yb/nginx ![](https://i-blog.csdnimg.cn/direct/a7bc5adca1fb4fa3b3f00cce1da2a1b4.png)

相关推荐
用户31187945592183 小时前
Kylin Linux 10 安装 glib2-devel-2.62.5-7.ky10.x86_64.rpm 方法(附安装包)
linux
涛啊涛4 小时前
Centos7非LVM根分区容量不足后扩容,对调硬盘挂载/
linux·磁盘管理
Serverless社区20 小时前
函数计算的云上计费演进:从请求驱动到价值驱动,助力企业走向 AI 时代
阿里云·云原生·serverless
CYRUS_STUDIO1 天前
用 Frida 控制 Android 线程:kill 命令、挂起与恢复全解析
android·linux·逆向
熊猫李1 天前
rootfs-根文件系统详解
linux
dessler1 天前
Hadoop HDFS-高可用集群部署
linux·运维·hdfs
泽泽爱旅行1 天前
awk 语法解析-前端学习
linux·前端
资源开发与学习2 天前
Kubernetes集群核心概念 Service
kubernetes
阿里云云原生2 天前
【云栖大会】AI原生、AI可观测、AI Serverless、AI中间件,4场论坛20+议题公布!
云原生
容器魔方2 天前
Bloomberg 正式加入 Karmada 用户组!
云原生·容器·云计算