Hello i have harbor running perfectly under http://harbor.domain using nginx ingress , i install using the harbor-helm chart.
On the terminal i can push helmcharts to http://harbor.domain/chartrepo/,
i am able to login
docker login harbor.domain:80
and push to the registry.
My challenge is i would like to have harbor be accessed via an apache proxy e.g.
- https://example.com/v2 for the registry
- https://example.com/chartrepo for the chartrepo
- https://example.com/harbor to access the harbor ui
I reinstalled using harbor-helm chart by changing values.yaml
externalURL: https://example.com
So i have then on /etc/apache2/sites-available/example-le-ssl.conf
i have added the following
# helmcharts
<Location "/chartrepo/">
ProxyPass "http://harbor.domain/chartrepo/"
ProxyPassReverse "http://harbor.domain/chartrepo/"
</Location>
# harbor
<Location "/harbor">
ProxyPass "http://harbor.domain/harbor"
ProxyPassReverse "http://harbor.domain/harbor"
</Location>
# registry
<Location "/v2">
ProxyPass "http://harbor.domain/v2"
ProxyPassReverse "http://harbor.domain/v2"
</Location>
Unfortunetly if i do docker login example.com
docker login returns
Error response from daemon: login attempt to https://example.com/v2/ failed with status: 503 Service Unavailable
i get the following error on the registry logs
error authorizing context: authorization token required
Any ideas of what is i am missing?
Trying to push a chart also fails.
helm push --username='username' --password='password' demo-chart.tgz https://example.com/chartrepo/
The error being
Error: 404: could not properly parse response JSON: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.41 (Ubuntu) Server at example.com Port 443</address>
</body></html>
2
Answers
my first issue was how apache handles proxying to https backend explained here how to configure apache server to talk to HTTPS backend server?.
I added to my virtualhost
/etc/apache2/sites-available/example-le-ssl.conf
It looks like you are not able to authorize to the docker registry. Either you can add the variable to default service account or we can create docker registry secret and add that to deployment as imagepullsecret.
If you want to do that from imagepullsecret, you can create a template helper, something like
Then you can use that in deployment file like
Entire file may look like