SUSE / caasp-services

Layered Services on the SUSE Container-as-a-Service Platform
Apache License 2.0
25 stars 30 forks source link

Can not login docker registry #36

Closed YunSangJun closed 6 years ago

YunSangJun commented 6 years ago

Problem

I can not login docker registry(External Registry Address).

Access to portus console is fine.

http://portus.ghama.io:31705/

Access docker registry(External Registry Address) is error.

docker login http://portus-registry.ghama.io:31705
Username: admin
Password: 
Error response from daemon: Get http://portus-registry.ghama.io:31705/v2/: invalid token auth challenge realm: parse http://portus-registry.ghama.io:%!s(<nil>)/v2/token: invalid URL escape "%!s"

Service

kubectl get svc -n portus
NAME                     TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
portus-mariadb           ClusterIP   172.21.31.187    <none>        3306/TCP            38s
portus-portus            ClusterIP   172.21.149.227   <none>        3000/TCP            38s
portus-portus-nginx      NodePort    172.21.41.15     <none>        80:31705/TCP        38s
portus-portus-registry   ClusterIP   172.21.148.13    <none>        5000/TCP,5001/TCP   38s

Domain

The following domain is bounded to worker node ip(169.56.94.173).

$ nslookup portus-registry.ghama.io
Name:   portus-registry.ghama.io
Address: 169.56.94.173

$ nslookup portus.ghama.io
Name:   portus.ghama.io
Address: 169.56.94.173
YunSangJun commented 6 years ago

I resolved this issue to fix registry-configmap.yaml.

REGISTRY_AUTH_TOKEN_REALM: {{ printf "https://%s:%d/v2/token" (.Values.nginx.host | default (printf "%s" (include "nginx.fullname" .))) (int .Values.nginx.service.port) | quote }} REGISTRY_AUTH_SILLY_REALM: {{ printf "http://%s:%d/v2/token" (.Values.nginx.host | default (printf "%s" (include "nginx.fullname" .))) (int (.Values.registry.service.nodePort | default .Values.nginx.service.port)) | quote }}