For kubernetes, you can use minikube and run a cluster on your own machine.
From a brief look at the docs, you could use terraform to manage your minikube cluster: https://registry.terraform.io/providers/hashicorp/kubernetes...
For ansible, I'd just use a free ec2 instance or similar.
For a specific application, the php guestbook app is a good place to start, but my guess is all the tutorials are pretty good: https://kubernetes.io/docs/tutorials/
Check out Jeff Geerling’s YouTube videos and his Ansible book, which is the de facto bible.