How can you use Ansible with Kubernetes to automate ifrastructure deployment?

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.

Hi, parrotstone
you can for Automate config kubernetes and services used Ansible Kubernetes modules

https://docs.ansible.com/ansible/latest/collections/community/kubernetes/k8s_module.html

1 Like

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

2 Likes