<p>I have a private docker image repository, that needs SSL certificates in order to be accessible.
Now I have tried creating multiple kubernetes secrets (containing docker host-name, username and pass and certificates) so I can fetch images with kubernetes from it, but it is still failing because of the missing certificates &quot;Failed to pull image .... remote error: tls: handshake failure&quot;. So is there a specific way one need to apply SSL certificates in order to be able to pull images from private repository that requires SSL certificates.</p>
<p>I have tried</p>
<pre><code>kubectl create secret docker-registry repo-auth --docker-server=xxxxx --docker-username=xxxxxx --docker-password=xxxx

kubectl create secret tls repo-tls --cert=/xxxx/client.cert --key=/xxxx/client.key&quot;

kubectl create secret generic regcred2 --from-file=/xxxx/client.key --from-file=/xxxx/client.cert&quot;

kubectl create secret generic regcred --from-file=.dockerconfigjson=/root/.docker/config.json --type=kubernetes.io/dockerconfigjson --from-file=/xxxx/client.key --from-file=/xxxx/client.cert&quot;

imagePullSecrets:
    - name: repo-tls
    - name: repo-auth
    - name: regcred
    - name: regcred2
</code></pre>
<p>but the error still remains</p>
<p>PS I am using k3s</p>

spejic88
<p>You problem seems like an issue with fetching images from private-docker-registry.</p>
<p>You can perform the following steps to use an ssl certificate for authenticating your pull-request for fetching images form a docker registry:</p>
<ol>
<li><p>You need to store your ssl certificate in a kubernetes secret. (Refer: <a href="https://www.padok.fr/en/blog/kubernetes-secrets" rel="nofollow noreferrer">https://www.padok.fr/en/blog/kubernetes-secrets</a>)
You can use following command to create a secret from ssl file:</p>
<p><code>kubectl create secret generic ssl-key-cert --from-file=ssl.key --from-file ssl.cert</code></p>
</li>
<li><p>Update the pod yaml with imagePullSecret attribute and provide the 'secret-name' created in first step as the value to this attribute. (Refer:https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)</p>
</li>
</ol>
