, ,

Demo Series: AWS EKS Terraform GitHub Actions GitOps

experts in Cloud Computing, Managed DevOps, and Kubernetes Services.

Project Overview

Demonstration of DevOps project implementation on AWS Elastic Kubernetes Service (EKS) with nearly full automation. That includes automation of infrastructure provisioning, code quality check and build, deployments via gitops methodology, monitoring, logging and alerting.

Table of Contents

Architecture Overview

  • GitHub Actions Workflows used for the iteration of Infrastructure and Application code builds
  • Terraform is used for building the complete infrastructure
  • Our Domain is registered with Cloudflare
  • AWS Route53 Public Hosted zone is created and NS mapped to Cloudflare domain
  • AWS Certificate Manager (ACM) is used to create SSL certificate for the domain name and signed by DNS method (record added Route53 hosted zone)
  • EKS Cluster and worker node groups in private subnet provisioned with Kubernetes version 1.27.
  • AWS Load Balancer Controller configured to provision AWS Application Load Balancer (ALB) with wildcard mapping as targeted to EKS Private Node groups
  • Nginx Ingress Controller configured to handle any routes such as host , path based from the eks cluster resource
  • External DNS Controller configured to add the AWS ALB DNS to Route53 recordset. Filtered only to scan AWS LB Controller ingress resources.
  • GitHub Actions Controller configured to add Self-Hosted Runners to code/application and tools github repositories
  • ArgoCD configured to handle the application and tools deployment
  • IAM Role Based Service Account (IRSA) are configured to allow the Kubernetes resources access, manage AWS Resources
  • Role Based Access Controls (RBAC) are used to manage the access to the users to connect to Kubernetes API via cli or any ide
  • Infrastructure code scans are carried out by TFlint, TFSec, Checkov through GitHub Actions using managed runners
  • Application code scan and builds by Sonarqube, Trivy and Docker through GitHub Actions using Self-hosted runners
  • Prometheus, Grafana, Elastic Fluentd Kibana Stacks as the part of traceability solution are configured in the cluster
  • Slack integration for notification from GitHub Actions, traceability tools
  • Community and Custom Helm Charts are used for deploying controllers, application and tools manifests to the cluster

Phase 1: Network Resources

  1. Building GitHub Workflows to scan Terraform Code with TFLint, TFSec and Checkov
  2. Terraform AWS Provider and AWS network resources such as VPC, Routes, Route Tables, Subnets, Route53, Cloudflare, SSL, etc
  3. Terraform deployment post review and manual approval from GitHub

 

experts in Cloud Computing, Managed DevOps, and Kubernetes Services.

Phase 2: Cluster Setup

  1. Create EKS Cluster, Node Groups
  2. Create OIDC provider, IAM roles
  3. Kubectl config to validate the nodes and Kubernetes default resources

Phase 3: Authentication & Authorization

  1. Create IAM Roles, Groups for the user, developers
  2. Create cluster role, cluster role binding, role, role binding for specific namespaces
  3. Update aws-auth for the roles
  4. Kubectl api call to validate the access policies defined
experts in Cloud Computing, Managed DevOps, and Kubernetes Services.

Phase 4: Ingress, DNS Controllers

  1. Create AWS Load Balancer Ingress Controller
  2. Create Nginx Ingress Controller
  3. Create External DNS Controller
  4. Create Ingress resource to provision AWS Application LoadBalancer with record sets on Route53 Hosted Zone

Phase 5: GitHub EKS Self-Hosted Runners

  1. Create GitHub Actions Runners Scale Set Controller
  2. Create GitHub Runners and associate with code/tool github repositories
  3. Review the Runner and Runner Group in GitHub Actions

 

experts in Cloud Computing, Managed DevOps, and Kubernetes Services.

Phase 6: CI CD Process for Application Code

  1. GitHub Self Hosted Runners are used for the Application build from GitHub Actions Workflows
  2. Sonarqube, Trivy Scan are implemented in Application code build phase
  3. Post successful, scan the application code is built and push to AWS Elastic Container Registry (ECR)
  4. Update the Code manifest repo with new build details
  5. GitOps Workflows with ArgoCD, verify Application code continuous deployment

Phase 7: Traceability Solution

  1. Create Prometheus , Grafana for monitoring and alerting
  2. Create Elastic FluentD Kibana Stack for logging
  3. Integrate Slack for notification
experts in Cloud Computing, Managed DevOps, and Kubernetes Services.

Next Steps

Thanks for your attention and patience to read this article. 

Next step is to setup GitHub Actions, Terraform and AWS Network resources, follow them on 

Phase 1 :  Network Resources

Demo Series: EKS TF GHA GitOps : Phase 1 – Network Setup

Happing reading !!! Let us learn together !!!

Author

  • Prabhu RP

    Lead DevOps | Cloud Associate Solution Architect |...

Leave a Reply

Your email address will not be published. Required fields are marked *

Related post