I rented a VPS and wanted to make an API I developed available. I decided to use containers and chose Podman to improve my familiarity with the tool and take advantage of its native integration with systemd. To achieve a satisfactory result, considering the initialization of containers at boot and the possibility of monitoring logs through journalctl, I followed these steps. I created a pod with the necessary containers and generated a Kubernetes YAML file from the pod using the command "podman generate kube xpto-pod -f /tmp/my_pod_kube.yaml". I then created a .kube file referencing the generated YAML file, which included settings for the service, such as restart policies and log drivers. I moved the file to the correct directory and reloaded the systemd daemon. Finally, I verified that the service was running using the command "systemctl status xpto-pod.service". I continue to explore ways to use Podman and its tools. I used various sources to achieve this result, including official documentation and tutorials on using Podman with systemd.
dev.to
dev.to
