I wanted to pull kubernetes control plane images from k8s.gcr.io, onto my local harbor instance.

I tried all the options in the drop-down,
gcr.io
us.gcr.io
eu.gcr.io
asia.gcr.io
Logs in harbor-core
I referred to https://github.com/goharbor/harbor/issues/7784, however in my case I was able to ping/curl the gcr.io endpoints perfectly fine.
sample
harbor [ /harbor ]$ curl https://k8s.gcr.io
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="https://cloud.google.com/container-registry/">here</A>.
</BODY></HTML>
harbor [ /harbor ]$
harbor [ /harbor ]$ curl https://gcr.io
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="https://cloud.google.com/container-registry/">here</A>.
</BODY></HTML>
harbor version: 1.10.1
docker engine version: 19.03.7
docker-compose version: 1.25.4
@bitsf
Let's take a look at what happened. I also tried before, it really does not work. I'm also wondering if the images of k8s.gcr.io are public ones, how can I directly replicate them without JSON key?
You should input the entire json in the textarea.

The key is something like

And your account should have Storage Admin role in IAM setting

And in replication rule, you should also input the namespace


And the replication can work as

@bitsf
Do I need this even for public k8s control plane images?
I am not using GCR for more than replicating k8s images.
@bjethwan Yes, we need credential, this is because GCR _catalog API which we use to list repositories need authorization.
@bitsf Currently Habor does not allow users to add gcr endpoint without credentials. But Docker client can pull distroless images from gcr.io without any credential. Really no method to pull public images from gcr.io without credential using Harbor?
@soulawaker
Have you tried to replicate public GCR images with the Docker Registry adapter?
I tried to replicate k8s.gcr.io by the Docker Registry adapter without providing json_key, it does work.
cc @bitsf
if you don't need use * to filter, you can use docker registry adapter.
@steven-zou
OK, I confirmed to work.
docker-registry as a Provider and https://gcr.io as an Endpoint URL. Thanks for suggesting workaround.