macroblog.rs @ 6a31a30b98f7febe9ac0db74211ef074aefc7ad3

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