<p>When I try to create a pod in kubernetes with my image in my Harbor registry,I got an ErrImagePull Error, which looks like that:</p>
<pre><code>Events:
  Type     Reason     Age   From               Message
  ----     ------     ----  ----               -------
  Normal   Scheduled  10s   default-scheduler  Successfully assigned test/test-pod to ubuntu-s-2vcpu-2gb-ams3-01-slave01
  Normal   Pulling    9s    kubelet            Pulling image &quot;my.harbor.com/test/nginx:1.18.0&quot;
  Warning  Failed     9s    kubelet            Failed to pull image &quot;my.harbor.com/test/nginx:1.18.0&quot;: rpc error: code = Unknown desc = failed to pull and unpack image &quot;my.harbor.com/test/nginx:1.18.0&quot;: failed to resolve reference &quot;my.harbor.com/test/nginx:1.18.0&quot;: failed to do request: Head https://my.harbor.com/v2/test/nginx/manifests/1.18.0: x509: certificate signed by unknown authority
  Warning  Failed     9s    kubelet            Error: ErrImagePull
  Normal   BackOff    8s    kubelet            Back-off pulling image &quot;my.harbor.com/test/nginx:1.18.0&quot;
  Warning  Failed     8s    kubelet            Error: ImagePullBackOff
</code></pre>
<p>I think the crucial problem is that <code>'x509: certificate signed by unknown authority</code> but I really don't know what's wrong, since I <strong>copied my CA to both kubernetes master node and slave node</strong>, and <strong>they can both login to harbor</strong> and run <code>docker pull my.harbor.com/test/nginx:1.18.0</code> to pull the image successfully.</p>
<p>I had been bothered days for this, any reply would be grateful.</p>

<blockquote>
<p>I copied the ca.crt to /etc/docker/certs.d/my.harbor.com/</p>
</blockquote>
<p>This will make it work for the docker engine, which you've shown.</p>
<blockquote>
<p>along with my.harbor.cert and my.harbor.com.key</p>
</blockquote>
<p>I'd consider that a security violation and no longer trust the secret key for your harbor host. The private key should never need to be copied off of the host.</p>
<blockquote>
<p>and I also copied the ca.crt to /usr/local/share/ca-certificates/ and run command update-ca-certificates to update.</p>
</blockquote>
<p>That's the step that should have resolved this.</p>
<p>You can verify that you loaded the certificate with:</p>
<pre class="lang-bash prettyprint-override"><code>openssl s_client -connect my.harbor.com:443 -showcerts &lt;/dev/null
</code></pre>
<p>If the output for that doesn't include a message like <code>Verification: OK</code>, then you didn't configure the host certificates correctly and need to double check the steps for your Linux distribution. It's important to check this on each of your nodes. If you only update the manager and pull your images from a worker, that worker will still encounter TLS errors.</p>
<p>If <code>openssl</code> shows a successful verification, then check your Kubernetes node. Depending on the CRI, it could be caching old certificate data and need to be restarted to detect the change on the host.</p>
<blockquote>
<p>As for CRI, I don't know what is it</p>
</blockquote>
<p>Container Runtime Interface, part of your Kubernetes install. By default, this is <code>containerd</code> on many Kubernetes distributions. <code>containerd</code> and other CRI's (except for <code>docker-shim</code>) will not look at the docker configuration.</p>
