<p>I am installed harbor in my kubernetes v1.18 cluster, what makes me confusing is that when I login harbor using default username and password: <code>admin/Harbor123456</code>, it give me error: <code>405 Method Not Allowed</code>.</p>
<p><a href="https://i.stack.imgur.com/zzxKF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zzxKF.png" alt="enter image description here" /></a></p>
<p>405 is show that you should using <code>GET</code> but actuallly using <code>POST</code> error, I do not think the harbor login page would make this mistake.why would this happen and what should I do to fix it? By the way, This is the kubernetes traefik config:</p>
<pre><code>spec:
  entryPoints:
    - web
  routes:
    - kind: Rule
      match: Host(`harbor-portal.dolphin.com`)
      services:
        - name: harbor-harbor-portal
          port: 80
    - kind: Rule
      match: Host(`harbor-portal.dolphin.com`) &amp;&amp; PathPrefix(`/c`)
      services:
        - name: harbor-harbor-core
          port: 80
    - kind: Rule
      match: Host(`harbor-portal.dolphin.com`) &amp;&amp; PathPrefix(`/v2`)
      services:
        - name: harbor-harbor-core
          port: 80
    - kind: Rule
      match: Host(`harbor-portal.dolphin.com`) &amp;&amp; PathPrefix(`/api`)
      services:
        - name: harbor-harbor-core
          port: 80
    - kind: Rule
      match: Host(`harbor-portal.dolphin.com`) &amp;&amp; PathPrefix(`/service`)
      services:
        - name: harbor-harbor-core
          port: 80
    - kind: Rule
      match: Host(`harbor-portal.dolphin.com`) &amp;&amp; PathPrefix(`/chartrepo`)
      services:
        - name: harbor-harbor-core
          port: 80
</code></pre>
<p>the kubernetes ingress is traefik 2.2.1. This is the log output of harbor portal in kubernetes pod:</p>
<pre><code>2020-08-03T16:50:17.415502118Z  10.11.157.67 - - [03/Aug/2020:16:50:17 +0000] &quot;GET / HTTP/1.1&quot; 200 856 &quot;-&quot; &quot;Go-http-client/1.1&quot;
2020-08-03T16:50:18.242118851Z  192.168.31.30 - - [03/Aug/2020:16:50:18 +0000] &quot;GET / HTTP/1.1&quot; 200 856 &quot;-&quot; &quot;kube-probe/1.18&quot;
2020-08-03T16:50:18.307214547Z  192.168.31.30 - - [03/Aug/2020:16:50:18 +0000] &quot;POST /c/login HTTP/1.1&quot; 405 559 &quot;http://harbor-portal.dolphin.com/harbor/sign-in?redirect_url=%2Fharbor%2Fprojects&quot; &quot;Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36&quot;
2020-08-03T16:50:19.233495082Z  192.168.31.30 - - [03/Aug/2020:16:50:19 +0000] &quot;POST /c/login HTTP/1.1&quot; 405 559 &quot;http://harbor-portal.dolphin.com/harbor/sign-in?redirect_url=%2Fharbor%2Fprojects&quot; &quot;Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36&quot;
</code></pre>
<p>send the request from harbor portal kubernetes pod:</p>
<pre><code>nginx [ / ]$   curl -X POST 'http://localhost:8080/c/login' \
&gt;   -H 'Connection: keep-alive' \
&gt;   -H 'Accept: application/json, text/plain, */*' \
&gt;   -H 'DNT: 1' \
&gt;   -H 'User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36' \
&gt;   -H 'Content-Type: application/x-www-form-urlencoded' \
&gt;   -H 'Origin: http://harbor-portal.dolphin.com' \
&gt;   -H 'Referer: http://harbor-portal.dolphin.com/harbor/sign-in?redirect_url=%2Fharbor%2Fprojects' \
&gt;   -H 'Accept-Language: en,zh-CN;q=0.9,zh;q=0.8,zh-TW;q=0.7,fr;q=0.6' \
&gt;   --data-raw 'principal=admin&amp;password=Harbor123456' \
&gt;   --compressed \
&gt;   --insecure
&lt;html&gt;
&lt;head&gt;&lt;title&gt;405 Not Allowed&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;&lt;h1&gt;405 Not Allowed&lt;/h1&gt;&lt;/center&gt;
&lt;hr&gt;&lt;center&gt;nginx/1.16.1&lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;!-- a padding to disable MSIE and Chrome friendly error page --&gt;
&lt;!-- a padding to disable MSIE and Chrome friendly error page --&gt;
&lt;!-- a padding to disable MSIE and Chrome friendly error page --&gt;
&lt;!-- a padding to disable MSIE and Chrome friendly error page --&gt;
&lt;!-- a padding to disable MSIE and Chrome friendly error page --&gt;
&lt;!-- a padding to disable MSIE and Chrome friendly error page --&gt;
</code></pre>

Dolphin
<p>I installed harbor(v1.10.4) by helm with alb ingress. When login with correct user&amp;password it returns 405 error.<br />
Followed this issue(<a href="https://github.com/goharbor/harbor-helm/issues/485#issuecomment-686222551" rel="nofollow noreferrer">https://github.com/goharbor/harbor-helm/issues/485#issuecomment-686222551</a>), I solved this question. The key reason is that ingress rules leads login request to portal. Just change the portal related rule to the buttom could sovle it.</p>
<p>origin ingress:</p>
<pre><code>spec:
  rules:
  - host: harbor.xxx.com
    http:
      paths:
      - backend:
          serviceName: harbor-harbor-portal
          servicePort: 80
        path: /*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /api/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /service/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /v2/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /chartrepo/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /c/*
        pathType: ImplementationSpecific
</code></pre>
<p>after modify:</p>
<pre><code>spec:
  rules:
  - host: harbor.xxx.com
    http:
      paths:
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /api/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /service/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /v2/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /chartrepo/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-core
          servicePort: 80
        path: /c/*
        pathType: ImplementationSpecific
      - backend:
          serviceName: harbor-harbor-portal
          servicePort: 80
        path: /*
        pathType: ImplementationSpecific
</code></pre>
