OneUptime
oneuptime.com › home › blog › how to use ansible to deploy kubernetes deployments
How to Use Ansible to Deploy Kubernetes Deployments
February 21, 2026 - ... The Deployment is the most commonly used Kubernetes workload resource. It manages a set of identical pods, handles rolling updates when you change the pod template, and automatically replaces pods that fail.
Opensource.com
opensource.com › article › 20 › 9 › ansible-modules-kubernetes
Automate your container orchestration with Ansible modules for Kubernetes | Opensource.com
As more development and deployments move to the cloud, it's important to understand how to automate the important aspects of your cloud. The k8s and podman_image modules are only two examples of modules related to Kubernetes and a mere fraction of modules developed for the cloud. Take a look at your workflow, find the tasks you want to track and automate, and see how Ansible ...
How to Create a POD using Ansible and Push it Via Jenkins
Hi All, Please be informed that, i am tying to create a POD and Namespace in Kubernetes via Ansible Playbook and push it from Jenkins. I have wrote the yaml playbook and it is working fine if i run it from the Ansible server, but when i push it via jenkins getting an error. More on discuss.kubernetes.io
Installing your Kubernetes homelab cluster in minutes with Ansible
What is the advantage compare to kubespray? More on reddit.com
Terraform or Ansible for Kubernetes deployment
I think, Terraform is for provisioning resource (VM /Disk / Network). Ansible is for configuration management. Terraform can bootstrap ansible script. More on reddit.com
To terraform or not to terraform kubernetes resources?
Avoid using Terraform to manage resources inside the cluster - use tools that are purpose built for this (ArgoCD, FluxCD, etc.) More on reddit.com
Videos
25:46
Automate Kubernetes Workloads with Ansible Easy deployment, ...
41:02
Kubernetes Automation on OpenStack Using Ansible - YouTube
14:33
Create Kubernetes Cluster using Ansible Playbook Automation | Install ...
Automate Your Entire K8s Cluster Deployment with One ...
41:12
Easy Kubernetes Using Ansible! (RKE2) - YouTube
Building a Highly Available Kubernetes Cluster with Ansible - YouTube
Spacelift
spacelift.io › blog › ansible-kubernetes
How to Manage Kubernetes with Ansible [Tutorial]
October 10, 2025 - As one old pod goes down, a new pod with the preferred image goes up, which ensures minimal downtime and a smooth transition between old and new versions of your application. --- - name: Execute a Rolling update for a K8S deployment hosts: proxy_servers tasks: - name: Update Kubernetes deployment kubernetes.core.k8s: state: present definition: kind: Deployment name: app-deployment namespace: my-namespace spec: template: spec: containers: - name: my-app-container image: nginx:latest register: update_result - name: Wait for rolling update to complete kubernetes.core.k8s_info: kind: Deployment name: app-deployment namespace: my-namespace register: deployment_info until: deployment_info.resources[0].status.updatedReplicas == deployment_info.resources[0].status.replicas retries: 60 delay: 10 - name: Display update result debug: msg: "Rolling update completed successfully"
Adam the Automator
adamtheautomator.com › ansible-kubernetes
How to Use the Ansible Kubernetes Module
apiVersion: apps/v1 kind: Deployment Namespace: ata-namespace metadata: # Deployment metadata name: nginx-deployment # Name of the deployment labels: app: nginx # Declaring the deployments labels. spec: replicas: 3 # Declaring the number of Pods required selector: matchLabels: app: nginx # Pods will be launched if matches deployment Label. template: metadata: labels: app: nginx # Labels of the Pods. spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 · 4. Finally, create one more file named main.yml in the ~/ansible_k8s_module_demo directory and copy/paste the following YAML playbook contents. The playbook below contains multiple tasks to create and manage the Kubernetes objects on the remote machine hosting the Kubernetes cluster.
Published June 4, 2023
Medium
shashwotrisal.medium.com › kubernetes-with-ansible-881f32b8c53e
Kubernetes With Ansible - Shashwot Risal - Medium
February 5, 2022 - $ mkdir playbooks$ cd playbooks$ cat <<EOF > kubernetes.yaml --- - hosts: '{{ host }}' tasks: - name: "Install kubernetes python package" #This will be installed on the remote host. pip: name: kubernetes state: present# Create a test namespace on the cluster without any manifest fies. This is an added advantage on ansible. - name: "Create a k8s namespace" k8s: name: test api_version: v1 kind: Namespace state: present# Copying the Pod.yaml and deployment.yaml in the remote node.
Ansible
docs.ansible.com › projects › ansible › 4 › scenario_guides › kubernetes_scenarios › scenario_k8s_object.html
Creating K8S object — Ansible Documentation
January 20, 2022 - --- - hosts: localhost collections: - kubernetes.core tasks: - name: Create a pod k8s: state: present definition: apiVersion: v1 kind: Pod metadata: name: "utilitypod-1" namespace: default labels: app: galaxy spec: containers: - name: utilitypod image: busybox
Kubernetes
kubernetes.io › blog › 2019 › 03 › 15 › kubernetes-setup-using-ansible-and-vagrant
Kubernetes Setup Using Ansible and Vagrant | Kubernetes
January 3, 2026 - Ansible should be installed in your machine.
Ansible
docs.ansible.com › ansible › latest › collections › kubernetes › core › k8s_module.html
kubernetes.core.k8s module – Manage Kubernetes (K8s) objects — Ansible Community Documentation
In this case, the definition file ... v1 kind: Pod spec: containers: - name: py image: python:3.7-alpine imagePullPolicy: IfNotPresent # Server side apply - name: Create configmap using server side apply kubernetes.core.k8s: namespace: testing definition: apiVersion: v1 kind: ConfigMap metadata: name: my-configmap apply: yes server_side_apply: field_manager: ansible # Delete all Deployment from specified ...
Medium
akpolatcem.medium.com › building-a-production-ready-kubernetes-cluster-with-ansible-from-zero-to-running-in-30-minutes-a09f34deb671
Building a Production-Ready Kubernetes Cluster with Ansible: From Zero to Running in 30 Minutes | by ca | Medium
August 4, 2025 - The kube-proxy handles network ... pod-to-pod networking across the cluster. To understand better what Ansible code does, instead of adding the code here, I decided to place the sequence diagram of the steps, so that we can clearly see how the interaction occurs between the ansible code and the remote virtual machine. To deploy the kubernetes, three roles ...
Ansible
docs.ansible.com › projects › ansible › latest › collections › kubernetes › core › docsite › kubernetes_scenarios › k8s_intro.html
Introduction to Ansible for Kubernetes — Ansible Community Documentation
The kubernetes.core collection offers several modules and plugins for orchestrating Kubernetes.
Kubeclusters
kubeclusters.com › docs › How-to-Deploy-a-Single-Master-Kubernetes-Cluster-with-Ansible
How to Deploy a single master Kubernetes cluster with Ansible | Kube Clusters Documentation
# cd /etc/ansible # ansible-playbook deploy.yml · Check Kubernetes version · # kubectl version · # Check the status of Kubernetes components · kubectl get componentstatus · Check the worker node status · # kubectl get node · Check the status of all the pods ·
GitHub
github.com › kubernetes-sigs › kubespray
GitHub - kubernetes-sigs/kubespray: Deploy a Production Ready Kubernetes Cluster · GitHub
March 12, 2026 - The cri-o version should be aligned with the respective kubernetes version (i.e. kube_version=1.20.x, crio_version=1.20) ... Ansible v2.14+, Jinja 2.11+ and python-netaddr is installed on the machine that will run Ansible commands · The target servers must have access to the Internet in order to pull docker images. Otherwise, additional configuration is required (See Offline Environment) The target servers are configured to allow IPv4 forwarding. If using IPv6 for pods ...
Starred by 18.4K users
Forked by 6.9K users
Languages Jinja 81.8% | HCL 11.6% | Python 3.3% | Shell 2.5% | Dockerfile 0.3% | Go Template 0.2%
GitHub
github.com › geerlingguy › ansible-for-kubernetes
GitHub - geerlingguy/ansible-for-kubernetes: Ansible and Kubernetes examples from Ansible for Kubernetes Book · GitHub
This repository contains Ansible and Kubernetes examples developed to support different sections of Ansible for Kubernetes by Jeff Geerling.
Starred by 731 users
Forked by 318 users
Languages Shell 80.0% | Go 13.0% | Ruby 4.5% | Dockerfile 2.5%
Medium
medium.com › @fenari.kostem › effortless-kubernetes-deployment-setting-up-a-cluster-with-ansible-and-kubeadm-cc40f9e716f4
Effortless Kubernetes Deployment: Setting Up a Cluster with Ansible and kubeadm | by Bora Köstem | Medium
November 8, 2024 - Together, these configurations enable a consistent, repeatable setup of a Kubernetes control plane, providing the essential network, control plane, and node configurations needed for a stable cluster. Using Ansible to dynamically inject the ansible_host variable allows flexibility in deployment across different hosts.