<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by dusdjhyeon on Medium]]></title>
        <description><![CDATA[Stories by dusdjhyeon on Medium]]></description>
        <link>https://medium.com/@dusdjhyeon?source=rss-de4e20f215c4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*BJ08nazJd_K9Pv-E</url>
            <title>Stories by dusdjhyeon on Medium</title>
            <link>https://medium.com/@dusdjhyeon?source=rss-de4e20f215c4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:23:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dusdjhyeon/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[LFX Mentorship: Where to start to become a good OpenSource Contributor]]></title>
            <link>https://dusdjhyeon.medium.com/lfx-mentorship-where-to-start-to-become-a-good-opensource-contributor-8497057820be?source=rss-de4e20f215c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/8497057820be</guid>
            <category><![CDATA[litmuschaos]]></category>
            <category><![CDATA[lfx-mentorship]]></category>
            <dc:creator><![CDATA[dusdjhyeon]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 13:08:58 GMT</pubDate>
            <atom:updated>2024-09-04T01:10:27.062Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>With open source on the rise, contributing to open source is on the minds of many developers. However, finding out where, how, and to what extent you can contribute can be very challenging. I would highly recommend LFX Mentorship to anyone in this situation.</p><p>With LFX Mentorship, you’ll receive active support from the Linux Foundation and project mentors. In addition, the issue that the mentee will be working on is already set, which is a great point to start.</p><p>Among many projects, I ended up working with LitmusChaos, an open source Chaos Engineering platform that enables teams to identify weaknesses &amp; potential outages in infrastructures by inducing chaos tests in a controlled way. My mentors were @Vedant Shrotria, @Sayan Mondal, and @Raj Babu Das.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXUsnyLsZwUNgwnIYktlkQ.png" /></figure><h3>What’s my background when I join?</h3><p>When I applied for mentorship, I was just a senior computer science student. And I didn’t know much about Chaos Engineering.</p><p>It’s just that I heard about LitmusChaos at a conference a while back, and that piqued my interest, so I applied.</p><p>I have experience with Golang and Kubernetes in project skills, and I emphasized this in my Resume and Cover Letter. I’ve also always had a hunger for open source, so I mentioned this several times.<br>As a result, I was fortunate enough to get a mentorship opportunity.</p><h3>What I experienced during my mentorship?</h3><p>My issue was titled <strong><em>Revamp Litmus Helm Agent, UBI migration of Images</em></strong>.<br>There were two main processes here.</p><ol><li><strong>Existing Docker Images Migration(alpine base -&gt; UBI)</strong></li><li><strong>Remove Login process when installing litmus helm-agent</strong></li></ol><p><strong>Image Migration</strong></p><p>Previously, several Docker Images of LitmusChaos used a custom image based on alpine as a UBI(RHEL-based) image(infra-alpine, experiment-alpine). This improves the vulnerability issues of the previous base image and ensures OpenShift compatibility.</p><p>I needed to migrate the following images:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*piujzUgUK-koMh5ivhxFmg.png" /></figure><p><strong>Improve Helm-Agent</strong></p><pre>helm install litmus-agent litmuschaos/litmus-agent \<br>--namespace litmus --create-namespace \<br>--set &quot;INFRA_NAME=helm-agent&quot; \<br>--set &quot;INFRA_DESCRIPTION=My first agent deployed with helm !&quot; \<br>--set &quot;LITMUS_URL=https://chaos-center.domain.com&quot; \ # FOR REMOTE AGENT (INGRESS)<br>--set &quot;LITMUS_URL=http://litmusportal-frontend-service.litmus.svc.cluster.local:9091&quot; \ # FOR SELF AGENT (SVC)<br>--set &quot;LITMUS_BACKEND_URL=http://litmusportal-server-service.litmus.svc.cluster.local:9002&quot; \ # FOR SELF AGENT (SVC)<br>--set &quot;LITMUS_USERNAME=admin&quot; \<br>--set &quot;LITMUS_PASSWORD=litmus&quot; \<br>--set &quot;LITMUS_PROJECT_ID=&lt;PROJECT_ID&gt;&quot; \<br>--set &quot;global.INFRA_MODE=cluster&quot;</pre><p>For a traditional litmus helm-agent, we get the USERNAME and PASSWORD as shown in the code above and log into Infra with them, as shown in the code above.<br>This can seem ambiguous to the user and involves an unnecessary process that is more straightforward than just getting the Infra information via ACCESS_KEY and SECRET_KEY.<br>So, I’ve fixed this so that helm-agent no longer relies on login credentials.</p><p><strong>How do our meetings work?</strong></p><p>We had weekly Sync meetings. They organized our meetings into Google Docs so that I could easily check them in Tasks. As a non-native English speaker, this made sure that I didn’t miss anything in the meetings.<br>I also shared my questions and concerns in Google Docs to make sure I got everything. We tried to actively communicate with each other, and this was very enlightening for me!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*9FkYXVta4_137j_tB0uvew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*A73lPSVLZWpenwhUyK23HQ.png" /></figure><h3>Challenges I faced</h3><p>Compared to other image migrations, migrating a go-runner image was challenging. The go-runner(litmus-go) actually implements the commands we use in the experiment, so we needed to install several binaries to run the commands. There were many things to consider, such as the version, permissions, and storage location of each binary. So I met several errors, including the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGUnYlft0uZ6zosGQyYU3Q.png" /></figure><p>But with the guidance of my mentors and the testing process, I was able to finish well. (Also, I didn’t know much about UBI and the OpenShfit environment, so I had to learn the basics….)</p><p>Also, in the case of Helm-agent, it wasn’t that the task was difficult, but that I didn’t know enough about Helm to understand how it works. However, I went through the process of diagramming the process. And, while exploring several other Helm Charts, organizing both the folder structure and the role of each file.</p><h3>Conclusion</h3><p>I opened 8 PRs during the mentorship period, 4 of which were merged. Three are under review. I plan to make additional contributions after the mentorship and will continue to be interested in open source and LitmusChaos in the future.</p><p>I didn’t just get open source experience or careers from this mentorship, but also gained confidence in my communication style and English. I believe this program is very popular, but there are not many applicants from Korea. I think there is probably a big language barrier. However, the mentors are very friendly and the meeting minutes is very well done, so there is less confusion about the tasks. Also, if you have any questions, you can make use of the weekly meetings to ask them, record them, and listen to them multiple times.</p><p>Don’t be afraid to apply!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8497057820be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Airflow vs Argo Workflow (feat: DAG & Kubernetes)]]></title>
            <link>https://towardsdev.com/apache-airflow-vs-argo-workflow-feat-dag-kubernetes-4944a2d7097d?source=rss-de4e20f215c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4944a2d7097d</guid>
            <category><![CDATA[gda]]></category>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[argo-workflows]]></category>
            <dc:creator><![CDATA[dusdjhyeon]]></dc:creator>
            <pubDate>Sat, 25 May 2024 15:12:42 GMT</pubDate>
            <atom:updated>2024-05-27T12:16:00.117Z</atom:updated>
            <content:encoded><![CDATA[<p>As part of my graduation project, I decided to build a cloud infrastructure for ADAS(Advanced Drive Assistance System) simulation. Autonomous driving simulation consists of various steps such as data collection, preprocessing, simulation execution, and result analysis. Modeling it as a directed acyclic graph(<strong>DAG</strong>) allows you to define the<strong> dependencies</strong> and order between each step, ensuring that tasks are executed in the<strong> correct order</strong>. This allows you to model and manage captured workflows in a systematic way.</p><p>For this reason, I’ve already seen Airflow used in simulations, but since I’m aiming to improve simulations with HPC Kubernetes cluster configurations, I decided to user Argo Workflow, which is more k8s-friendly.</p><p>However,, Airflow also supports k8s, so,,, I don’t think I know much about the difference between the two, so I’m going to compare them now.</p><h4>Workflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*2A15RZboyGJMPM90.png" /><figcaption><a href="https://www.ibm.com/kr-ko/topics/workflow">https://www.ibm.com/kr-ko/topics/workflow</a></figcaption></figure><p>A workflow is a system for managing <strong>repetitive, systematic processes</strong> and tasks that occur in a <strong>specific order</strong>.</p><p>A sequence of steps to accomplish a goal is called a <strong>workflow</strong>, and the tools to schedule these workflows to occur at intervals determined by the developer and to monitor and visualize how well they are working are called <strong>workflow management systems</strong>.</p><h4>DAG</h4><p>It is<strong> Directed Acyclic Graph</strong>. For example, if we were building an ETL pipeline, each of the Task would be Extract -&gt; Transform -&gt; Load, we could create a DAG with arrows like this.</p><p>Complex DAGs can be organized as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*SSyn7MYA48q6p0-c.png" /></figure><p>It can even work in parallel when you have multiple tasks.</p><p>I won’t go into the details. You can read about it in this blog<br><a href="https://steemit.com/dag/@cryptodreamers/dag-dag-directed-acyclic-graph">https://steemit.com/dag/@cryptodreamers/dag-dag-directed-acyclic-graph</a></p><h4>Airflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*4NEBUIh7P6UTNp5F.png" /></figure><ul><li>Open source platform to programmatically create, schedule, and monitor workflows</li><li>An orchestrator that ensures tasks are executed at the <strong>exact time</strong>, in the <strong>exact way</strong>, and in the <strong>exact order</strong>.</li><li>Write workflows as <strong>DAG</strong>s in the standard <strong>Python</strong> programming language, which itself is Python.</li><li>Provides an interactive interface with a variety of simple tools to <strong>monitor workflows in real time</strong>.</li><li>One of the oldest and <strong>largest communities</strong> of any workflow tool in existence.</li></ul><h4>Argo Workflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*QtwMcJdB7hP9eOcn.png" /><figcaption><a href="https://argoproj.github.io/argo-workflows/architecture/">https://argoproj.github.io/argo-workflows/architecture/</a></figcaption></figure><ul><li>High isolation with <strong>container-based</strong> workflow engine created by Argo Project(job unit is a container, not a process).</li><li>High <strong>reusability</strong> by developing a single Job that is responsible for only one role.</li><li>Similar to Airflow, you can run any job you want, and you can run them in any order with dependencies between each job, and you can run <strong>multiple jobs in parallel</strong>.</li><li><strong>Kubernetes native</strong> (CRD + Controller) as it is developed utilizing Kubernetes components.</li><li>Define jobs as a <strong>DAG </strong>using <strong>YAML</strong>, which itself is written in Golang.</li><li>The biggest difference from k8s’ own jobs is that you can run workflows with <strong>dependencies</strong> between jobs.</li></ul><p><strong>Kubeflow</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*zQfuceOSj5cvJzD8.png" /></figure><p>In my case, I was torn between Kubeflow and Argo Workflow based on simple kubernetes compatibility. While Kubeflow does use Argo Workflow internally anyway (workflow orchestration),, its purpose is to be a comprehensive platform that covers all MLOps. I think it would be nice to have some AI elements between some scenarios in ADAS Simulation, but it’s beyond my capabilities and I have to satisfy the minimum research goal (building an HPC environment with k8s), so I decided to use Argo Workflow, which is a more pure workflow management tool.</p><h3>Airflow vs Argo Workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*0-MsLWjxpm_VjbtDFs4COw.png" /></figure><p><strong>Scalability</strong></p><ul><li>Airflow supports <strong>horizontal scalability</strong> and can run multiple schedulers simultaneously. When it comes to jobs, Airflow relies on a dedicated pool of workers to run jobs, so the maximum job parallelism is equal to the number of active workers.</li><li>Argo runs each job as a separate Kubernetes pod, allowing you to manage thousands of pods and workflows in <strong>parallel</strong>. Unlike Airflow, the parallelism of workflows is not limited by Argo’s fixed number of workers, making it best suited for jobs with sequential and parallel step dependencies.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Y7lhdtG9a16N2hLP.png" /></figure><p>Argo workflow is definitely not a hot topic according to Google Trends. Also in Github stars and community,,</p><p><strong>In Kubernetes,,</strong></p><p><strong>Airflow</strong> has a Kubernetes operator that can be used to run pods as part of a workflow, but there is no support for creating other resources(database, scheduler,,).</p><p><strong>Argo</strong> is built on top of Kubernetes, and each job runs as a separate Kubernetes pod. Argo has an excellent support system for performing CRUD operations on Kubernetes objects like pods and deployments.</p><p>The difference here is that you have to use Airflow to manage the metadata DB function or scheduler function, which can be fully supported by the resources of k8s, and there seems to be some difficulty in the git sync process, which is not done on the resources of k8s. In an env where you decide to use git and k8s, wouldn’t it be better to use argo workflow?</p><blockquote>Airflow is more versatile and has more firepower. Argo offers somewhat limited flexibility in terms of interacting with third-party services (in other words, why not?). If you’re already using Kubernetes for most of your infrastructure, you’re probably better off using Argo for your work.</blockquote><h4>Code Ex</h4><p>Below is an example of defining the similar content in Airflow (Python) and Argo Workflow (YAML), in that order.</p><pre>from airflow import DAG<br>from airflow.operators.bash_operator import BashOperator<br>from datetime import datetime<br><br>with DAG(&#39;example_dag&#39;, start_date=datetime(2023, 1, 1), schedule_interval=None) as dag:<br>    task_A = BashOperator(<br>        task_id=&#39;task_A&#39;,<br>        bash_command=&#39;echo hello A&#39;<br>    )<br><br>    task_B = BashOperator(<br>        task_id=&#39;task_B&#39;,<br>        bash_command=&#39;echo hello B&#39;,<br>        depends_on_past=True,<br>        trigger_rule=&#39;all_success&#39;<br>    )<br><br>    task_C = BashOperator(<br>        task_id=&#39;task_C&#39;,<br>        bash_command=&#39;echo hello C&#39;,<br>        depends_on_past=True,<br>        trigger_rule=&#39;all_success&#39;<br>    )<br><br>    task_A &gt;&gt; task_B &gt;&gt; task_C</pre><pre>apiVersion: argoproj.io/v1alpha1<br>kind: Workflow<br>metadata:<br>  generateName: loops-dag-<br>spec:<br>  entrypoint: dag-example<br>  templates:<br>  - name: dag-example<br>    dag:<br>      tasks:<br>      - name: A<br>        template: A<br>      - name: B<br>        template: B<br>        dependencies: [A]<br>      - name: C<br>        template: C<br>        dependencies: [B]<br><br>  - name: A<br>    container:<br>      image: alpine:3.7<br>      command: [echo, hello A]<br><br>  - name: B<br>    container:<br>      image: alpine:3.7<br>      command: [echo, hello B]<br><br>  - name: C<br>    container:<br>      image: alpine:3.7<br>      command: [echo, hello C]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4944a2d7097d" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/apache-airflow-vs-argo-workflow-feat-dag-kubernetes-4944a2d7097d">Apache Airflow vs Argo Workflow (feat: DAG &amp; Kubernetes)</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We Made, I Raised: Status Anxiety]]></title>
            <link>https://dusdjhyeon.medium.com/we-made-i-raised-status-anxiety-d169131c9cc2?source=rss-de4e20f215c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d169131c9cc2</guid>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[anxiety]]></category>
            <dc:creator><![CDATA[dusdjhyeon]]></dc:creator>
            <pubDate>Wed, 24 Apr 2024 02:07:33 GMT</pubDate>
            <atom:updated>2024-05-25T15:15:15.954Z</atom:updated>
            <content:encoded><![CDATA[<p>This is my “anxiety” story, written after reading Alain de Botton’s “Status Anxiety”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*rYjxHwMBi8YmHrrbxtcKIA.png" /></figure><p>This book shows how our anxiety affects our self-perception and quality of life. It discusses five in particular: <strong>Lovelessness</strong>, <strong>Snobbery</strong>, <strong>Expectations</strong>, <strong>Meritocracy</strong>, an <strong>Dependence</strong>.</p><p>While all five of these can contribute to anxiety, they are also individually interrelated, and a lack of one can affect many others.</p><p>Here’s a brief description of each.</p><h4>Lovelessness</h4><p>Specifically, the lack of a love that is a desire to be an object of concern for others, to have our presence noted and our views listened to. While other forms of love are celebrated by culture when they are achieved, or empathized with when they are lacking, this type of love is one society is less likely to acknowledge.</p><h4>Snobbery</h4><p>A habit of conveying respect on symbols of achievement rather than character. He diagnoses snobs as having a weak independent judgement combined with an appetite for the opinions of those the snobs deem important.</p><h4>Expectations</h4><p>Especially since the mid-17th century, when the ideal that all people are equal has emerged, and feelings of discrimination, which were less noticeable when inequality was widespread, have become more pronounced, leading to anxiety and jealousy at the slightest difference. In modern society, we can find anxiety in the midst of wealth and depression in the midst of peace.</p><h4>Meritocracy</h4><p>A wealth is inherited and my father’s job and the way he dresses is valued and graded by my abilities. Poverty and low status no longer seemed like something to be pitied, but something that was ‘deserved’ due to a lack of ability.</p><h4>Dependence</h4><p>Pre-modern society was rigid and dependable but modern society is fluid and has lost dependability. With their greater freedom of choice and opportunity, citizens in a modern society are dependent on their talent, their luck, their employer, their employer’s profitability and the global economy. All of which contribute to make it more difficult to know what tomorrow will bring.</p><h3>Adapting</h3><h4>I,,</h4><p>Of these, I tend to sympathize more with meritocracy-induced anxiety. Of course, as I said above, I think one factor is related to the others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*dyaGJK4CmGt0yhU-4Azh5Q.png" /></figure><p>I’m always curious about that. <strong><em>“Am I good enough?” </em></strong>One of the reasons why we feel so uncertain about the future or myself is because of the anxiety created by our meritocratic society.</p><p>Anxiety doesn’t have to be a negative thing, it can also be a feeling of being too happy. In moderation, anxiety can be a positive tension. But, if it persists, it can lead to difficulty concentrating and even stressful physical functions. Although anxiety is a natural human emotion, it shouldn’t be eroded, so it’s important to think about why it’s generated.</p><p>The anxiety that me and others fell these days is caused by uncertainty about abilities. When you’re a student, you have to do well in school, and when you’re in college, you have to study and build your resume at the same time. When you get a job, you worry about job changes and paying for housing. Even interns nowadays prefer to hire people with work experience. It means that<strong> you have to have skills to build skills</strong>. This constant uncertainty and competition causes anxiety and impatience.</p><p>In my case,, the closer I got to graduation, the more pressure and inferiority complex I felt. Sometimes, I think that all people got ahead of me. But many people felt similar thinking to me.</p><h4>Accepting Anxiety(Anxiety == Natural)</h4><p>Meritocracy has a long history, and as human beings, it’s natural to feel uneasy in a society like this, so whatever you feel, accept that you can’t change it. If you can’t change the social now, you need to find your own way of <strong>coexisting</strong>.</p><p>The first is <strong>to use your emotions as a motivator for growth</strong>. The key is to recognize that the success of the person you’re comparing yourself to is the result of a certain amount of luck and hard work, not innate differences in ability. It’s good to have a mind of “if I try hard enough, I can do it someday”. This can be a good motivator, and it can boost your self-esteem. However, it’s important to be careful not to get caught up in unfounded confidence.</p><p>Another way is <strong>to focus on the “I”</strong>. We are highly dependent on others, and our need for approval lead us to compare ourselves.</p><blockquote>When you know what you really want and where you’re headed, the importance of others becomes distinctly less important<br> — Alain de Botton</blockquote><p>Focusing your attention on yourself will naturally reduce the frequency of comparison, and therefore your anxiety. Also, don’t worry about what others think of your failures. (In an unreasonable, conditioned world, the “I” is worthy of being loved indiscriminately.)</p><p>Once you’ve practiced both of these methods and seen positive results, or have gained some control over your anxiety, there’s something else you can do. This brings us <strong>back to being mindful of others</strong>. As humans, we have to interact with other people. We all have a need to be recognized by others. Even though we said above to focus on yourself, understand that at the end, you need to be accepted by others to feel fully accepted by yourself. Don’t compare yourself to others, but it’s not a bad idea to use them as an example to improve yourself.</p><p>You can also<strong> read related articles</strong>. It’s a light but profound way to gain empathy without having to open up about your feelings. I was really impressed with the book Anxiety by Alain de Botton. It gets to the root of the causes of anxiety, and I found it comforting that the book is philosophical without being emotional.</p><p>But, it’s important to note that these methods are not the answer. They’re just suggestions, and they don’t guarantee a cure of anxiety. Add your own know-how.</p><p><strong><em>Summary</em></strong></p><ol><li>To use your emotions as a motivator for growh.</li><li>To focus on the “I”</li><li>If you’re not enough, get recognized by others.</li><li>Read articles that empower you.</li><li>But, none of this is the answer,,,</li></ol><h4>I hope you all are at peace too,,</h4><p>In a world where we may have to move forward for the rest of our lives, we may feel tired, exhausted, and anxious. Nevertheless, meritocracy is an integral part of capitalist society, and we can’t remove it. It has many drawbacks and makes people suffer, but it’s also the most fair and makes society work. So if we can’t get rid of it, we have to live with it. We should try to make it a society where anxiety is a little annoying, but no a big deal. We need to take it easy and not get carried away.</p><p>Of course, I know better than anyone that impatience isn’t going to go away just because you read this. It may be cowardly, but it’s a little better to realize that most people live with this mentality. I said you should stop thinking you have to be as successful as everyone else, but that doesn’t mean you should give up trying to be successful. Success must be what you think it should be. I’m the master of my own world. In order to be satisfied with your life, you need to set your own standards. And if you make sure that your standards are well grounded so that they are not swayed by other people’s evaluations. And you will be able to reduce unnecessary self-doubt and worry.</p><p>It’s okay to be slow and it’s okay to be fast. As long as you’re at peace with yourself, it’s the right way. We are not perfect, and neither is our society. Nothing in the world is perfect. So, we don’t need to be impatient. Being human, there are some hard things we have to go through in life. This is just one of them. I hope everyone can shake off their fears, embrace hope, and move forward.</p><blockquote>Every night I praise myself for the day, and every morning I think about what I did the day before that I need to fix (because if I do it at night, I might not be able to sleep).<br>But the point is, there are no regrets. You have to improve. This makes me grow inside.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d169131c9cc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CRI and OCI Standardize Kubernetes Containers]]></title>
            <link>https://dusdjhyeon.medium.com/cri-and-oci-standardize-kubernetes-containers-da67b2a26d17?source=rss-de4e20f215c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/da67b2a26d17</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[dusdjhyeon]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 02:25:12 GMT</pubDate>
            <atom:updated>2024-04-04T02:25:12.058Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o338timdL9Al-clTq0YJwg.png" /></figure><p><strong>CRI</strong> and <strong>OCI </strong>play an important role in ensuring the <strong>standardization and compatibility of containers in the Kubernetes ecosystem.</strong> This allows developers to have consistent container experience across different environments.</p><p>They are acronyms for Container Runtime Interface and Open Container Initiative, respectively, so we first need to know about container runtimes.</p><h3>Container Runtime</h3><p>The steps to run a container are as follows:</p><ol><li>Download the image</li><li>Extract the image into a bundle</li><li>Run the container from the bundle</li></ol><p>Container runtime is <strong>software</strong> that <strong>runs and manages containers</strong>, <strong>managing their lifecycle </strong>and <strong>running applications at the OS level</strong>.</p><p>Docker, which served as an unofficial standard when OCI was created, only standardized the third step to standardize the container runtime. This means that the runtime of an understanding container is split into two parts: <strong>the OCI runtime</strong>, which is runtime that runs the actual container, and the <strong>high-level container runtime</strong>, which runs things like transporting and managing container images, unpacking images, etc.</p><h4>Low-Level Container Runtimes</h4><p>Containers are implemented using Linux namespaces and cgroups. The <strong>namespace</strong> virtualize system resources, such as file system or networking, for each container, and the <strong>cgroup</strong> serves to limit the amount of resources, such as CPU and memory, that each container can use.</p><p>The low-level container runtime sets up these namespaces and cgroups and then executes commands within those namespaces and cgroups.</p><p>This is the <strong>actual execution (env) of the container</strong>, but to run containers from an image, you need features like an<strong> image-specific API</strong>. These features are provides by the high-level container runtime.</p><h4>High-Level Container Runtimes</h4><p>It provides <strong>daemons and APIs</strong> that remote application can use to logically run and monitor containers. It is also placed on top of the low-level runtime to run containers.</p><p>As such, a low-level and high-level container runtime are required to run containers, which is where Docker, along with the OCI runtime, comes in.</p><p>Docker provides the most well-known high-level container runtime called <strong>Containerd</strong>. Like runC, Containerd was developed to run container in Docker, but was later e<strong>xtracted as an independent library.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*kf0ToZkepUKe8yXI7RYCfQ.png" /><figcaption>[S-Core] high-level and low-level container runtime relationships and the Docker architecture</figcaption></figure><h3>OCI (Open Container Initiative)</h3><p>The default behavior is as follows. When the<strong> kubelet</strong> receives a command, it uses the <strong>Docker runtime</strong> <strong>to manage its lifecycle,</strong> such as creating or deleting containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*ohaIjRuXKVwSSkY2IooXaw.png" /></figure><p>Later, there are many other container technologies besides Docker, and the number of runtimes to support increased.</p><p>So, need to modify the kubelet code to support differenet container runtimes. Because Docker was an agent of the Kubernetes cluster worker node and is<strong> integrated internally with the kubelet source code</strong>. This creates a significant <strong>maintenance overhead.</strong></p><h3>CRI (Container Runtime Interface)</h3><p>To support different container runtimes without modifying the kubelet’s code, a <strong>specification has emerged to unify the interface between the kubelet and container runtimes</strong>. This is <strong>CRI.</strong></p><p>It is a gRPC-based API specification that manages the lifecycle of containers, including creation, deletion, and so on, and the new container runtime can implement CRI components according to the CRI specification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*bRjAN-jhqzJ8uY9NsFka0A.png" /></figure><p>This provides a<strong> clearly defined abstraction layer</strong>, allowing developers to focus on building container runtimes</p><p>To summarize the above..</p><ul><li>The number of supported containers keeps growing → The problem of having to re-implement CRI separately for each new container is a problem.</li><li>So, they decided to standardize the container runtime itself so that new container runtime plugins can be added without code changes to the kubelet(as long as they meet the CRI specification).</li><li>The resulting specification was the OCI.</li></ul><blockquote>💡 OCI is the image (the standard form of the image you build), CRI is the interface for containers to receive k8s commands<br>kubelet — -CRI — -&gt; CRI-Plugin — -OCI — -&gt; Containered-shim, oci-runtime</blockquote><p>Let’s recap the pod creation process.</p><h4>Create a Pod(group of containers)</h4><ol><li>Request the API server to create a Pod</li><li>Node allocation by Scheduler</li><li>Pod creation by the kubelet(in node)</li><li><strong>Container creation by CRI</strong><br>- kubelet sends a request to Container Runtime via CRI to create each container according to the specification.<br>- Container Runtime fetches container images from the registry according to the OCI specification and creates containers based on them.</li><li>Run the container</li></ol><h3>Kubernetes and Docker part ways</h3><p>Containers are managed on top of a runtime engine. And the runtime engine sits between the container and the hardware, and allows them to communicate with each other so that the container can perform the necessary computations. Representative container runtime engines include containerd, runc, cri-o, etc..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*oyU-1ZL6Y4EEExbRqwS-tA.png" /></figure><p>Docker Engine is also a container runtime engine and includes containerd and runc. <strong>Docker Engine is not a single package, but is divided into containerd(high-level) and runc(low-level) to manage containers, both of which are OCI compliant.</strong></p><p>The early Docker Engine packaged container management tools for user convenience. And later Kubernetes, a container orchestration tool, adopted docker as its container management tool to provide compatibility.</p><p>Because Docker existed before the CRI specification was invented, the Kubernetes project created an adapter component, dockershim, which allows kubelet to interact with docker as if it were a traditional CRI-compliant runtime.</p><p>However, as Docker updates its version, dependency issues with Kubernetes start to arise. In addition, the number of container runtimes has increased, and <strong>CRI has emerged to support multiple container runtimes without modifying the kubelet</strong>.</p><p>They decided that continued support for Docker(dockershim) was inefficient and unnecessary, so Kubernetes now does not support docker since v1.24</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*BE6YgfuWvbZ2JBVFRwRdhQ.png" /></figure><p><strong>Docker is not CRI compliant, but OCI compliant, images built with docker can still be used with other container runtimes(containerd or cri-o) that follow the OCI standard.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da67b2a26d17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Auto Ansible : AWX]]></title>
            <link>https://dusdjhyeon.medium.com/auto-ansible-awx-c89941bb95f3?source=rss-de4e20f215c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c89941bb95f3</guid>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[awx]]></category>
            <dc:creator><![CDATA[dusdjhyeon]]></dc:creator>
            <pubDate>Mon, 11 Mar 2024 06:36:54 GMT</pubDate>
            <atom:updated>2024-03-11T06:42:26.840Z</atom:updated>
            <content:encoded><![CDATA[<h3>Auto Ansible : AWX</h3><p>I was initially preparing to use Ansible to efficiently control and configure a large number of instances.</p><p>I was on an internship and would be leaving soon,, so I decided to prepare for the introduction of AWX, which would allow me to run <strong>Ansible scripts in a GUI environment</strong> for the convenience of my coworkers after I left.</p><p>It never actually materialized for security reasons, but it was an interesting service, so I though I’d summarize it.</p><h3>Ansible</h3><h4>What is Ansible</h4><p><strong>Ansible</strong> is an <strong>open source IaC solution and IT automation tool </strong>developed in <strong>Python</strong>. It allows you to automate and manage IT tasks via YAML or JSON, including configuring systems, deploying applications, and more.</p><p>Ansible replaces shell scripts, which can be difficult to manage when the resources or number of servers grows exponentially, and is suitable for managing any environment, from small to enterprise environments managing thousands of servers.</p><p>To summarize the benefits:</p><ul><li>SSH communication for agentless management</li><li>Easy, readable</li><li>Idempotency (that doesn’t change over multiple operations)</li></ul><h4>Ansible usage scenarios</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*YFqehAP_KSg3HChNjJ6ZnQ.png" /></figure><ol><li>Start working on the Control Node, which is the server where Ansible is installed.</li><li>The Control Node has an <strong>Inventory </strong>file. This file lists the target service on which you want to install the web server(: the IP addresses or domain names of the hosts, the host groups, and so on.. )</li><li>Run the <strong>Playbook </strong>that defines the tasks to install and configure the web server. This Playbook is written in <strong>YAML</strong>.</li><li>These defined Tasks are related to each other and can be collected together and defined as a single Role.</li><li>Now when you run the playbook, the Control Node connects to each Host specified in the Inventory and performs the <strong>Task</strong>s defined by the Role.</li><li>The Tasks are performed with the User permissions specified in the Playbook or Inventory(become)</li><li>If all tasks are successfully executed, the web server installation and configuration is complete.</li></ol><p><strong>Playbook Structure</strong></p><ul><li>Inside the Playbook, there are several Tasks, each of which uses a specific Module to perform a Task.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*8WN8_gWx771NZIp-R8-5IQ.png" /></figure><h4>How to use Ansible</h4><ol><li><strong>Ansible Ad-Hoc</strong></li></ol><p>Performing a single task is called an Ad-Hoc Command and can be executed, for example, as show below.</p><pre>ansible [pattern] -m mode [-a &#39;module options&#39;] [-i inventory] </pre><pre># ex) Run the ping module test against the hosts in the group named aws_ec2.<br>ansible -m ping aws_ec2</pre><p>More details about pattern are available in the docs : <a href="https://docs.ansible.com/ansible/latest/inventory_guide/intro_patterns.html#intro-patterns">https://docs.ansible.com/ansible/latest/inventory_guide/intro_patterns.html#intro-patterns</a></p><p><strong>2. Playbook</strong></p><p>If you need to run a combination of tasks, you can also write a collection of tasks, which we call a playbook. Below is code to set the root password, and load the role responsible for the default installation of k8s.</p><pre>--<br>- hosts: all<br>become: yes<br>vars_files:<br>- secrets.yml<br>vars:<br>os: xUbuntu_22.04<br>crio_version: 1.28<br>pre_tasks:<br>- name: Set root password<br>user:<br>name: root<br>password: &quot;{{ root_password | password_hash(&#39;sha512&#39;) }}&quot;<br>roles:<br>- k8s_default</pre><pre>#Execution<br>ansible-playbook -i aws_ec2.yml setup.yml</pre><h3>AWX</h3><h4>What is AWX</h4><p>An <strong>Open Source version of Ansible Tower</strong>, system that allows you to manage <strong>Ansbile with GUI and control it with an API.</strong></p><p>AWX is the nature of the <strong>middleware</strong> that runs the Ansible language. There’s very little Ansible can do without playbooks, so it’s really all about developing Ansible playbooks.</p><p>And,, AWX provides many of the features you need to manage and operate your playbooks.</p><p>It provides the following features:</p><ul><li>Ansible Project Management and Host Management</li><li>Provisioning and Configuration Management</li><li>CD(Continuous Delivery) &amp; Workflow Template</li><li>Centralized logging/audit</li><li>Authentication integration (LDAP, SAML, GitHub, Google, Azure AD)</li><li>Visualized web dashboard</li><li>High availability</li></ul><h4>How to install AWX</h4><p>I’ve kept it simple. For more information, please refer to the links below.</p><ul><li><a href="https://github.com/ansible/awx">https://github.com/Ansible/awx</a></li><li><a href="https://github.com/ansible/awx/blob/devel/INSTALL.md">https://github.com/Ansible/awx/blob/devel/INSTALL.md</a></li></ul><blockquote>Note that AWX installs on top of Docker on Linux OX up to version 17 (k8s is also possible), and from version 18 onwards, AWX defaults to installing on top of Kubernetes (no Docker support).</blockquote><p>I turned on the virtualenv venv and proceeded. If you have venv enabled, you will need to replace the <strong>ansible_python_interpreter path</strong> in ~/awx/installer/inventory with the venv python path. And, installation methods may vary from environment to environment.</p><pre># Install Ansible<br>$ yum install ansible -y <br><br># Install pip<br>$ yum isntall python3-pip <br><br># Install Docker<br># https://github.com/docker/docker-py/issues/3194<br>(venv)$ pip install docker==6.1.3<br><br># Install Docker Compose  <br>(venv)$ pip install docker-compose <br><br># Install Git &amp; AWX 17.1.0 <br>yum -y install git <br>git clone --branch 17.1.0 --single-branch https://github.com/ansible/awx.git<br><br># Configuration<br>cd ~/awx/installer   # It is related to my AWX path <br>vi inventory    # This file contains the env information required to install AWX <br># admin_password=password &lt;-- Uncomment : change password you want <br># project_data_dir=/var/lib/awx/projects &lt;-- Uncomment  <br><br>yum -y install libselinux-python3<br>ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose<br>ansible-playbook -i inventory install.yml -b<br><br># Confirm <br>docker ps</pre><h4>About AWX</h4><p>AWX is not an automation tool per se, it’s more about providing an environment to help organizations use the Ansible code developed for automation, so the features it provides are aimed at managed lists, registering accounts, registering SCM information, and finally creating templates that actually do the work in order to run the Ansible code developed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*eEzrg44Ser_juFie-vFfGA.png" /></figure><p>The components of AWX include..</p><p><strong>Nginx</strong></p><ul><li>This is a web server that acts as a reverse proxy, loadbalancer, mail proxy, and HTTP cache.</li><li>In AWX, it is responsible for routing client requests to the appropriate services and delivering responses from those services to the client.</li></ul><p><strong>PostgreSQL</strong></p><ul><li>This is the main database used by AWX. It stores information such as AWX’s settings, user info, and job results.</li><li>PostgreSQL provides features such as transactions and recovery, subqueries, triggers, and replication to support the reliability and scalability of AWX.</li></ul><p><strong>Redis</strong></p><ul><li>This is an in-memory data structure store that is used as a database, cache, message broker, and so on.</li><li>In AWX, it is responsible for fetching and processing messages from the job queue.</li><li>It is also improves performance by caching state information, job results, and etc.</li></ul><p><strong>RabbitMQ</strong></p><ul><li>This is a message broker, which is responsible for asynchronous message delivery between AWX components.</li><li>In AWX, it’s responsible for enqueuing job requests and letting Redis handle them.</li></ul><p>The way AWX works is roughly as follows</p><ol><li>A user requests to run an Ansible Playbook through the AWX web interface.</li><li>The request is passed through Nginx to the AWX API server.</li><li>The AWX API server passes the request to RabbitMQ, which adds it to the job queue.</li><li>Redis fetches the job from RabbitMQ’s job queue and processes it.</li><li>The job’s execution results are stored in a PostgreSQL database and cached by Redis if necessary.</li><li>The user can view the job’s execution results through the AWX web interface.</li></ol><h4>Using AWX</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*Su7C_3t1rIPc7BHYTA3AEg.png" /></figure><p>Let’s take a look at just a few of the highlights of the sidebar UI.</p><p><strong>Credentials</strong></p><ul><li>Register permissions to access a target</li><li>The target can be a server, or it can be Github. Typically, you would register an SSH private key or password to access the server so that it is available to authorized users without exposing its contents.</li></ul><p><strong>Projects</strong></p><ul><li>Manage projects in SCM, that is, in Git or SVN, typically used as a unit of service.</li><li>For example, create credentials to log in to Git and associate them with projects to clone sources from Git.</li></ul><p><strong>Inventories</strong></p><ul><li>A list of target servers to work with, either as a list of IPs or IP lookupable hostnames.</li><li>You can list servers one by one, or you can manage them in groups, or you can include groups within groups.</li><li>When using Ansible directly, you create and mange a hosts file, but AWX supports building lists using several sources.</li></ul><p><strong>Templates</strong></p><ul><li>Gain access to the server in the Inventory list with credentials to run the playbooks in your project.</li></ul><p>If you have an idea of Ansible, using the GUI, AWX, shouldn’t be too difficult. So, let’s just talk about Instance Groups of a moment and wrap things up.</p><blockquote>AWX has something called<strong> Instance Groups</strong>, which you should know is <strong>different from Inventory</strong>.</blockquote><p>An instance group in AWX is a structure for managing the computing resource on a system used to process AWX jobs. In other words, an instance group represents a collection of AWX instances running Ansible playbooks.</p><p>By managing multiple instances together as an instance group, you can valance the load of AWX jobs. This prevents the load from being concentrated on a single instance and improves the performance and reliability of the overall system.</p><p>On the other hand, AWX’s inventory is a structure that manages the hosts that are the target of Ansible jobs.</p><p>The link below shows a simple example of adding an instance named task. Please refer to it if necessary.</p><p><a href="https://github.com/dusdjhyeon/eztest-awx-cluster">https://github.com/dusdjhyeon/eztest-awx-cluster</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c89941bb95f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Networking]]></title>
            <link>https://dusdjhyeon.medium.com/kubernetes-networking-5033a7a232ae?source=rss-de4e20f215c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5033a7a232ae</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[dusdjhyeon]]></dc:creator>
            <pubDate>Sat, 10 Feb 2024 15:04:43 GMT</pubDate>
            <atom:updated>2024-02-14T01:18:54.847Z</atom:updated>
            <content:encoded><![CDATA[<p>A Kubernetes network is basically like a Docker network, but different. Let’s get a quick understanding of container networking in Docker, and then move on to networking in Kubernetes.</p><h3>Today we will cover :</h3><ul><li>Container to Container Communication</li><li>Pod to Pod Communication</li><li>Pod to Service Communication</li><li>External to Service Communication</li></ul><h3>Docker Network</h3><p>When you create a <strong>container</strong>, it is allocated its own <strong>independent network space</strong> using a virtualization technique implemented through the <strong>NET namespace</strong> (which partitions information related to network resource and assigns them to different namespaces).</p><p>So, how do containers communicate with the external or with other containers?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*QJA6wrQPv7cq_QbscAMPEA.png" /></figure><ul><li>By default, Docker allows containers on the same node(host) to communicate with each other via a virtual network interface called docker0.</li><li>When you create a container, the container is assigned a network interface called veth0(virtual ethernet) to communicate with the host.</li><li>The host is also assigned a network interface called eth0.</li><li>Each Container has a shared virtual network interface called veth, so they can communicate with their each veth IP address values.</li></ul><blockquote><em>The veth0 interface assigned to a host is bound to docker0, which in turn is associated with the host’s eth0 network interface to handle requests from the external network.</em></blockquote><h3>Kubernetes Network</h3><p>Kubernetes network communication is categorized into 4 main categories</p><ul><li>Container to Container Communication(combined with each other)</li><li>Pod to Pod Communication</li><li>Pod to Service Communication</li><li>External to Service Communication</li></ul><h3>Container to Container Communication(combined with each other)</h3><p>Unlike Docker, Kubernetes manages containers on a<strong> per-Pod </strong>basis. So we give the network interface <strong>veth0</strong> to a Pod, a group of containers, rather than to an individual container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*jmk8oTbQd5OMOBNt2rNCHg.png" /></figure><ul><li>Containers can all be given<strong> same IP </strong>by the pause container that exists in each pod.</li><li>When a Pod is created, the containers in the Pod have one interface IP in the network namespace of the<strong> pause container</strong>.</li><li>So, they can communicate with each other on the<strong> same network(veth0)</strong> as localhost, using<strong> different port </strong>numbers.</li></ul><h3>Pod to Pod Communication</h3><p>It can communicate over a network interface (kubenet or cni) with a unique IP address assigned to the Pod. There are two conditions.</p><ul><li>Pods on a Single-Node</li><li>Pods on Multi-Nodes</li></ul><h4>Pods on Single-Nodes</h4><p>Each Pod can communicate with each other with a<strong> unique IP</strong> address(virtual network interface veth) through a network interface configured with <strong>kubenet</strong> or <strong>CNI</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*zmor_Ks7vDX95wIzB0uMYg.png" /><figcaption>The figure shows an example of Flannel CNI</figcaption></figure><ul><li>By default, Kubernetes provides a network plugin called<strong> kubenet</strong>, but it’s really just a network plugin that provides very basic and simple functionality.</li><li>It doesn’t implement advanced features like <strong>cross-node networking</strong> or <strong>network policy settings</strong> on its own.</li><li>Therefore, Kubernetes recommends using a variety of network plugins that conform to the<strong> CNI</strong> specification as the Pod networking interface.</li><li>As a side note, kubeadm, the dedicated CLI for building clusters provided by Kubernetes, only allows the use of CNI-based network plugins by default.</li></ul><h4>Pods on Multi-Nodes</h4><p>Between multiple worker nodes, Pods that reside on different nodes will need to go through a <strong>Router/Gateway</strong> to communicate with each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SjA_cFKXiaUqzqLmiwkP6g.png" /></figure><ul><li>To implement the Overlay Network feature, communication is routed through the <strong>CNI </strong>and the <strong>Router</strong>.</li><li><strong>Overlay Network</strong> : End-to-End communications using network virtualization technology over physical infra</li><li>Pod → veth → CNI → eth → <strong>Router</strong> → eth → CNI → veth → Pod</li></ul><h3>Pod to Service Communication</h3><p>Since <strong>Pods in Kubernetes are essentially easily replaceable</strong> entities, it is inappropriate for them to communication with Service over IP addr. Therefore, the solution is to place a <strong>Reverse Proxy (or LoadBalancer)</strong> in front of the Pod.</p><p>When a client connects to the proxy, the proxy’s role is to manage a list of servers and direct traffic to the currently live server.</p><p>There are few requirements for this:</p><ul><li>The proxy server itself must be durable and able to respond to failures.</li><li>It must have a list of server to forward traffic to.</li><li>It needs to know how to verify that the servers in the list are healthy.</li></ul><p>The Service is an abstract resource that satisfies this condition and acts as a <strong>Reverse Proxy to forward traffic to the Pods</strong>. (It can use selectors to determine which pods should receive traffic)</p><p>This means that inside the cluster, communication will go through the Service’s virtual IP.</p><p>However, while the Pod network actually has a veth(Virtual Ethernet Network Interface) set up and can be viewed in ifconfig, the Service can’t be viewed in ifconfig. You also won’t find a route to the service network in the routing table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*vc-3SAz1mcZRXummvDRr_w.png" /></figure><p>In this picture, the process for Web Pod to request resources from a WAS is as follows:</p><ol><li>Web Pod requests resources from WAS Service</li><li><strong>CoreDNS</strong> maps the Service name ‘Server-svc’ to the Service’s IP (10.3.241.152)</li><li>Web Pod requests packets to Service at (10.3.241.152:80)</li><li>Worker Node1’s veth doesn’t know the IP of that service, so it forwards the packet to it’s parent gateway</li><li>cni0 also doesn’t know the IP of the Service, so it forwards the packet to the parent gateway</li><li>etho0 also doesn’t know the IP of Server-svc, but it doesn’t forward packets directly to the parent gateway<br>It forwards the request based on the <strong>Chain Rule</strong> defined in <strong>kube-proxy’s</strong> <strong>netfilter</strong> (looking for a rule that maps to the service’s IP addr)<br>Packet flow is controlled by a component called kube-proxy</li><li>Forwarded to Worker Node2 by the routing table defined in the Router</li><li>Netfilter on the eth1’s kube-proxy is listening for packets and forwards them to cni1 if they come in</li><li>cni1 is a simple bridged network, so it passes the packet to the lower layer</li><li>Packet reaches Server-svc and it hands the packet to the mapped Pod</li></ol><blockquote><em>IP (Layer 3) by default forwards packets to a higher gateway if it does not find a destination on its own host.</em></blockquote><h4>kube-proxy</h4><ul><li>Once you create the pod, kube-proxy will dynamically create a chain rule in netfilter using iptables. So,<strong> forwarding requests by chain rule</strong>.</li><li>The chain rule can be verified by ssh into the node where the Pod was created and running iptables -t nat -L.</li><li>Discovering the Service IP and forwarding it to the actual Pod is all done by netfilter, and kube-proxy does not directly act as a proxy, it simply modifies netfilter’s rules accordingly.</li></ul><h3>External to Service Communication</h3><p>Every service is given an IP address called <strong>ClusterIP</strong> and uses it internally in the cluster to forward traffic to the Pods. Behaves to forward intra-cluster traffic from &lt;ClusterIP&gt; to &lt;PodIP&gt;:&lt;targetPort&gt; on the corresponding Pod.</p><p>This means that by default, Service is designed to <strong>communicate internally </strong>within the cluster.</p><p>Then, how does it communicate with the external?</p><p>The following things can enable a service to communicate externally:</p><ul><li>NodePort Type</li><li>LoadBalancer Type</li><li>Ingress</li></ul><h4>NodePort</h4><p>When you create a Service of type NodePort, kube-proxy assigns a random port between<strong> 30000–32767</strong> to the eth0 network interface of the associated node.</p><p>When a request comes in from the external to a specific port &lt;NodeIP&gt;:&lt;NodePort&gt; on a node IP, it is forwarded to the mapped ClusterIP(Service) and forwarded to a specific Pod.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*UlzO_i_T9Poj_D1g3Vd_Yg.png" /></figure><p>Creating a NodePort causes the following changes internally in Kubernetes:</p><ul><li>Assign all VMs a random port in the range 30000–32767</li><li>Create a service of type ClusterIP for the Pods matching the selector</li><li>Modify the chain rule in netfilter so that kube-proxy forwards it</li></ul><h4>LoadBalancer</h4><p>A type of Service that can be provisioned as a Service in a cluster, considering <strong>cloud environments</strong>(AWS, Azure, GCP, etc..) that provide a separate external load balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*E4o2lSym39uoRjOkZuoSLg.png" /></figure><h4>Ingress</h4><p>Ingress exposes <strong>HTTP</strong> and <strong>HTTPS</strong> routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource.</p><p>In other words, it is a resource that specifies how it should be forwarded through a <strong>reverse proxy</strong> to a service inside the cluster.</p><p>An Ingress may be configured to give Service <strong>externally-reachable URLs</strong>, <strong>load balance traffic</strong>, <strong>terminate SSL/TLS</strong>, and <strong>offer name-based virtual hosting</strong>.</p><p>An Ingress does not expose arbitrary ports or protocols. Exposing services other than HTTP and HTTPS to the internet typically uses a Service of type NodePort or LoadBalancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*gLRdxliK96K264U6Csgk0Q.png" /></figure><p>However, Ingress is a prerequisite and requires an <strong>Ingress Controller</strong> to fulfill Ingress. The Ingress controller is not automatically run and must be implemented by selecting the best controller for your cluster.</p><p>The Ingress Controller is responsible for forwarding requests to the appropriate service. It is typically responsible for performing ingress using a load balancer, but you can also configure edge routers or additional front-end to help handle the traffic.</p><p>The officially supported Ingress Controllers for Kubernetes are <strong>AWS</strong>, <strong>GCP</strong>, and <strong>Nginx</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5033a7a232ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>