Hah. I'm a huge kubernetes fan but not sure I can agree here.
k8s yaml files are the most verbose and spammy things imaginable.
granted, ansible playbooks can be horrific, but i'd say that's more down to the authors of the playbook than ansible itself.
K8s is designed around a desired state of the world with control loops.
The two are very different conceptually, and lead you in different directions organizationally.
Ansible encourages you to code the derivative and hopefully approach the integral, whereas K8s encourages you to code the integral and infer the derivative in your controller, if that makes sense.
Kubernetes resource definitions are verbose, but you can expect them to always be about that verbose and nothing else.
Ansible playbook instead really depend on the author, they can both be works of art or abominations.
It's more of an issue with your organization's (or in some cases, personal) process if you allow abysmal code to get checked into your codebase :) Even Ansible has easy to integrate linting and testing tools.
I always preferred ansibles to kubernetes yaml
I'm using both daily and can work with either though
If someone is authoring Ansible playbooks this way, this is definitely not a best practice. Code should go into modules, plugins, filters, etc. Playbooks should be YAML, with extremely minimal use of any coding constructs.
Do kubernetes files really concern themselves with little details such as how a database or application is configured ?
I assumed that kubernetes is more about having 'images' of pre-installed machines (e.g via ansible) and having kubernetes just 'clone' them into production and interconnect them.
However, those images typically will be unconfigured aside from sane defaults. The final configuration (connecting an application to a database, etc) is indeed handled through Kubernetes.
The one pain point, for me, is still the development workflow, which is still lacking compared with told like docker-compose.
However, skaffold seems to be quickly closing that gap and I'm pretty excited about it.
We're not on production yet, but moving soon.