
Welcome to the course "Kubernetes on AWS EKS: hands-on get started" for Developers and DevOps Engineers
In order to get the best out of this course, one should have some basic knowledge of Docker and web development & deployment concepts.
One of the challenges for DevOps professionals or any developers is to have a consistent and efficient local development environment setup. For the practice part of this course, one should have a few different CLI tools installed.
There are a few different options:
Install everything in your workstation / machine that has any OS - Windows, Linux or macOS
Using Docker Image with all the tools installed. Here is one version that I have used for the most part in the course. CloudCLI: https://hub.docker.com/r/devteds/cloudcli
My current preferred option is using Docker and "Dev Containers". Here is a short video tutorial that I suggest you check out: https://www.devteds.com/devops-local-setup-with-docker-and-devcontainers-vscode/
Request
The course materials, including the source code provided, are for your personal learning and practice only. It is strictly prohibited to publicly share or upload the course content, including the source code, on GitHub or any other public platform. This includes but is not limited to creating public repositories, forks, or sharing code snippets in public forums.
Respecting the intellectual property rights of others is crucial, and the unauthorized distribution of course materials is a violation of those rights. Additionally, it undermines the value of the course for other learners who have invested their time and resources to enroll.
If you have any questions about the appropriate usage of the course materials or source code, please feel free to reach out to me directly through the Udemy platform.
Thank you for your understanding and cooperation.
How to use the code?
As you move forward in the course, after each lecture, check if there are any code or command-line instructions discussed. To get the code, simply download the attached source code (it's in a zip file) provided for that particular lesson.
Once you have the code, you can update your own version using it. But here's the key: avoid just copying the code without understanding it. It's better to try writing it yourself and then compare it to the given source code.
Keep in mind, some of the code and commands might not match exactly with what you saw in the video lesson. This happens because technologies like AWS and Terraform evolve rapidly. So, don't worry if things look a bit different. Just focus on grasping the concepts.
For more accurate and current command-line instructions, make sure to refer to the README file within the source code of each lesson. This will help you review the source code and understand the most up-to-date commands to use.
Explore the basics of a virtual private cloud in aws, including public and private subnets, internet gateways, and routing, to securely host ec2, rds, and other resources across availability zones.
Configure the AWS CLI by creating an IAM user, setting up access keys, and verifying with EKS and S3 commands, then provision a VPC and Kubernetes environment with Terraform.
Create an aws vpc with terraform code, using a vpc module from the registry to configure subnets and outputs for kubernetes on eks.
Explore a VPC with public, private, and intra subnets for EKS Kubernetes cluster; control plane is managed by EKS and workers in public subnets connect to load balancer and RDS.
Tips:
If running terraform init command fails with errors like "Error: Failed to query available provider packages", try with "-upgrade" option. The command will be "terraform init -upgrade"
Deploy a minimal microservices storefront to Kubernetes, featuring a static site, a shopping UI SPA, a shopping API, and a relational database, illustrating component wiring and traffic routing.
Explore the basic Kubernetes concepts, including the control plane and workers, and learn how to define deployments and pods with YAML manifests to run containers on AWS EKS.
Run a static website locally with Docker Compose using an Nginx image, mapping container port 80 to localhost 8080, to understand configurations before deploying to Kubernetes on AWS EKS.
Deploy a static website to Kubernetes by creating deployment and service configurations for an nginx pod set with replicas. Use kubectl apply and port-forward to access localhost:8082.
Learn to run a shopping API locally with Docker Compose, a Ruby on Rails backend using MySQL, configure environment variables, perform migrations, and seed data before Kubernetes deployment.
Learn to provision an AWS RDS MySQL instance with Terraform, including VPC subnets and security group setup, make it publicly accessible, and retrieve the connection address for the bookstore database.
Deploy the shop API to Kubernetes on AWS EKS, configure deployment and service, and run db migrate and db seed jobs against Amazon RDS MySQL, testing via port forward.
Expose two Kubernetes services behind a single domain using an external load balancer and nginx ingress, routing /api to shop API and root to website.
Install the nginx ingress controller on an AWS EKS cluster using a GitHub YAML file and kubectl. Learn to manage namespaces, pods, services, and ingress routing with a load balancer.
Configure the website ingress to route requests from the load balancer to the website service on port 80, using nginx ingress controller and a yaml manifest.
Configure a new ingress rule to route api/books requests to the Shop API on port 3000, with other paths falling back to the website service via the Nginx ingress controller.
Deploy the shop UI as a Kubernetes deployment with a service and ingress at /shop, and have it call /api/books on the shop API through load balancer and same domain.
Create and apply a Kubernetes ConfigMap to centralize runtime configurations for the shop API, then reference it in deployment and job manifests to replace hardcoded env vars.
Learn to store confidential app configurations as Kubernetes secrets separate from config maps. Inject them using a secret key reference in deployments, with Base64 encoded data retrievable via kubectl.
Learn to migrate app images from public Docker Hub to private registries such as AWS ECR, authenticate, and configure Kubernetes imagePullSecrets for private access.
Deploy Kubernetes on AWS EKS by building a VPC with Terraform, provisioning a cluster, and deploying three microservices with an RDS MySQL backend and Nginx ingress.
Tools & Software used
Kubernetes: Amazon EKS (Cluster version = 1.21)
Docker: Docker For Desktop (Mac); Version 4.3.2; Docker Engine 20.10.x; Docker Compose 1.29.2;
AWS CLI: 1.19.1; Python 3.9.2
Kubectl: 1.23
Terraform: 1.8.2
Devteds CloudCLI (Container Shell): Docker image version 1.0.3 (devteds/cloudcli:1.0.3)
VSCode (code editor)
I used the CloudCLI tool that I built and the tool that I use pretty much for all my CLI requirements but you don't need to use CloudCLI instead install tools individually as needed.
Whether you use CloudCLI or install the tools on your machine, you will need Docker and Docker Compose installed.
If you would like to try using CloudCLI, the following links should help you get started,
Docker Image: https://hub.docker.com/r/devteds/cloudcli. See the installation instructions on the docker hub page.
Source code (if you know Docker and want to customize it for your needs): https://github.com/devteds/cloudcli
If you don't use the CloudCLI container shell and if you're installing tools on Ubuntu/Debian, the installation scripts on the Dockerfile might be useful to you.
You will find many of my source code on GitHub (https://github.com/devteds) and blog posts in the Cloud, Platform, and Applications Engineering on https://www.devteds.com
This course is designed for developers, DevOps engineers, and cloud professionals who want to quickly gain practical Kubernetes skills. We'll take a streamlined, hands-on approach to mastering essential infrastructure and Kubernetes concepts, coding your infrastructure with Terraform, and deploying real-world applications on Amazon EKS, the leading managed Kubernetes service.
Concise Course Overview:
AWS EKS Fundamentals & Terraform: Understand the core components of AWS infrastructure needed for Kubernetes and learn to define and manage it with Terraform. We'll also introduce the microservices-based project you'll be building throughout the course.
Infrastructure as Code with Terraform: Learn how to use Terraform to create and manage your AWS Virtual Private Cloud (VPC), the foundation for your EKS cluster.
EKS Cluster Deployment with Terraform: Provision and configure your Kubernetes cluster on EKS, using Terraform to automate the process.
Containerize and Deploy a Static Website: Package a basic website into a Docker container, test it, and deploy it to your Kubernetes cluster.
Database Integration with RDS and Terraform: Use Terraform to set up an RDS MySQL database and connect it to your application running in Kubernetes.
Deploy an API Application: Containerize and deploy a more complex API application that interacts with your RDS database.
Traffic Management: Learn to control and direct traffic to your applications using Amazon Load Balancer and Kubernetes Ingress.
Kubernetes Configuration: Explore ConfigMaps and Secrets for managing application configurations and sensitive data.
Private Container Registries: Securely store and manage your Docker images in private registries, such as AWS ECR.
By the end of this course, you'll be equipped to build, deploy, and manage containerized applications on Kubernetes using AWS EKS, while also gaining valuable skills in cloud infrastructure automation with Terraform.