<p>I have a private Docker registry inside a Kubernetes 1.13 cluster exposed by a Kubernetes NGINX ingress controller 0.23.0 and the following <code>Ingress</code> object:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  name: my-name
  namespace: my-namespace
spec:
  rules:
  - host: my-domain
    http:
      paths:
      - backend:
          serviceName: registry
          servicePort: 5000
        path: /?(.*)
  tls:
  - hosts:
    - my-domain
    secretName: my-secret
</code></pre>

<p>This allows me to pull an existing image as follows:</p>

<pre><code>docker image pull my-cluster/my-image
</code></pre>

<p>I would not now change the setup such that the registry is exposed at <code>my-cluster/registry</code>. How can this be done, and is it even possible? </p>

<p>Changing <code>path</code> to <code>/registry/?(.*)</code> did not do the trick. <code>docker login my-cluster/registry</code> now produces the following error message and <code>docker image pull my-cluster/registry/my-image</code> also does not work. My current guess as to the root cause is that the registry also also use the prefix <code>registry</code> (as configured in the <code>Ingress</code>) for its internal redirects. If applicable, how can this be configured (preferably in the <code>Ingress</code> too)?</p>

<pre><code>Error response from daemon: login attempt to https://my-cluster/v2/ failed with status: 404 Not Found
</code></pre>

rookie099
<p>I have now concluded that referring to a Docker registry by a URL-like location (such as <code>my-cluster/registry</code>) as opposed to a host-like location (such as <code>my-cluster</code> with an optional port) is not possible.</p>

<p>So I'll reserve a separate IP address and certificate for <code>registry.my-cluster</code> and proceed with that.</p>
