Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to push docker image to harbor registry? #61

Closed
liudaze opened this issue Oct 18, 2018 · 24 comments
Closed

How to push docker image to harbor registry? #61

liudaze opened this issue Oct 18, 2018 · 24 comments

Comments

@liudaze
Copy link

liudaze commented Oct 18, 2018

大家好:
我的Harbor已经搭建完成。用的ingress暴露的服务。其中externalURL为:

externalURL: http://harbor.liudz.net

可以用“docker login harbor.liudz.net”登录成功。但是在push image的时候一直报如下错误:

[root@localhost harbor-helm]# ls
[root@localhost harbor-helm]# docker push harbor.liudz.net/test/busybox:v1
The push refers to a repository [harbor.liudz.net/test/busybox]
0610f7f0e378: Preparing 
Error: Status 404 trying to push repository test/busybox: "default backend - 404"

求助,我改怎么上传我本地的docker image呢?

@liudaze liudaze changed the title push image How to push docker image to harbor registry? Oct 18, 2018
@reasonerjt
Copy link
Contributor

Looks like the ingress controller failed to route the request to registry service.

@liudaze liudaze closed this as completed Oct 19, 2018
@liudaze liudaze reopened this Oct 19, 2018
@liudaze
Copy link
Author

liudaze commented Oct 19, 2018

Looks like the ingress controller failed to route the request to registry service.

yes, it's couldn't use ingress, why?

@reasonerjt
Copy link
Contributor

You need to debug and check the log of your ingress controller. @liudaze

@liudaze
Copy link
Author

liudaze commented Oct 24, 2018

You need to debug and check the log of your ingress controller. @liudaze

no ingress logs.
If not used ingress, like docker push harbor.liudz.net:32720/test/busybox:v1, it's ok. @reasonerjt

@shayulei
Copy link

shayulei commented Nov 8, 2018

我也有这样的问题,不知道如何解决?版本1.6
error parsing HTTP 404 response body: invalid character 'd' looking for beginning of value: "default backend - 404"

@ywk253100
Copy link
Collaborator

@shayulei 安装的时候怎么配置的Harbor chart?

@shayulei
Copy link

shayulei commented Nov 8, 2018

‘helm install . --debug --name my-harbor --namespace harbor --set externalDomain=harbor.microvast.com.cn,insecureRegistry=true -f ./values1.yaml’
values1.yaml.txt

@liudaze
Copy link
Author

liudaze commented Nov 8, 2018

我也有这样的问题,不知道如何解决?版本1.6
error parsing HTTP 404 response body: invalid character 'd' looking for beginning of value: "default backend - 404"

ingress使用的七层协议,而docker image的pull和push使用的四层,所以无法直接通过ingress对docker image进行pull和push操作。你可以给registry的svc暴露node port,然后用ip + 端口号,可以push。

@shayulei
Copy link

shayulei commented Nov 8, 2018

端口是5000,还是8080?
[root@etcd3 ~]# kubectl get svc -n harbor NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE my-harbor-harbor-adminserver ClusterIP 10.106.59.65 <none> 80/TCP 21d my-harbor-harbor-chartmuseum ClusterIP 10.99.1.24 <none> 80/TCP 21d my-harbor-harbor-clair ClusterIP 10.106.85.1 <none> 6060/TCP 21d my-harbor-harbor-core ClusterIP 10.107.183.177 <none> 80/TCP 21d my-harbor-harbor-database ClusterIP 10.98.162.41 <none> 5432/TCP 21d my-harbor-harbor-jobservice ClusterIP 10.103.234.34 <none> 80/TCP 21d my-harbor-harbor-notary-server ClusterIP 10.103.114.167 <none> 4443/TCP 21d my-harbor-harbor-notary-signer ClusterIP 10.111.4.225 <none> 7899/TCP 21d my-harbor-harbor-portal ClusterIP 10.97.234.111 <none> 80/TCP 21d my-harbor-harbor-registry ClusterIP 10.99.27.72 <none> 5000/TCP,8080/TCP 21d my-harbor-redis-master ClusterIP 10.109.121.192 <none> 6379/TCP 21d

@liudaze
Copy link
Author

liudaze commented Nov 8, 2018

端口是5000,还是8080?
[root@etcd3 ~]# kubectl get svc -n harbor NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE my-harbor-harbor-adminserver ClusterIP 10.106.59.65 <none> 80/TCP 21d my-harbor-harbor-chartmuseum ClusterIP 10.99.1.24 <none> 80/TCP 21d my-harbor-harbor-clair ClusterIP 10.106.85.1 <none> 6060/TCP 21d my-harbor-harbor-core ClusterIP 10.107.183.177 <none> 80/TCP 21d my-harbor-harbor-database ClusterIP 10.98.162.41 <none> 5432/TCP 21d my-harbor-harbor-jobservice ClusterIP 10.103.234.34 <none> 80/TCP 21d my-harbor-harbor-notary-server ClusterIP 10.103.114.167 <none> 4443/TCP 21d my-harbor-harbor-notary-signer ClusterIP 10.111.4.225 <none> 7899/TCP 21d my-harbor-harbor-portal ClusterIP 10.97.234.111 <none> 80/TCP 21d my-harbor-harbor-registry ClusterIP 10.99.27.72 <none> 5000/TCP,8080/TCP 21d my-harbor-redis-master ClusterIP 10.109.121.192 <none> 6379/TCP 21d

