1<section>
2 <p>
3 This is based on <a
4 href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/">Log in to
5 Docker Hub</a>. It is just a bit different to use podman.
6 </p>
7 <p>
8 First we should take a look at podman-login man page:
9<pre><code>man podman login</code></pre>
10 </p>
11 <p>
12 It will give some valueable information like the location of auth.json file. Now we can login using podman:
13<pre><code>podman login registry.gitlab.com</code></pre>
14 </p>
15 <p>Then check the <code>auth.json</code> file located at <code>${XDG_RUNTIME_DIR}/containers/auth.json</code> (as described
16 by the manual). It will contain your auth config:
17<pre><code>{
18 "auths": {
19 "registry.gitlab.com": {
20 "auth": "..."
21 }
22 }
23}</code></pre>
24 </p>
25 <p>
26 Now copy that file over to the server and register it in k8s with the following command:
27<pre><code>
28kubectl create secret generic regcred \
29 --from-file=.dockerconfigjson=auth.json \
30 --type=kubernetes.io/dockerconfigjson</code></pre>
31 </p>
32 <p>
33 Once you have created you can list by kubectl get secret:
34<pre><code>
35NAME TYPE DATA AGE
36regcred kubernetes.io/dockerconfigjson 1 53s</code></pre>
37 </p>
38</section>