← Back to context

Comment by pianopatrick

2 days ago

I've been reading and watching videos about how you can use Ansible with Podman as a simpler alternative to Kubernetes. Basically Ansible just SSHs into each server and uses podman to start up the various pods / containers etc. that you specify. I have not tried this yet though so take this idea with a grain of salt.

whew, "alternative" is doing a lot of work there.

Contrast:

  ansible -i server1,server2,server3 deploy_fake_pods.yaml
  ssh server1 sudo shutdown -h now
  # aww, too bad, now your pods on server1 are no longer

With

  kubectl apply -f deployment.yaml
  for i in $(kubectl get nodes -o jsonpath='{.status.hostIP}'); do
    ssh $i sudo shutdown -h now
    sleep 120
  done
  # nothing has changed except you have fresh Nodes

If you don't happen to have a cluster autoscaler available, feel free to replace the for loop with |head -1 or a break, but I mean to point out that the overall health and availability of the system is managed by kubernetes, but ansible is not that