Learning EKS from Kalan AWS EKS Kubernets MasterClass - vidyasekaran/current_learning GitHub Wiki

Start from Section 5: 44 refer below url https://github.com/stacksimplify/kubernetes-fundamentals/tree/master/08-ReplicaSets-with-YAML

Learning EKS with kalyan AWS EKS kubenetes masterclass

There are 3 courses from kalyan one 1. Docker fundementals 2. kubernetes fundemantal and 3. AWS EKS Kubernetes masterclass

git links:

https://github.com/stacksimplify/docker-fundamentals/

https://github.com/stacksimplify/kubernetes-fundamentals

https://github.com/vidyasekaran/aws-eks-kubernetes-masterclass

To create EKS Cluster - Refer below

https://github.com/vidyasekaran/aws-eks-kubernetes-masterclass

https://github.com/vidyasekaran/aws-eks-kubernetes-masterclass/tree/master/01-EKS-Create-Cluster-using-eksctl/01-02-Create-EKSCluster-and-NodeGroups

Steps followed in :

https://github.com/stacksimplify/docker-fundamentals/

Section 3

Essential docker commands :

https://github.com/stacksimplify/docker-fundamentals/tree/master/05-Essential-Docker-Commands

For Kubernetes :

https://github.com/stacksimplify/kubernetes-fundamentals

Currently learning : Section 3, 18 : Pull docker image from docker hub and run it locally - follow below and use AWS AnsibleDevOps box

This link basic docker commands

https://github.com/stacksimplify/docker-fundamentals

https://github.com/stacksimplify/docker-fundamentals/tree/master/03-Pull-from-DockerHub-and-Run-Docker-Images

**Tested using curl **

curl -v http://ec2-13-233-173-206.ap-south-1.compute.amazonaws.com/hello

Section 3, 19 : Build a Docker Image

https://github.com/stacksimplify/docker-fundamentals

https://github.com/stacksimplify/docker-fundamentals/tree/master/04-Build-new-Docker-Image-and-Run-and-Push-to-DockerHub

Step-1: Run the base Nginx container

Access the URL http://localhost

docker run --name mynginxdefault -p 80:80 -d nginx

docker ps

docker stop mynginxdefault

curl -v http://ec2-13-233-173-206.ap-south-1.compute.amazonaws.com

Remove a docker image

docker image rmi image_id

List and kill a docker process

docker ps -a docker stop $(docker ps -a -q) docker rm $(docker ps -a -q)

or

docker stop container_id docker rm container_id

Rename a docker image tag name

root@ip-172-31-41-166:/home/ubuntu/learn_eks/nginx-image# docker images REPOSITORY TAG IMAGE ID CREATED SIZE vidguru/mynginx_image1 v1 1fcf88b3061f 5 minutes ago 133MB nginx latest ae2feff98a0c 3 weeks ago 133MB

Now change the tag name from vidguru/mynginx_image1 to vidguru/mynginx_image1-release

docker tag vidguru/mynginx_image1:v1 vidguru/mynginx_image1:v1-release

Push the image to docker hub

docker push vidguru/mynginx_image1:v1-release

git : https://github.com/stacksimplify/kubernetes-fundamentals.git

local : D:\Udemy_aws_kubernetes_Kalyan\aws-eks-kubernetes-masterclass\03-Kubernetes-Fundamentals\kubernetes-fundamentals

Section 5 - creating frontend and backend services - for backend you create a deployment and clusterip service and for frontend

you create deployment and node port service.

ngnix image is build where backend service is pointed refer for steps : https://github.com/stacksimplify/kubernetes-fundamentals/tree/master/05-Services-with-kubectl

Section 5: Create node port service with yml

I uploaded D:\Udemy_aws_kubernetes_Kalyan\aws-eks-kubernetes-masterclass\03-Kubernetes-Fundamentals to /home/ec2-user/eks

Things done :

https://github.com/stacksimplify/kubernetes-fundamentals/tree/master/07-PODs-with-YAML

