<?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: Emmeline</title>
    <description>The latest articles on DEV Community by Emmeline (@esuivant).</description>
    <link>https://dev.to/esuivant</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%2F1260784%2Faf4bd0cb-1985-4b01-b49c-1061aaf06771.png</url>
      <title>DEV Community: Emmeline</title>
      <link>https://dev.to/esuivant</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/esuivant"/>
    <language>en</language>
    <item>
      <title>I created a Kubernetes cluster on AWS EC2 instances</title>
      <dc:creator>Emmeline</dc:creator>
      <pubDate>Mon, 06 May 2024 18:31:37 +0000</pubDate>
      <link>https://dev.to/esuivant/i-created-a-kubernetes-cluster-on-aws-ec2-instances-3idj</link>
      <guid>https://dev.to/esuivant/i-created-a-kubernetes-cluster-on-aws-ec2-instances-3idj</guid>
      <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;Today I want to share how I have created a k8s 2-node cluster with kubeadm on AWS EC2 instances.&lt;br&gt;
In this process, I was highly inspired and helped by this blog article : &lt;a href="https://www.bing.com/search?q=install%20kubernetes%20cluster%20aws%20ec2%20medium&amp;amp;qs=n&amp;amp;form=QBRE&amp;amp;=Search%20%7B0%7D%20for%20%7B1%7D&amp;amp;=Search%20work%20for%20%7B0%7D&amp;amp;=%25eManage%20Your%20Search%20History%25E&amp;amp;sp=-1&amp;amp;ghc=1&amp;amp;lq=0&amp;amp;sm=u&amp;amp;pq=install%20kubernetes%20cluster%20aws%20ec2%20medium&amp;amp;sc=6-41&amp;amp;sk=&amp;amp;cvid=0955E95B93E44613823CA18198793DAE&amp;amp;ghsh=0&amp;amp;ghacc=0&amp;amp;ghpl="&gt;Setup Your K8s Cluster with AWS EC2&lt;/a&gt; by Milinda Nandasena.&lt;/p&gt;

&lt;p&gt;I have followed the following steps :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an instance template to install all requirements at launch&lt;/li&gt;
&lt;li&gt;Launch two instances&lt;/li&gt;
&lt;li&gt;Made a minor - but important - change in the containerd config file&lt;/li&gt;
&lt;li&gt;Run kubeadm init command on the controlplane node&lt;/li&gt;
&lt;li&gt;Run kubeadm join command on the worker node&lt;/li&gt;
&lt;li&gt;Install the Flannel network plugin on both nodes&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;
  
  
  1. Create an instance template to install all requirements at launch
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Application and OS Images (Amazon Machine Image) &lt;br&gt;
Ubuntu 22.04&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Instance Type &lt;br&gt;
t2.medium &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;I have experienced that free-tier eligible instances such as t2.micro don't have enough CPU to be a kubernetes node. I reached easily 90% of CPU utilization with few pods running.&lt;br&gt;
This is why I recommend t2.medium instance type.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Key pair (login)&lt;br&gt;
I recommend creating a new key pair that will be used to log into all the nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Network setting&lt;br&gt;
Subnet : Don't include in launch template&lt;br&gt;
Security Group : Choose an existing or new security group with the following rules.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advanced details&lt;br&gt;
This is where I think you can gain a lot of time and effort.&lt;br&gt;
You can write here commands that will be executed when launching the instance. We will install &lt;em&gt;kubelet&lt;/em&gt;, &lt;em&gt;kubectl&lt;/em&gt;, &lt;em&gt;kubeadm&lt;/em&gt; and the container runtime &lt;em&gt;containerd&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the &lt;a href="https://github.com/esuiv/kubernetes-cluster/blob/main/userdata"&gt;user data file&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At this point you have completed 50% of the job :)&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Launch two instances
&lt;/h2&gt;

&lt;p&gt;In the menu EC2 &amp;gt; Instances &amp;gt; Launch instance from template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgevw5sokstnrxho1o0rw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgevw5sokstnrxho1o0rw.png" alt="launch from template" width="490" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select your template &lt;em&gt;kubernetes-node&lt;/em&gt;.&lt;br&gt;
And change the name of your instance in &lt;em&gt;Resource tags&lt;/em&gt; section, in order to create two ec2 instances : &lt;em&gt;controlplane&lt;/em&gt; and &lt;em&gt;node01&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Now that you have your two instances, you can SSH into them.&lt;br&gt;
&lt;code&gt;ssh -i &amp;lt;KEY_PAIR&amp;gt;.pem ubuntu@&amp;lt;PUBLIC_IP&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The command can be found here :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxazyecy1adfrugc4m3j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxazyecy1adfrugc4m3j.png" alt="Connect" width="800" height="137"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Made a minor - but important - change in the containerd config file
&lt;/h2&gt;

&lt;p&gt;As described in &lt;a href="https://kubernetes.io/docs/setup/production-environment/container-runtimes/#docker"&gt;Kubernetes documentation&lt;/a&gt;, when installing containerd as the CRI runtime, it is important to configure the system cgroup driver.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;/etc/containerd/config.toml&lt;/code&gt;, change the value of SystemdCgroup from false to true.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh42toizrpk4oxvu9y2ko.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh42toizrpk4oxvu9y2ko.png" alt="containerd configuration" width="800" height="273"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Run kubeadm init command on the controlplane node
&lt;/h2&gt;

&lt;p&gt;On the controlplane node :&lt;br&gt;
&lt;code&gt;sudo kubeadm init --pod-network-cidr=10.244.0.0/16&lt;/code&gt;&lt;br&gt;
This pod network cidr is compatible with the Flannel plugin discussed later.&lt;/p&gt;

&lt;p&gt;As explained in the output, you must copy the kubectl config file to .kube/config with the following commands :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to prepare the worker node joining the cluster, execute the following to generate a token :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;kubeadm token create --print-join-command&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Run kubeadm join command on the worker node
&lt;/h2&gt;

&lt;p&gt;Execute the kubeadm join command on the worker node.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Install Flannel network add-on on both nodes
&lt;/h2&gt;

&lt;p&gt;Kubernetes does not provide networking, this is why you must install a networking plugin add-on. There is a list available &lt;a href="https://kubernetes.io/docs/concepts/cluster-administration/addons/#networking-and-network-policy"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I chose Flannel and I found &lt;a href="https://github.com/flannel-io/flannel#deploying-flannel-manually"&gt;here&lt;/a&gt; the necessary steps :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;At this point you should see all of your pods getting ready.&lt;br&gt;
And the nodes should be ready.&lt;/p&gt;

&lt;p&gt;Thank you for reading.&lt;br&gt;
Do not hesitate if you have any questions or advices.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>aws</category>
      <category>learning</category>
    </item>
    <item>
      <title>AWS CodePipeline from GitHub to S3 - My 1st Complex Cloud Project #2</title>
      <dc:creator>Emmeline</dc:creator>
      <pubDate>Wed, 24 Jan 2024 09:46:05 +0000</pubDate>
      <link>https://dev.to/esuivant/my-1st-complex-cloud-project-2-cicd-pipeline-from-github-to-s3-using-cloudformation-f08</link>
      <guid>https://dev.to/esuivant/my-1st-complex-cloud-project-2-cicd-pipeline-from-github-to-s3-using-cloudformation-f08</guid>
      <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;The first step in building &lt;a href="https://dev.to/esuivant/my-first-complex-cloud-project-lm"&gt;my first complex cloud project&lt;/a&gt; is &lt;strong&gt;creating a CI/CD pipeline&lt;/strong&gt;. From my code repository on GitHub to an S3 bucket on AWS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ty8c5y6o4v3wj02803y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ty8c5y6o4v3wj02803y.png" alt="schema architecture" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would like the code from the main branch of my GitHub repository to be automatically copied to my S3 bucket.&lt;br&gt;
And I keep in mind that I want to use IaC as much as possible.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Why IaC (Infrastructure as Code) ?&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Because I need to :&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Track all of the resources associated with my project&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Monitor the infrastructure changes&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;And I do not want to click around AWS Console :D&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here is a more detailed view of what I implemented :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuj1xy4rlhjemwoo83q8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuj1xy4rlhjemwoo83q8.png" alt="CICD details" width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find on my GitHub my &lt;a href="https://github.com/esuiv/secret-santa-files"&gt;CloudFormation template&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The pipeline has 3 stages :&lt;br&gt;
&lt;strong&gt;1. Source&lt;/strong&gt;&lt;br&gt;
CodeStar Connection to my GitHub repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Build&lt;/strong&gt;&lt;br&gt;
With AWS CodeBuild. You need to put a buildspec.yaml file in your repository. You can find an example &lt;a href="https://github.com/esuiv/secret-santa-files"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Deploy&lt;/strong&gt;&lt;br&gt;
Unzip the files in S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I found challenging :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The first times I tried to create the CloudFormation stack  I had invalid format errors.&lt;br&gt;
And I had a hard time finding out why.&lt;br&gt;
Is there any tool to parse your CloudFormation file and identify any misconfiguration ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ROLES ! I find it really difficult to handle roles and access management. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you for reading.&lt;br&gt;
I am open to discussions, advices and questions.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>buildinpublic</category>
      <category>cicd</category>
    </item>
    <item>
      <title>My First Complex Cloud Project</title>
      <dc:creator>Emmeline</dc:creator>
      <pubDate>Mon, 22 Jan 2024 09:32:21 +0000</pubDate>
      <link>https://dev.to/esuivant/my-first-complex-cloud-project-lm</link>
      <guid>https://dev.to/esuivant/my-first-complex-cloud-project-lm</guid>
      <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;New to the AWS Cloud world, I am building my &lt;strong&gt;first complex cloud project&lt;/strong&gt; !&lt;br&gt;
I started with the classic beginner cloud project : Hosting a static website on AWS S3 for my &lt;a href="https://www.emmelinesuivant.com"&gt;personal portfolio&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I feel ready to tackle a more challenging and complex project.&lt;br&gt;
This is the pitch : a secret Santa website where a user gives a list of participants and their respective emails.&lt;br&gt;
Then each participant receives an email with the identity of the person they should offer a gift to :)&lt;br&gt;
Yes, I started working on this project in December last year :D&lt;/p&gt;

&lt;p&gt;This application will (hopefully) include :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Serverless (Lambda, DynamoDB, APIGateway)&lt;/li&gt;
&lt;li&gt;CI/CD for dev &lt;em&gt;and&lt;/em&gt; prod environments (GitHub, CodePipeline)&lt;/li&gt;
&lt;li&gt;Authentification (Cognito)&lt;/li&gt;
&lt;li&gt;IaC (CloudFormation)&lt;/li&gt;
&lt;li&gt;Static website hosting (S3, CloudFront, Route53)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a first draft of the architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2x80q4ao6xgkwzg2d9pm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2x80q4ao6xgkwzg2d9pm.png" alt="architecture" width="800" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will document this project here :)&lt;br&gt;
Feel free to ask questions or give advices.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>aws</category>
      <category>buildinpublic</category>
    </item>
  </channel>
</rss>
