<?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: Tohid Hanfi</title>
    <description>The latest articles on DEV Community by Tohid Hanfi (@tohidhanfi20).</description>
    <link>https://dev.to/tohidhanfi20</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%2F1922078%2F190d8a85-b087-4611-a144-71f02799f005.jpeg</url>
      <title>DEV Community: Tohid Hanfi</title>
      <link>https://dev.to/tohidhanfi20</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tohidhanfi20"/>
    <language>en</language>
    <item>
      <title>ToDo-App Deployed on EKS Cluster</title>
      <dc:creator>Tohid Hanfi</dc:creator>
      <pubDate>Sat, 24 Aug 2024 10:08:01 +0000</pubDate>
      <link>https://dev.to/tohidhanfi20/todo-app-deployed-on-eks-cluster-2hce</link>
      <guid>https://dev.to/tohidhanfi20/todo-app-deployed-on-eks-cluster-2hce</guid>
      <description>&lt;h2&gt;
  
  
  Table Of Contents
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    * [Step 1- Step 7 --Setup your project according to you]&lt;br&gt;
    * [Step 8- Step 10 --Terraform for eks provisioning]&lt;br&gt;
    * [Step 11- Step 12 -- Circle Ci Setup]&lt;br&gt;
    * [Step 13 --CD setup using Argo cd]&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Let's Start our project&lt;br&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Step-1
&lt;/h2&gt;

&lt;p&gt;Download my repositories from my github account named into to local computer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; AppCode - &lt;a href="https://github.com/tohidhanfi20/AppCode" rel="noopener noreferrer"&gt;https://github.com/tohidhanfi20/AppCode&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; tf_code - &lt;a href="https://github.com/tohidhanfi20/tf_code" rel="noopener noreferrer"&gt;https://github.com/tohidhanfi20/tf_code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; kube_manifest - &lt;a href="https://github.com/tohidhanfi20/kube_manifest" rel="noopener noreferrer"&gt;https://github.com/tohidhanfi20/kube_manifest&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step-2
&lt;/h2&gt;

&lt;p&gt;Make all the files according to your accounts like change github credentials, Docker Credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-3 DEEP DIVE
&lt;/h2&gt;

&lt;p&gt;Now as we are provisioning Terraforma as our infra as a code firstly,&lt;br&gt;
we need to change certain changes into backend.tf file present in &lt;br&gt;
tf_code/ToDo-App/backend.tf for that follow this Steps :-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go To &lt;a href="https://signin.aws.amazon.com/" rel="noopener noreferrer"&gt;https://signin.aws.amazon.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Then after you logged Navigate to s3 service.&lt;/li&gt;
&lt;li&gt;There is a option to create a bucket Click on it.&lt;/li&gt;
&lt;li&gt;Choose a unique name for your bucket.&lt;/li&gt;
&lt;li&gt;Note- Bucket should be present in the region were you will user 
     terraform.&lt;/li&gt;
&lt;li&gt;Enable Versioning in those settings.&lt;/li&gt;
&lt;li&gt;Leave all things now to default.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-4
&lt;/h2&gt;

&lt;p&gt;Now for dynanodb table follow this steps&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to Dynamodb Dashboard.&lt;/li&gt;
&lt;li&gt;There you will see tables option Click on that.&lt;/li&gt;
&lt;li&gt;Edit a unique name and it should be present in your backend.tf file.&lt;/li&gt;
&lt;li&gt;Make partition key - LockID (string)&lt;/li&gt;
&lt;li&gt;Leave all things to default and make the table.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-5 SET UP TERRAFORM USER
&lt;/h2&gt;

&lt;p&gt;Make new user for terraform - Steps&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to IAM Dashboard&lt;/li&gt;
&lt;li&gt;There is a user section &lt;/li&gt;
&lt;li&gt;Make a new user with any name&lt;/li&gt;
&lt;li&gt;Attach admin level permissions to it&lt;/li&gt;
&lt;li&gt;save your access key and secret-access credentials&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-6 SET UP YOUR VSCODE
&lt;/h2&gt;

&lt;p&gt;Use vscode to setup your infra provisioning&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;install terraform into your local machine&lt;/li&gt;
&lt;li&gt;install aws cli&lt;/li&gt;
&lt;li&gt;set ENV variables in your system&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-7 SET UP AWS account into vscode - command
&lt;/h2&gt;

&lt;p&gt;aws configure&lt;br&gt;
it will ask you following credentials&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access-keys -&amp;gt;&lt;/li&gt;
&lt;li&gt;secret-access-key -&amp;gt;&lt;/li&gt;
&lt;li&gt;Default-region -&amp;gt; ap-south-1&lt;/li&gt;
&lt;li&gt;Default output format -&amp;gt; Don't change&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-8 START WITH THE TERRAFORM COMMANDS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Go to the directory
c:\users\asus\downloads\tf_code\ToDo_App&lt;/li&gt;
&lt;li&gt;Now write terraform init -- to initialize the terraform backend&lt;/li&gt;
&lt;li&gt;Now use terraform plan -- to plan what resources will be created&lt;/li&gt;
&lt;li&gt;Then use terraform apply --auto-approve&lt;/li&gt;
&lt;li&gt;This will created your Resources defined in your terraform files&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-9 Our Resources are created now
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;We need now to set some variables&lt;/li&gt;
&lt;li&gt;set $REGION=ap-south-1&lt;/li&gt;
&lt;li&gt;&lt;p&gt;set $CLUSTER_NAME=ToDo-App&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We need to update the content of  kubeconfig file with the variables we just have give&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;command --&amp;gt; aws eks update-kubeconfig --region ap-south-1 --name ToDo-App&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-10 Check with the Kubernete's content is created or not
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;kubectl get pods -n=kube-system&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-11 Circleci Setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Setup your github account as organization&lt;/li&gt;
&lt;li&gt;Select your repo in which your project is there --&amp;gt; AppCode&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-12 Setup your ENV variable's into our CircleCi
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Go to project settings&lt;/li&gt;
&lt;li&gt;There we have ENV-VAR &lt;/li&gt;
&lt;li&gt;Add there docker-username, Docker-pswd, Github personal token&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-13 Check with argocd resources are created
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;now run following commands one by one&lt;/li&gt;
&lt;li&gt;kubectl create ns argocd&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;kubectl apply -n argocd -f &lt;br&gt;
  &lt;a href="https://raw.githubusercontent.com/argoproj/argocd/stable/manifests/install.sh" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/argoproj/argocd/stable/manifests/install.sh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;kubectl port-forward svc/argocd-server 8080:443 -n argocd&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;argocd is running on http:localhost:8080&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;password you can find in --&amp;gt;&lt;/p&gt;

&lt;p&gt;kubectl get secrets -n=argocd&lt;/p&gt;

&lt;p&gt;kubectl get secret argocd-initial-admin-secret -n=argocd&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now apply manifest file present in the tf_code repo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;command- kubectl apply -f argo-manifest.yaml&lt;/p&gt;

&lt;h2&gt;
  
  
  ALL SET TO START
&lt;/h2&gt;

</description>
      <category>devops</category>
      <category>circleci</category>
      <category>git</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