Created Simple Pod Definition using YAML

./kubectl create -f /home/ec2-user/eks/kubernetes-fundamentals/07-PODs-with-YAML/kube-manifests/02-pod-definition.yml

Created a NodePort Service

./kubectl create -f /home/ec2-user/eks/kubernetes-fundamentals/07-PODs-with-YAML/kube-manifests/03-pod-nodeport-service.yml


Sucessfully created ekscluster and setup RDS DB as external service, deployed usermgmt microservice to fetch detail from RDS return along with 2 other service and have setup ingress controller with context path routing to route request to all these services (which is application load balancer for EKS) and able to invoke and access the service.

Refer : Section 10 (EKS with ingress controller) and section Section 8 for RDS Creation.

Now need to focus on EKS devops Section 13.

User gitbash and for clone to git code commit Iam -> User-> Security Credentials (HTTPS Git credentials for AWS CodeCommit)- cred file downloaded in C:\Users\shant\Downloads\deployecs_codecommit_credentials

git clone https://deployecs-at-162622003497:bsFE7Xcon48r5JZkttAxTrpy4aK2kBwbtN6kBVSg2XU=@git-codecommit.ap-south-1.amazonaws.com/v1/repos/eks-devops-nginx

Sucessfully : setup CICD where in if code is modified - the code pipleline will trigger CI (pull code from codecommit/build docker image using Dockerfile and store it in ECR) using Deployment manifiest with nodeport service and an ingress service, build.yml docker image is pulled and deployed in worker nodes.

Things to do :

  1. setup cluster and workernode (https://github.com/vidyasekaran/aws-eks-kubernetes-masterclass/tree/master/01-EKS-Create-Cluster-using-eksctl/01-02-Create-EKSCluster-and-NodeGroups).

  2. setup codepipleline, codecommit, ecr, build and deploy (https://github.com/vidyasekaran/aws-eks-kubernetes-masterclass/blob/master/11-DevOps-with-AWS-Developer-Tools/README.md). Refer Section 13 and code is present in 11-DevOps-with-AWS-Developer-Tools

  3. hit and check

kubectl get ingress (if ingress installed - you will get 84de8e77-default-eksdevops-638f-870927650.ap-south-1.elb.amazonaws.com) http://84de8e77-default-eksdevops-638f-870927650.ap-south-1.elb.amazonaws.com/app1/index.html


  1. Installed minikube in windows 10 using choclolately

  2. Press Windows + X and select windows power shell (admin) and following https://kubernetes.io/docs/tutorials/hello-minikube/

  3. Learnt kubernetes basics from - https://kubernetes.io/docs/tutorials/kubernetes-basics/

dockerrized springboot app - https://github.com/saiachyuth5/simple-spring

https://dzone.com/articles/build-and-deploy-a-spring-boot-app-on-minikube-par https://mydeveloperplanet.com/2018/05/30/build-and-deploy-a-spring-boot-app-on-minikube-part-2/

blogs related to kubernetes deploy and code is found here https://github.com/mydeveloperplanet/mykubernetesplanet

https://octopus.com/docs/guides/deploy-java-docker-app/to-k8s/using-octopus-cloud-jenkins-builtin

Migrating from docker compose to kubernetes ————-

A conversion tool to go from Docker Compose to Kubernetes

https://kompose.io/

Install eksctl in aws DOCKER_HOST BOX

https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html#installing-eksctl

Install kubectl on Linux

https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html

Install AWS CLI

https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html

https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html

EKS Create and Delete cluster

https://github.com/vidyasekaran/aws-eks-kubernetes-masterclass/blob/master/01-EKS-Create-Cluster-using-eksctl/01-02-Create-EKSCluster-and-NodeGroups/README.md

https://github.com/vidyasekaran/aws-eks-kubernetes-masterclass/tree/master/01-EKS-Create-Cluster-using-eksctl/01-04-Delete-EKSCluster-and-NodeGroups