I’m new to DevOps in general and would like to know how I can use Ansible with Kubernetes to deploy a web api? Like, what parts of the deployment would be Ansible useful at.
you can for Automate config kubernetes and services used Ansible Kubernetes modules
To be honest, while you can use ansible to spin stuff up in kubernetes, its not as well suited to it as other tools (e.g. helm, skaffold, or kustomize). You’re essentially using yaml to describe yaml and unless you have to inject some information from common ansible vars I’d look into pursuing other routes.
Before diving into any of that though, if you haven’t yet - you’ll want to be quite familiar with Kubernetes itself. A good starting point is to run through some of the exercises on katacoda, if you want a hands on approach - otherwise you can dive into the docs on kubernetes.io