🌐
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 ...
Discussions

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
🌐 discuss.kubernetes.io
1
0
June 18, 2021
Installing your Kubernetes homelab cluster in minutes with Ansible
What is the advantage compare to kubespray? More on reddit.com
🌐 r/homelab
13
65
December 12, 2022
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
🌐 r/kubernetes
19
7
February 8, 2021
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
🌐 r/Terraform
23
19
March 24, 2023
🌐
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.
🌐
buildVirtual
buildvirtual.net › home › devops › deploy a kubernetes cluster using ansible
Deploy a Kubernetes Cluster using Ansible - buildVirtual
July 12, 2021 - How to Deploy a Kubernetes Cluster using Ansible Playbooks. Learn how to install Kubernetes, initialise a new Kubernetes cluster and configure worker nodes
🌐
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
🌐
GitHub
gist.github.com › allanger › 84db2647578316f8e721f7219052788f
Deploy Kubernetes with Ansible · GitHub
$ ansible-playbook ./playbook.yaml -i hosts.yaml --tags=init · And see how Kubernetes is being installed on your nodes. To deploy your cluster you can just run · $ ansible-playbook ./playbook.yaml -i hosts.yaml · But I think that you should do it manually if it's your first time.
Find elsewhere
🌐
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 ...
🌐
Kubernetes
discuss.kubernetes.io › general discussions
How to Create a POD using Ansible and Push it Via Jenkins - General Discussions - Discuss Kubernetes
June 18, 2021 - 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 …
🌐
Medium
medium.com › @venkataramarao.n › deploy-a-simple-sample-project-in-kubernetes-using-ansbile-script-25fa0c863962
Deploy a simple sample project in kubernetes using Ansbile script | by Venkata RamaRao Nibhanupudi | Medium
November 10, 2023 - Run the Ansible playbook to deploy the application: ... This playbook reads the Kubernetes manifest files (nginx-deployment.yaml and nginx-service.yaml) and applies them to your Kubernetes cluster.
🌐
HOSTAFRICA
hostafrica.com › home › automate kubernetes cluster deployment with ansible on centos stream 8
Automate Kubernetes with Ansible - HOSTAFRICA
January 21, 2026 - For example, if you want to deploy a containerized application using Ansible, you can define a playbook with the following steps: Install the pre-requisites for Docker. Install Docker.
🌐
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%
🌐
Red Hat
developers.redhat.com › articles › 2023 › 06 › 26 › how-deploy-apps-k8s-cluster-automation-controller
How to deploy apps in a K8s cluster via automation controller | Red Hat Developer
September 21, 2023 - For the credential type (1), select Kubernetes or Kubernetes API Bearer Token. Select your organization. Enter the OpenShift or Kubernetes API Endpoint (2): Provide the endpoint of the minikube cluster to which you want to deploy the application.
🌐
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.