Skip to content

nicoghezzi/automate-k8-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Kubernetes Deployment Automation: Ansible → EKS

Orchestration: Kubernetes Automation: Ansible Infrastructure: Terraform Cloud: AWS CLI: kubectl

Automated Kubernetes deployments on Amazon EKS using Ansible, demonstrating infrastructure-as-code and cloud-native automation workflows.


📌 Overview

This project showcases an end-to-end Kubernetes automation setup:

  • Provisioned an EKS cluster using Terraform
  • Configured Ansible for local and remote execution
  • Deployed a Kubernetes namespace (my-app) via playbooks
  • Verified cluster connectivity and deployment using kubectl
  • Deployed an NGINX application to the cluster

⚙️ Workflow

1. Infrastructure Provisioning

  • Created EKS cluster using Terraform
  • Configured networking and cluster access

2. Ansible Configuration

  • Set up inventory for local and remote hosts
  • Enabled Ansible to interact with Kubernetes cluster

3. Kubernetes Deployment

  • Executed Ansible playbook to create namespace (my-app)
  • Applied Kubernetes resources to cluster

4. Validation

  • Verified namespace creation using kubectl
  • Confirmed application deployment (NGINX)

🧰 Tech Stack

  • AWS EKS (Managed Kubernetes)
  • Terraform (Infrastructure as Code)
  • Ansible (Automation & Orchestration)
  • kubectl (Kubernetes CLI)
  • DigitalOcean (Optional test hosts)

💡 Key Skills Demonstrated

  • Writing Ansible playbooks for Kubernetes resources
  • Managing kubeconfig and EKS cluster access
  • Automating Kubernetes deployments
  • Understanding cloud networking and API access patterns
  • Integrating Terraform and Ansible workflows

⚠️ Challenges & Fixes

  • EKS connectivity issues → Resolved private vs public API endpoint access
  • SSH host key verification → Managed known_hosts for remote connections
  • YAML parsing errors → Fixed formatting issues in Ansible playbooks

✅ Outcome

  • ✔ Automated creation of Kubernetes namespace (my-app)
  • ✔ Verified deployment directly in EKS cluster
  • ✔ Successfully deployed NGINX application
  • ✔ Established repeatable Kubernetes deployment workflow

🧪 Takeaway

This project demonstrates how to automate Kubernetes deployments using Ansible on top of Terraform-provisioned infrastructure. It highlights real-world challenges in cluster connectivity, configuration management, and YAML-based automation—while reinforcing best practices for reliable cloud-native deployments.

Steps

Step 1: Create Kubernetes Cluster using Terraform Lighthouse Report

Step 2: Review EC2 instance Lighthouse Report

Step 3: Verification of Cluster in AWS Console Lighthouse Report

Step 4: Create a K8 Namespace Lighthouse Report

Step 5: Check Cluster over Terminal Lighthouse Report

Step 6: Check K8 Namespace over Terminal Lighthouse Report

Step 7: Execute Playbook to deploy nginx application Lighthouse Report

Step 8: Check K8 pod Lighthouse Report

Step 9: Check Service Lighthouse Report

Step 10: Access Nginx App via browser. Lighthouse Report

About

Automated deployment of a Kubernetes namespace to an AWS EKS cluster using Ansible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors