<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akshay Jadhav</title>
    <description>The latest articles on DEV Community by Akshay Jadhav (@akshay_jadhav).</description>
    <link>https://dev.to/akshay_jadhav</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1857627%2Fbc3e422b-55c4-4efc-9074-087d06a565e5.jpg</url>
      <title>DEV Community: Akshay Jadhav</title>
      <link>https://dev.to/akshay_jadhav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akshay_jadhav"/>
    <language>en</language>
    <item>
      <title>Akshay JadhavDevOps Insights with Akshay Jadhav</title>
      <dc:creator>Akshay Jadhav</dc:creator>
      <pubDate>Mon, 29 Jul 2024 17:08:08 +0000</pubDate>
      <link>https://dev.to/akshay_jadhav/akshay-jadhavdevops-insights-with-akshay-jadhav-2adn</link>
      <guid>https://dev.to/akshay_jadhav/akshay-jadhavdevops-insights-with-akshay-jadhav-2adn</guid>
      <description>&lt;p&gt;Github: &lt;a href="https://github.com/git-akshay-jadhav/tetris-game.git" rel="noopener noreferrer"&gt;https://github.com/git-akshay-jadhav/tetris-game.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to an electrifying journey where we delve into the dynamic realm of GitOps, all while gearing up for an unforgettable dive into one of gaming's most timeless and captivating experiences: Tetris!&lt;/p&gt;

&lt;p&gt;In this blog, we'll demystify the intricacies of GitOps, unveiling its transformative capabilities, all while immersing ourselves in the exhilarating world of Kubernetes deployed on Amazon's Elastic Kubernetes Service (EKS).&lt;/p&gt;

&lt;p&gt;Strap in tight, as we embark on a riveting escapade that not only acquaints you with the wonders of GitOps but also offers you the chance to relish the nostalgic thrill of Tetris on a Kubernetes platform.&lt;/p&gt;

&lt;p&gt;So, let's dive in and witness the thrilling collision of DevOps and gaming in this epic adventure!&lt;/p&gt;

&lt;p&gt;STEP 1: Create IAM Roles&lt;br&gt;
Let’s First start creating two IAM roles one is for Cluster and another is for Nodegroup&lt;/p&gt;

&lt;p&gt;Go to Aws console and search for IAM&lt;/p&gt;

&lt;p&gt;You will be redirected to the IAM dashboard&lt;/p&gt;

&lt;p&gt;Click “Roles”&lt;/p&gt;

&lt;p&gt;Click “Create role”&lt;/p&gt;

&lt;p&gt;Click “Allow AWS services like EC2, Lambda, or others to perform actions in this account.”&lt;/p&gt;

&lt;p&gt;Click “Choose a service or use case”&lt;/p&gt;

&lt;p&gt;Type “EKS”&lt;/p&gt;

&lt;p&gt;Click this radio button with EKS-Cluster&lt;/p&gt;

&lt;p&gt;Click “Next” and you will directly redirect to policy and click Next ( we have only one policy for it and it selects by default for EKS) that is AmazonEKSClusterPolicy&lt;/p&gt;

&lt;p&gt;Click the “Role name” field and provide the name (myAmazonEKSClusterRole)&lt;/p&gt;

&lt;p&gt;Click “Create role”&lt;/p&gt;

&lt;p&gt;A cluster role is created.&lt;/p&gt;

&lt;p&gt;Now Create a Role for NodeGroup&lt;/p&gt;

&lt;p&gt;Click “Create role”&lt;/p&gt;

&lt;p&gt;Click “Allow AWS services like EC2, Lambda, or others to perform actions in this account.”&lt;/p&gt;

&lt;p&gt;Click “Choose a service or use case”&lt;/p&gt;

&lt;p&gt;Click “EC2”&lt;/p&gt;

&lt;p&gt;Click “Next”&lt;/p&gt;

&lt;p&gt;Click the “Search” field.&lt;/p&gt;

&lt;p&gt;Search these Policy Names and make it check (I already have these in it )&lt;/p&gt;

&lt;p&gt;AmazonEC2ContainerRegistryReadOnly&lt;/p&gt;

&lt;p&gt;AmazonEKS_CNI_Policy&lt;/p&gt;

&lt;p&gt;AmazonEBSCSIDriverPolicy&lt;/p&gt;

&lt;p&gt;AmazonEKSWorkerNodePolicy&lt;/p&gt;

&lt;p&gt;Click “Next”&lt;/p&gt;

&lt;p&gt;Click the “Role name” field.&lt;/p&gt;

&lt;p&gt;Add Role name as myAmazonNodeGroupPolicy&lt;/p&gt;

&lt;p&gt;Click “Create role”&lt;/p&gt;

&lt;p&gt;NodeGroup Role is created.&lt;/p&gt;

&lt;p&gt;Step 2: Create EKS Cluster&lt;br&gt;
Click the “Search” field and search For EKS or select directly Elastic Kubernetes Service on the Recently visited tab&lt;/p&gt;

&lt;p&gt;Click “Add cluster”&lt;/p&gt;

&lt;p&gt;Click “Create”&lt;/p&gt;

&lt;p&gt;Click the “Name” field and enter a unique name for the cluster that is anything you want. For example, I used Cloud and version 1.28&lt;/p&gt;

&lt;p&gt;Click “myEKSClusterRole” which is created in step 1.&lt;/p&gt;

&lt;p&gt;Click “Next”&lt;/p&gt;

&lt;p&gt;Click “Select security groups” and Use the existing security group or create a new security Group&lt;/p&gt;

&lt;p&gt;Click “Next”&lt;/p&gt;

&lt;p&gt;Click “Next”&lt;/p&gt;

&lt;p&gt;No changes Click “Next” (Default no need to change anything)&lt;/p&gt;

&lt;p&gt;No changes Click “Next” (Default no need to change anything)&lt;/p&gt;

&lt;p&gt;Click “Create”&lt;/p&gt;

&lt;p&gt;It takes 15 minutes to create.&lt;/p&gt;

&lt;p&gt;Once your Cluster up to active status&lt;/p&gt;

&lt;p&gt;Click “Compute”&lt;/p&gt;

&lt;p&gt;Click on “Add node group”&lt;/p&gt;

&lt;p&gt;Click the “Name” field.&lt;/p&gt;

&lt;p&gt;Write any Name you want (NodeGroup)&lt;/p&gt;

&lt;p&gt;Select the Role that was created for the node Group in Step 1&lt;/p&gt;

&lt;p&gt;Click “Next”&lt;/p&gt;

&lt;p&gt;On the next page remove t3.medium and add t2.medium as instance type.&lt;/p&gt;

&lt;p&gt;Select t2.medium&lt;/p&gt;

&lt;p&gt;Click “Next”&lt;/p&gt;

&lt;p&gt;Click “Next”&lt;/p&gt;

&lt;p&gt;Click “Create”&lt;/p&gt;

&lt;p&gt;Node Groups will take some time to create.&lt;/p&gt;

&lt;p&gt;Worker nodes created.&lt;/p&gt;

&lt;p&gt;Step 3: ARGOCD SETUP&lt;br&gt;
Click on the AWS cloud shell icon on the top right&lt;/p&gt;

&lt;p&gt;click on connect&lt;/p&gt;

&lt;p&gt;Better to open in a new tab&lt;/p&gt;

&lt;p&gt;First set context by providing the following command&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
aws eks update-kubeconfig --name EKS_CLUSTER_NAME --region CLUSTER_REGION&lt;/p&gt;

&lt;h1&gt;
  
  
  example
&lt;/h1&gt;

&lt;p&gt;aws eks update-kubeconfig --name GitOps --region ap-south-1&lt;/p&gt;

&lt;p&gt;Check for Nodes&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
kubectl get nodes&lt;/p&gt;

&lt;p&gt;Check for pods, You will get no resources found.&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
kubectl get pods&lt;/p&gt;

&lt;p&gt;Let’s install ArgoCD&lt;/p&gt;

&lt;p&gt;ARGOCD INSTALLATION LINK&lt;/p&gt;

&lt;p&gt;You will redirected to this page&lt;/p&gt;

&lt;p&gt;All those components could be installed using a manifest provided by the Argo Project: use the below commands&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
kubectl create namespace argocd&lt;br&gt;
kubectl apply -n argocd -f &lt;a href="https://raw.githubusercontent.com/argoproj/argo-cd/v2.4.7/manifests/install.yaml" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/argoproj/argo-cd/v2.4.7/manifests/install.yaml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;COMMANDS ARGOCD&lt;/p&gt;

&lt;p&gt;By default, argocd-server is not publicly exposed. For this project, we will use a Load Balancer to make it usable:&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'&lt;/p&gt;

&lt;p&gt;One load balancer will created in the AWS&lt;/p&gt;

&lt;p&gt;Wait about 2 minutes for the LoadBalancer creation&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
export ARGOCD_SERVER=&lt;code&gt;kubectl get svc argocd-server -n argocd -o json | jq --raw-output '.status.loadBalancer.ingress[0].hostname'&lt;/code&gt;&lt;br&gt;
when you run this command, it will export the hostname of the ArgoCD server’s load balancer and store it in the ARGOCD_SERVER environment variable, which you can then use in other commands or scripts to interact with the ArgoCD server. This can be useful when you need to access the ArgoCD web UI or interact with the server programmatically.&lt;/p&gt;

&lt;p&gt;If run this command you will get the load balancer external IP&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
echo $ARGOCD_SERVER&lt;/p&gt;

&lt;p&gt;Login&lt;br&gt;
The command you provided is used to extract the password for the initial admin user of ArgoCD, decode it from base64 encoding, and store it in an environment variable named ARGO_PWD.&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
export ARGO_PWD=&lt;code&gt;kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to see your password provide the below command&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
echo $ARGO_PWD&lt;/p&gt;

&lt;p&gt;Now copy the load balancer IP and paste it into the browser&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
echo $ARGOCD_SERVER&lt;/p&gt;

&lt;p&gt;Now you will see this page. if you get an error click on advanced and click on proceed.&lt;/p&gt;

&lt;p&gt;Now you will see this page and log in to ArgoCD&lt;/p&gt;

&lt;p&gt;Username is admin&lt;/p&gt;

&lt;p&gt;For the password, you have to provide the below command and copy it&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
echo $ARGO_PWD&lt;/p&gt;

&lt;p&gt;Click on Signin and you will see this page.&lt;/p&gt;

&lt;p&gt;Now click on the Setting gear icon in the left side panel&lt;/p&gt;

&lt;p&gt;Click on Repositories&lt;/p&gt;

&lt;p&gt;Now click on Connect Repo Using HTTPS&lt;/p&gt;

&lt;p&gt;Add Github details, Type as git, Project as default and provide the GitHub URL of this project and click on connect&lt;/p&gt;

&lt;p&gt;You will get Connection Status as Successful&lt;/p&gt;

&lt;p&gt;Click on Manage Your application&lt;/p&gt;

&lt;p&gt;You will see this page and click on New App&lt;/p&gt;

&lt;p&gt;Now provide the following details as in the image&lt;/p&gt;

&lt;p&gt;Finally, click on Create&lt;/p&gt;

&lt;p&gt;Now you will see a new App has been created named tetris&lt;/p&gt;

&lt;p&gt;Click on tetris&lt;/p&gt;

&lt;p&gt;Now click on three dots beside tetris-service and click on the details&lt;/p&gt;

&lt;p&gt;Now copy the hostname address&lt;/p&gt;

&lt;p&gt;Paste it in a browser you will see this page&lt;/p&gt;

&lt;p&gt;Now play the game.&lt;/p&gt;

&lt;p&gt;Let’s Break the Highest score in Tetris.&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
kubectl get all&lt;/p&gt;

&lt;p&gt;Step 5: Termination&lt;br&gt;
Go to Cloud shell and delete service for ArgoCD load balancer&lt;/p&gt;

&lt;p&gt;Copy&lt;br&gt;
kubectl delete svc argocd-server -n argocd&lt;/p&gt;

&lt;p&gt;Go to AWS and manually delete the load balancer if it is not deleted.&lt;/p&gt;

&lt;p&gt;Delete Nodegroup First&lt;/p&gt;

&lt;p&gt;Provide the name that you used for your node group and click delete&lt;/p&gt;

&lt;p&gt;Delete the Cluster&lt;/p&gt;

&lt;p&gt;Provide the name of the Cluster and delete.&lt;/p&gt;

&lt;p&gt;As we bring our enthralling journey through the captivating realms of GitOps and the iconic Tetris on Kubernetes to a close, allow us to leave you with a fascinating nugget of knowledge:&lt;/p&gt;

&lt;p&gt;Did you know that Tetris, conceived by Alexey Pajitnov in 1984 during his tenure as a computer scientist at the Soviet Academy of Sciences, began as a humble experiment? It swiftly evolved into a global gaming sensation, captivating hearts and minds across the globe for decades.&lt;/p&gt;

&lt;p&gt;Much like Tetris, GitOps is a dynamic force, continuously evolving and reshaping the modern landscape of DevOps. It offers ingenious solutions for managing complex infrastructures and applications. We trust this adventure has ignited a spark of curiosity within you, inspiring further exploration of GitOps' limitless potential.&lt;/p&gt;

&lt;p&gt;So, whether you're meticulously deploying code, skillfully stacking blocks in Tetris, or boldly venturing into uncharted territories in the tech world, remember: the journey knows no bounds, and every step is filled with delightful surprises. Keep coding, keep gaming, and keep exploring! 🌟&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
