# K3s ### Import image into containerd #### Offline On a host where one can pull the image: ``` podman save -o .tar : gzip .tar ``` Copy the file to target host(s) and then run: ``` zcat .tar.gz | /usr/local/bin/k3s ctr images import - ``` #### Online ``` crictl pull : ``` If one needs to supply credentials for the registry, use: ``` --auth AUTH_STRING Use AUTH_STRING for accessing the registry. AUTH_STRING is a base64 encoded 'USERNAME[:PASSWORD]' [$CRICTL_AUTH] --creds USERNAME[:PASSWORD] Use USERNAME[:PASSWORD] for accessing the registry [$CRICTL_CREDS] --username USERNAME, -u USERNAME Use USERNAME for accessing the registry. The password will be requested on the command line ``` `-u` is most secure, as the password is not supplied on the command line. ### Access shell of container with root rights (uid 0) Get container ID in the running pod: ``` kubectl -n hydra get pod -o jsonpath="{.status.containerStatuses[].containerID}" | sed 's,.*//,,'; echo '' k3s ctr task exec -t --exec-id --user root bash ```