Kubernetes使用Harbor仓库
来源:互联网 发布:plc网络传输器弊端 编辑:程序博客网 时间:2024/06/05 19:30
1.创建Secret:
kubectl create secret docker-registry SECRET_NAME –namespace=NAME_SPACE \
–docker-server=DOCKER_REGISTRY_SERVER –docker-username=DOCKER_USER \
–docker-password=DOCKER_PASSWORD –docker-email=DOCKER_EMAIL
其中,
docker-server 为通过docker login登陆时输入的地址
docker-username 为登陆时的账号
docker-password 为登陆时的密码
docker-email 为注册的账号时的邮箱地址
查看secret的内容:
kubectl get secret harbor –namespace=common -o yaml
2.在RC中引用:
root@kubernetes1:~/test# cat frontend-controller.yamlapiVersion: v1kind: ReplicationControllermetadata: name: frontend namespace: common labels: name: frontendspec: replicas: 3 selector: name: frontend template: metadata: namespace: common labels: name: frontend spec: containers: - name: frontend image: server.com/test/guestbook-php-frontend env: - name: GET_HOSTS_FROM value: env ports: - containerPort: 80 imagePullSecrets: - name: harbor
kubectl create -f frontend-controller.yaml
3.查看Pods状态及日志:
kubectl get pods –namespace=common
kubectl describe pod frontend-cwfsm –namespace=common
遇到的问题:
1.FailedSync Error syncing pod, skipping: failed to “StartContainer” for “frontend” with ErrImagePull: “Error response from daemon: {\”message\”:\”Get https://server.com/v1/_ping: dial tcp: lookup harbor.itopka.com on 10.16.40.3:53: no such host\”}”
解决:在公网解析了域名的私网IP地址。
2.FailedSync Error syncing pod, skipping: failed to “StartContainer” for “frontend” with ErrImagePull: “Error response from daemon: {\”message\”:\”Get https://server.com/v1/_ping: dial tcp 192.168.1.132:443: getsockopt: connection refused\”}”
解决:在/etc/default/docker中添加:
DOCKER_OPTS=”- -insecure-registry server.com”
ubuntu 15\16:
vim /lib/systemd/system/docker.service
ExecStart=/usr/bin/docker daemon -H fd:// –insecure-registry harbor.itopka.com
另外通过创建serviceAccount并引用的方式没有将pod运行起来,好不知道原因。提示:
Failed to pull image “server.com/test/guestbook-php-frontend”: image pull failed for server.com/test/guestbook-php-frontend:latest, this may be because there are no credentials on this request. details: (Error: image test/guestbook-php-frontend:latest not found)
- Kubernetes使用Harbor仓库
- Kubernetes如何使用Harbor作为私有镜像仓库
- 使用 harbor 搭建 docker 私有镜像仓库
- docker镜像仓库harbor快速部署和使用
- 使用Harbor搭建Docker私有镜像仓库服务
- 使用Harbor搭建Docker私有镜像仓库服务
- kuberntes 使用harbor最为镜像仓库配置
- 搭建docker仓库harbor
- Harbor -- 搭建Docker私有仓库
- VMWare Harbor 在 Kubernetes 上的部署
- Kubernetes集群中部署私有库harbor
- 《kubernetes-1.8.0》11-addon-Harbor
- Centos7上Docker仓库Harbor的搭建
- docker 私有镜像仓库 harbor 搭建
- centos7搭建harbor镜像仓库
- Docker私有仓库管理之Harbor搭建
- 企业级私有Docker仓库Harbor搭建
- 【转】Harbor 私有仓库简单部署
- CSS外部样式示例
- 0-1背包(空间优化)
- 【java】使用一维数组实现评委打分功能
- 检索(散列)
- Reorder List and Sum of Left Leaves
- Kubernetes使用Harbor仓库
- POJ 1039 Pipe(直线和线段相交判断,求交点)
- Caffe windows踩坑
- react native使用原生模块
- 蓝桥杯 第八届
- ZOJ3768 Continuous Login
- Idea 将新写的项目中的一个java文件搞成jar包方法
- Java遇到Resource leak: 'input' is never closed怎么解决
- 关于Curl的get和post请求