5000

@ywk253100
Copy link
Collaborator

@liudaze Docker和Registry之间通信使用的是HTTP协议,应该不存在无法通过ingress pull/push镜像的问题。

@shayulei 你部署的Harbor Web Portal可以访问吗?可以docker login 只有docker push有问题?
如果是这样你能否提供下push镜像时ingress controller、core和registry的log。

@liudaze
Copy link
Author

liudaze commented Nov 8, 2018

@liudaze Docker和Registry之间通信使用的是HTTP协议,应该不存在无法通过ingress pull/push镜像的问题。

@shayulei 你部署的Harbor Web Portal可以访问吗?可以docker login 只有docker push有问题?
如果是这样你能否提供下push镜像时ingress controller、core和registry的log。

portal可以访问,就是不能用ingress绑定的域名进行pull和push。

@liudaze
Copy link
Author

liudaze commented Nov 8, 2018

@liudaze Docker和Registry之间通信使用的是HTTP协议,应该不存在无法通过ingress pull/push镜像的问题。

@shayulei 你部署的Harbor Web Portal可以访问吗?可以docker login 只有docker push有问题?
如果是这样你能否提供下push镜像时ingress controller、core和registry的log。

你的可以直接通过externalURL配置的域名进行pull和push操作吗

@ywk253100
Copy link
Collaborator

@liudaze Yes. 能否提供下log好帮助定位问题出在什么地方

@liudaze
Copy link
Author

liudaze commented Nov 8, 2018

@liudaze Yes. 能否提供下log好帮助定位问题出在什么地方
需要哪个pods的日志?

@liudaze
Copy link
Author

liudaze commented Nov 8, 2018

@liudaze Yes. 能否提供下log好帮助定位问题出在什么地方

能加下qq吗,我直接向您请教。我的是2960179330

@ywk253100
Copy link
Collaborator

@shayulei @liudaze Try the workaround in issue goharbor/harbor#5291 or deploy Harbor with HTTPS enabled.

@shayulei
Copy link

shayulei commented Nov 9, 2018

经过测试加了80端口,的确故障消失。

@shayulei
Copy link

shayulei commented Nov 9, 2018

我现在想使用HTTPS,修改了values.yaml里的 ExternalURL: https://harbor.microvast.com.cn,
tls:
enabled: true
但后my-harbor-harbor-core-6d6dcd48c-tx2gd起不来了,报
root@etcd3 harbor-helm]# kubectl log -f my-harbor-harbor-core-6d6dcd48c-tx2gd -n harbor
log is DEPRECATED and will be removed in a future version. Use logs instead.
2018-11-09T05:52:03Z [DEBUG] [authenticator.go:126]: Registered authencation helper for auth mode: db_auth
2018-11-09T05:52:03Z [DEBUG] [authenticator.go:126]: Registered authencation helper for auth mode: ldap_auth
2018-11-09T05:52:03Z [DEBUG] [authenticator.go:126]: Registered authencation helper for auth mode: uaa_auth
2018-11-09T05:52:03Z [DEBUG] [init.go:37]: topic StartReplication is subscribed
2018-11-09T05:52:03Z [DEBUG] [init.go:37]: topic OnPush is subscribed
2018-11-09T05:52:03Z [DEBUG] [init.go:37]: topic OnDeletion is subscribed
2018-11-09T05:52:03Z [INFO] Config path: /etc/core/app.conf
2018-11-09T05:52:03Z [INFO] initializing configurations...
2018-11-09T05:52:03Z [INFO] key path: /etc/core/key
2018-11-09T05:52:03Z [INFO] initializing client for adminserver http://my-harbor-harbor-adminserver ...
2018-11-09T05:52:03Z [FATAL] [main.go:87]: failed to initialize configurations: http error: code 401, message Unauthorized
不知如何解决

@ywk253100
Copy link
Collaborator

使用的镜像应该不是最新的。把imagePullPolicy设置成Always,重新部署。

@shayulei
Copy link

shayulei commented Nov 9, 2018

使用的镜像应该不是最新的。把imagePullPolicy设置成Always,重新部署。

成功了,要手动的下载一下镜像,网络不是太好,改成Alays后,其它POD启动失败。

@ywk253100
Copy link
Collaborator

什么原因导致的启动失败?

@shayulei
Copy link

shayulei commented Nov 9, 2018

查不出来,104错误。

@liudaze
Copy link
Author

liudaze commented Nov 9, 2018

改成Alays后,问题已解决,非常谢谢各位大神

@liudaze liudaze closed this as completed Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants