harbor关联k8s
第一步
在harbor上创建用户,项目,将用户添加到对应项目中,并赋予用户项目管理者或者开发人员权限,使其对镜像仓库有读写权限。
本次部署创建用户liusw,密码Lsw123456,邮箱873001704@qq.com,项目batman
第二步 创建secret
kubectl create secret docker-registry harbortest --docker-server=172.19.68.11:5000 --docker-username=liusw --docker-password=Lsw123456 --docker-email=@qq.com
查看secret的内容
kubectl get secret harbortest -o yaml
在node结点登录到harbor
docker login 172.19.68.11:5000
报错如下
Error response from daemon: Get https://172.19.68.11:5000/v1/users/: http: server gave HTTP response to HTTPS client
解决办法:
查看单独安装harbor服务器的配置
[root@izuf66p8tou7n3ktvgnu8pz docker]# vim /etc/docker/daemon.json
{ "registry-mirrors": ["https://wb2g6zxl.mirror.aliyuncs.com"],"insecure-registries":["172.19.68.11:5000"]}
在node结点新增如下配置
修改配置文件, 增加 --insecure-registry=172.19.68.11:5000 选项
[root@node2 yum.repos.d]# find / -name docker.service -type f
/usr/lib/systemd/system/docker.service
[root@node2 yum.repos.d]# cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target
Wants=docker-storage-setup.service
Requires=docker-cleanup.timer [Service]
Type=notify
NotifyAccess=main
EnvironmentFile=-/run/containers/registries.conf
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
Environment=DOCKER_HTTP_HOST_COMPAT=
Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbin
ExecStart=/usr/bin/dockerd-current --insecure-registry=172.19.68.11:5000 \
--add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \
--default-runtime=docker-runc \
--exec-opt native.cgroupdriver=systemd \
--userland-proxy-path=/usr/libexec/docker/docker-proxy-current \
--init-path=/usr/libexec/docker/docker-init-current \
--seccomp-profile=/etc/docker/seccomp.json \
$OPTIONS \
$DOCKER_STORAGE_OPTIONS \
$DOCKER_NETWORK_OPTIONS \
$ADD_REGISTRY \
$BLOCK_REGISTRY \
$INSECURE_REGISTRY \
$REGISTRIES
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=
LimitNPROC=
LimitCORE=infinity
TimeoutStartSec=
Restart=on-abnormal
KillMode=process [Install]
WantedBy=multi-user.target
重启docker
systemctl daemon-reload
systemctl restart docker
查看服务,已经包含了 --insecure-registry=172.19.68.11:5000 参数
[root@node2 yum.repos.d]# ps aux|grep docker
root 0.8 0.2 ? Ssl : : /usr/bin/dockerd-current --insecure-registry=172.19.68.11: --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json --selinux-enabled --log-driver=journald --signature-verification=false --storage-driver overlay2
root 0.1 0.0 ? Ssl : : /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc --runtime-args --systemd-cgroup=true
root 0.0 0.0 ? Sl : : /usr/bin/docker-containerd-shim-current 0ea8705364158e32219dfdd182071e213e3d0e2d3e5c2d6f2c28db3683d18c29 /var/run/docker/libcontainerd/0ea8705364158e32219dfdd182071e213e3d0e2d3e5c2d6f2c28db3683d18c29 /usr/libexec/docker/docker-runc-current
root 0.0 0.0 ? Sl : : /usr/bin/docker-containerd-shim-current 60bb2cb57c6d406d6b7ffe3ace4d551d914ef44d43f2db7b8f8ed7f292123456 /var/run/docker/libcontainerd/60bb2cb57c6d406d6b7ffe3ace4d551d914ef44d43f2db7b8f8ed7f292123456 /usr/libexec/docker/docker-runc-current
root 0.0 0.0 ? Sl : : /usr/bin/docker-containerd-shim-current 38c7b675205a7d24705ce9377a02427b9f888178ae1e73669980e4d269f35678 /var/run/docker/libcontainerd/38c7b675205a7d24705ce9377a02427b9f888178ae1e73669980e4d269f35678 /usr/libexec/docker/docker-runc-current
root 0.0 0.0 ? Sl : : /usr/bin/docker-containerd-shim-current d4de3b840b48380f3641ead439748623310a08698a9b6b21d0f0444625809476 /var/run/docker/libcontainerd/d4de3b840b48380f3641ead439748623310a08698a9b6b21d0f0444625809476 /usr/libexec/docker/docker-runc-current
root 0.0 0.0 ? Sl : : /usr/bin/docker-containerd-shim-current 7d28ff21af8450030f023e18930035030b2ce4b2e5bb7a72fbdbd91f4327a820 /var/run/docker/libcontainerd/7d28ff21af8450030f023e18930035030b2ce4b2e5bb7a72fbdbd91f4327a820 /usr/libexec/docker/docker-runc-current
root 0.0 0.0 ? Sl : : /usr/bin/docker-containerd-shim-current bc67333d4ff8dc26bc5d8dfe70c7a141db40663030db2f1f79f800575865980f /var/run/docker/libcontainerd/bc67333d4ff8dc26bc5d8dfe70c7a141db40663030db2f1f79f800575865980f /usr/libexec/docker/docker-runc-current
root 0.0 0.0 pts/ S+ : : grep --color=auto docker
[root@node2 yum.repos.d]# docker login 172.19.68.11:
Username: liusw
Password:
Login Succeeded
harbor关联k8s的更多相关文章
- Jenkins+harbor+gitlab+k8s 部署maven项目
一.概述 maven项目部署流程图如下: 环境介绍 操作系统 ip 角色 版本 ubuntu-16.04.4-server-amd64 192.168.10.122 Jenkins+harbor Je ...
- kubernetes实战(十):k8s使用Helm安装harbor
1.基本概念 对于复杂的应用中间件,需要设置镜像运行的需求.环境变量,并且需要定制存储.网络等设置,最后设计和编写Deployment.Configmap.Service及Ingress等相关yaml ...
- 使用k8s operator安装和维护etcd集群
关于Kubernetes Operator这个新生事物,可以参考下文来了解这一技术的来龙去脉: https://yq.aliyun.com/articles/685522?utm_content=g_ ...
- harbor搭建与使用
前两天测试服务docker化并k8s布署时,出于方便,使用了docker hub.由于我们的代码是要放到镜像里的,通过运行容器,便能获取我们的全部代码,风险很大.所以我们决定进行私有化的镜像部 ...
- 基于Kubernetes/K8S构建Jenkins持续集成平台(下)
基于Kubernetes/K8S构建Jenkins持续集成平台(下) Jenkins-Master-Slave架构图回顾: 安装和配置NFS NFS简介 NFS(Network File System ...
- 微服务从代码到k8s部署应有尽有大结局(k8s部署)
我们用一个系列来讲解从需求到上线.从代码到k8s部署.从日志到监控等各个方面的微服务完整实践. 整个项目使用了go-zero开发的微服务,基本包含了go-zero以及相关go-zero作者开发的一些中 ...
- fn project 试用之后的几个问题的解答
今天试用fnproject 之后自己有些思考,后面继续解决 1. 目前测试是强依赖 dockerhub 的,实际可能不是很方便 2. 如何与k8s .mesos.docker swarm 集成 ...
- 新书推荐《再也不踩坑的Kubernetes实战指南》
<再也不踩坑的Kubernetes实战指南>终于出版啦.目前可以在京东.天猫购买,京东自营和当当网预计一个星期左右上架. 本书贴合生产环境经验,解决在初次使用或者是构建集群中的痛点,帮 ...
- Jenkins+Gitlab配置Webhook实现提交自动部署
一.概述 在上一篇文章,链接如下: https://www.cnblogs.com/xiao987334176/p/11434849.html 已经实现了 Jenkins+harbor+gitlab+ ...
随机推荐
- elasticsearch工作笔记002---Centos7.3安装最新版elasticsearch-7.0.0-beta1-x86_64.rpm单机版安装
新版本es安装问题: https://blog.csdn.net/lidew521/article/details/88091539
- 解决问题:OSError: mysql_config not found
通过pip install mysqlclient时报出了OSError: mysql_config not found错误,如下 Traceback (most recent call last): ...
- PCA与LDA
- 015-命令行下载安装brew
一.brew 1.安装Homebrew 安装命令: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/inst ...
- QML使用C++对象
一.定义QObject子类 Myudp.h #ifndef MYUDP_H #define MYUDP_H #include <QObject> #include <QUdpSock ...
- LeetCode_169. Majority Element
169. Majority Element Easy Given an array of size n, find the majority element. The majority element ...
- mysql命令、mysqldump命令找不到解决
1.解决bash: mysql: command not found 的方法 [root@DB-02 ~]# mysql -u root -bash: mysql: command not found ...
- 理解ADFS相关概念
核心概念 Claims是?Token是?Security Token是?Security Token Server (STS)是? 声明与令牌无关,但通过封装在安全令牌中来进行网络传输! SSL证书是 ...
- iOS笔试题04
1. Object-C有多继承吗?没有的话用什么代替? 1> OC是单继承,没有多继承 2> 有时可以用分类category和协议protocol来代替多继承 2. Object-C有私 ...
- CentOS 7中安装和配置Promethues
Prometheus 是什么? Prometheus是一套开源的监控&报警&时间序列数据库的组合,起始是由SoundCloud公司开发的.随着发展,越来越多公司和组织接受采用Prome ...