<?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 Mengying Li on Medium]]></title>
        <description><![CDATA[Stories by Mengying Li on Medium]]></description>
        <link>https://medium.com/@mengying-li?source=rss-dbd909ab7ead------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OSkgz1_TZgSIGVJwXI7dQg.jpeg</url>
            <title>Stories by Mengying Li on Medium</title>
            <link>https://medium.com/@mengying-li?source=rss-dbd909ab7ead------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 17:47:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mengying-li/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[3 Unique and Effective Tips For Launching Entry Level Software Engineer Position]]></title>
            <link>https://mengying-li.medium.com/3-unique-and-effective-tips-for-launching-entry-level-software-engineer-position-81b436caa4fa?source=rss-dbd909ab7ead------2</link>
            <guid isPermaLink="false">https://medium.com/p/81b436caa4fa</guid>
            <category><![CDATA[job-search]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[layoffs]]></category>
            <category><![CDATA[new-grad]]></category>
            <category><![CDATA[tips]]></category>
            <dc:creator><![CDATA[Mengying Li]]></dc:creator>
            <pubDate>Sun, 26 Feb 2023 06:27:52 GMT</pubDate>
            <atom:updated>2023-02-26T06:27:52.272Z</atom:updated>
            <content:encoded><![CDATA[<h4>Job Search Techniques During Hard Time — Part 2</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*KhEB8TGQCoU1Cv04" /></figure><p>If you haven’t check my previous article, I highly recommend you to check it out. Here’s the <a href="https://medium.com/@mengying-li/from-zero-to-one-how-i-found-my-first-software-engineer-job-out-of-college-30d3ebba51a5">link</a> to part 1 of my job searching blog series where it’s focused more on my personal experience. On part 2, I would like to shine lights on some summarized tips on how everyone can effectively launch a software engineer job with their dream company out of college. Trust me, it’s not one of those generalized job searching tips you can get from your career center or other blogs. These tips are unique and actionable and will help you to launch an interview with your dream company even at hard time like right now.</p><h3>Tip 1: Find uncommon platform (e.g. KubeCon) to hand your resume and create impression</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*RU7T0_v6igt_KdqU" /></figure><p>There were a few common ways to launch a job as a student: going to a career fair, attending a company lecture hosted on campus, going to a company office hour and, if you are a girl, going to the Grace Hopper conference. While these are great path to launch your first job out of college, they don’t work particular well for someone who have a less strong resume among your peers (like me). Or someone who’s simply less lucky in passing resume screening.</p><p>This is where you will need some uncommon platform to make yourself shine. The logic is very simple. If there are fewer candidates, you have a higher chance of success. Grace Hopper is a great example of a conference where you have less competitors (sorry boys), but it’s no longer the case. With so many participants, it’s just turning into another job fair outside campus. If you can find some other conferences like KubeCon to turn in your resume to certain positions, believe me, it’s ten thousands time easier to make good impression with the recruiter or engineer for that position.</p><p>Some examples conferences maybe you can try to look into are:</p><ul><li>PyCon: <a href="https://us.pycon.org/2023/">https://us.pycon.org/2023/</a> (surprisingly it has job fair listed)</li><li>DevOpsCon: <a href="https://devopscon.io/continuous-delivery-automation/">https://devopscon.io/continuous-delivery-automation/</a></li><li>KubeCon: <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/">https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/</a></li></ul><p>In fact if you look into any widely adopted technology (ranging from programming language to popular tooling), you can find a conference around it. Maybe for FAANG company they only collect resume from online portal and don’t take resume from other places. For any other company (especially mid-market or startup companies), talking with the recruiter or engineers at the conference, ask if they have a position for new grad and hand in your resume might work better than you think. Just treat it as a job fair and try to build real connections.</p><h3>Tip 2: Differentiate yourself from other candidates</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hM41tFnGX4v27i8_" /></figure><p>I remember I collected resume once for a company at a campus career fair. I collected a thick pile of resumes in 2 hours (roughly guessing 200+). For each resume I had less than 1 min to read and decide to put on the pile of potential good candidates. If you have any well known company’s internship or amazingly high GPA, your resume undoubtedly stand out considering most of us could only launch internship at less known companies as second or third year undergrads.</p><p>Another thing which stood out to me was that all college students resumes look way too similar. Let me describe what I see in students’ resumes: internship experience on web development, machine learning projects and web project at school, high GPA, long list of CS classes you’ve done. A huge portion of resumes have all the elements I mentioned above. I can imagine the pain of any recruiter trying to differentiating each candidate’s resume.</p><blockquote>Finding your unique sparkle and showcase that is the way to shine.</blockquote><p>Being passionate to learn more about Kubernetes created a unique background for me. At KubeCon, I showcased my passion for infrastructure simply by attending the talks at the conference and actively discuss with the engineers at the booth. These created a good impression on the recruiters and engineers because there were very few new grads who were into Kubernetes. They can easily remember me, and it might create a clearer vision to place me in an infrastructure team which works closely with Kubernetes. Notice I don’t have any experience for Kubernetes (or very little in infrastructure in general) at the time. Simple showing my passion and willingness to learn is convincing enough to give me am interview opportunity for many companies.</p><h3>Tip 3: Don’t follow the crowd</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*DQIItT38rDH5nNKz" /></figure><p>Everyone knows the competition is getting worse and worse for computer science industry these years. Especially when it comes to getting an internship or launching your first job out of college. The competition is brutal.</p><blockquote>There’s way too many candidates for not enough positions.</blockquote><p>What makes things worse is that we all took the exact same computer science class in college. The first programming language I learned in school is Java which they use to teach you objective oriented programming. Later I did some C++ class and worked on some web project in class. Naturally when I started my job search, I felt most confident with Java and aimed for some backend web job using Java. I tried some html and jquery in the web project and already made up my mind that I don’t like frontend. AI, big data was also very trendy in school at the time and I took lots of related classes with my friends. So getting a data science or machine learning internship is also my dream.</p><p>As you can probably guess, half of the students in the same college want to find backend job, the other half want to find data science (or machine learning) job. I have three evidence supporting my rough observation, myself, my CS friends and the resumes I collected at job fair. These were two types of jobs I applied to the most because I felt I matched what they were looking for and had higher chance. Naturally, a great portion of students from my college also reached a similar conclusion. Voilà, the competition begins.</p><p>Now, I realize there are many undervalued fields that are blue seas and much less crowded. For example, infrastructure engineers (also called Site Reliability Engineers) and data engineers are always having trouble finding candidates because the demand is bigger than supply. I can say with confidence 99% of college students have no clue what these positions are about and never heard of them. Let along applying for it when they graduate.</p><blockquote>Undoubtedly there are some gaps between the job market and school.</blockquote><p>I know these facts can be hard to find as a student. But all I’m saying here is that try to stay open minded. Looking back I found there are many hidden discrimination chain between the classmates:</p><ul><li>Machine learning is better than any other fields in software engineer</li><li>Customer facing team is better than internal tooling team</li><li>Backend is better (and more challenging) than frontend</li></ul><blockquote>The standard for “best job” is singular at college.</blockquote><p>This is a very typical student mindset which might be deeply rooted getting an A grade is better than getting a B grade in a class. But there is no such thing as a A grade job in adult life. While launching your first job at a famous company (FAANG) is great, it doesn’t mean launching a job at smaller company is worse option or a sign of failure. Similarly, getting to an internal tooling team is equally as great as getting to a customer facing team. In fact, as an infrastructure engineer myself, I prefer going to internal tooling team than a product team. And of course, frontend and backend are equally great jobs and are both challenging.</p><blockquote>Find your own path and do not follow the crowd.</blockquote><p>I found my own passion and became an infrastructure engineer and I sincerely hope you can one day too. On a more practical angle, this blue sea area gave me a lot more opportunities compare to red sea like web development and I was able to launch multiple job interviews and have a greater success ratio to get an offer. One example, if you are applying for Meta, I know that production engineer position have a lot less candidates than regular software engineer position. We all know what this means. Even if the production engineer requirement are not essentially lower, you still have a higher chance of launching the interview and a job offer. This is because they are more willing to take on you and train you to become a qualified production engineer. I’ve met multiple interviewers who mentioned they had trouble recruiting infrastructure engineers for years and are happy to see me interviewing. On the other hand this might explain why you feel you are so qualified for some web backend SDE position using java but never heard back. Thousands of other candidates also qualifies so only the best of the best will get interview. They lose motivation to give you an opportunity when the perfect candidate who have more experience than you is already there.</p><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*B71OaDw8OSxBJ9u1" /></figure><p>All my three tips tie with one another and reinforce each other. Finding your own unique sparkle really helps you to launch your first interviews. If the regular job searching path don’t work for you, experiment and create your own path.</p><p>Hope everyone can find their ideal job ; )</p><p>If you feel inspired, give me some claps or comment below and let’s discuss more. If you happen to be Seattle we can also chat offline over a cup of coffee. Feel free to get in touch with me over <a href="https://www.linkedin.com/in/mengying-li-madeline/">linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81b436caa4fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Zero to One: How I Found My First Software Engineer Job Out of College]]></title>
            <link>https://mengying-li.medium.com/from-zero-to-one-how-i-found-my-first-software-engineer-job-out-of-college-30d3ebba51a5?source=rss-dbd909ab7ead------2</link>
            <guid isPermaLink="false">https://medium.com/p/30d3ebba51a5</guid>
            <category><![CDATA[job-search]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[new-grad]]></category>
            <category><![CDATA[layoffs]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Mengying Li]]></dc:creator>
            <pubDate>Sun, 26 Feb 2023 06:20:44 GMT</pubDate>
            <atom:updated>2023-02-26T06:29:37.926Z</atom:updated>
            <content:encoded><![CDATA[<h4>Job Search Techniques During Hard Time — Part 1</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKLdkjDAw8bAEgr7rms2oQ.jpeg" /><figcaption>The universe starts from big bang, just like job search, all start from 0 to 1</figcaption></figure><p>Yes, I’ve wanted to discuss this topic for a long time. Now, I’ve been working in the software engineer industry for 3 years. Looking back, I would like give some tips and suggestions to the new grads of year 2023. It’s an undoubtedly very tough year with non-stopping layoffs news and a cold job market. I hope hearing my relatively unusual journey to launch my first job out of college will give you some inspiration on your job search journey.</p><h3>My journey of Launching My First Job</h3><h4>A little about myself</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSkgz1_TZgSIGVJwXI7dQg.jpeg" /></figure><p>I was a regular undergrad from a public university who studied Math and Computer Science Joint Major with a not so high GPA (compared to my asian peers) and no FAANG internship experience. I delayed my graduation to give myself more buffer time to launch an ideal job. At the time, the job market was neither too hot nor too cold. But it still has been a hard battle for me competing with thousands of CS graduates from my own school with not enough new grad positions at the top tech company. I applied to over 100 companies ranging from companies you’ve heard of, to company less known, and yet, barely heard back from any company.</p><p>Trust me, I’ve tried to get a return offer from the company I interned for 7 months. But my effort did not pay off as the company was going through some changes and froze hiring. I’ve tried some hacks suggested by my friends and online tips, like giving myself a feminine english name on my resume so that I can get more noticed from the recruiters since the rumor has been that companies try to give more interview opportunity to females. I’ve also tried standing in line for hours in career fairs, actively participating at company events held on campus, going to hackathons and talking with sponsor companies. I can’t say these method don’t work 100%. All I can say is that they did not create a noticeable difference for me at that time. I still got no leads to phone interview at decent companies and was quite desperate as an international student hoping to launch a job in US. Icing on the cake, I don’t seem to do too well on these online assessments (if you know what I’m talking about).</p><h4>Things start to turn around at an unexpected event: KubeCon</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*d_0kDMVxNmM0X2aW" /><figcaption>KubeCon 2019 at San Diego</figcaption></figure><p>During my internship, my team was casually checking out potential migration to a new technology called Kubernetes. Some of my friends told me there’s a conference called KubeCon and I should check it out. It’s held in San Diego in 2019, which was convenient for me as I was living there. I made a bold decision that time, paid myself a student ticket and attended with 0 Kubernetes knowledge.</p><h4>I turned lucky in job search at KubeCon</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7CUmBYUJjqU3LnEOtl7djw.jpeg" /></figure><p>My first experience with KubeCon was amazing. It changed my entire career path and impacted me until today. Besides attending many very beginner friendly tech talks and learning tons of infrastructure knowledge, my most unexpected gain is that I successfully launched multiple job interviews through KubeCon with some leading to eventual job offers working on Kubernetes related team.</p><h4>KubeCon became a very effective job fair for me</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P6RAMGkQATUNeXFCb5v3kw.png" /></figure><p>Just like the job fair at college, there are many booths for each sponsoring companies. We all know that tech giants like Google, Meta and Oracle are not the users of Kubernetes because they have their own in house container orchestration solution. But the sponsoring company quality is amazing nonetheless because they are essentially using cutting edge technology and do further development on top of Kubernetes. They are also doing well financially as they are willing to put real money to become a Kubecon sponsor. Some booths I visited were renowned companies like Reddit, Intuit, Datadog, Elasticsearch and Microsoft etc. I spent my after conference social time to talk to every one in the booth and ask if they are recruiting new grad. If they are, I handed them my resume and left their contact info. I tried socializing with the tech talk presenter if they mentioned their team is hiring. There’s even a job posting board at the conference. Of course, I applied to almost all the job position listed there that matches my level by sending an email to the address on the board. I actually was able to get a strong reference from an employee of one of my dream company because she saw my email and appreciated how proactive I was.</p><blockquote>By being proactive and showing my strong interest in learning more about infrastructure and Kubernetes, I was able to get very good response from the company and recruiters with 0 experience in infrastructure.</blockquote><p>Everyone was so friendly and encouraging at the conference. Many of them told me they didn’t had any Kubernetes experience before and started learning in the job. Naturally, I heard back from multiple companies after KubeCon and successfully scheduled my first round of technical interviews. Ball started rolling from there and I was able to launch some offers with some amazing companies after the interviews.</p><h4>Looking back, I believe my success is definitely replicable for anyone who is struggling with launching a job</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvDSJAIeuRWaSiPByViFVQ.jpeg" /></figure><p>I believe there are a few things I did correctly that led to launching my first job. These are also the common things I missed out as a college student. Here I’m giving out some uncommon tips to all the fellow new grads to give you a new perspective on job seeking. You can probably tell through my personal experience where the biggest pain point for me at the time: <strong>launching my first round of phone interview with a company</strong>. I have the interview skills to pass the technical or behavior interviews in following rounds. But 90% of the time I don’t hear back at all. In fact, I would argue for most new grads if they can launch enough phone interview with different companies, their chance of launching one successful job offer is much greater. Sometimes you just need some extra methods when you are not so lucky in passing the resume screening (like me).</p><h3>To be continued …</h3><blockquote>I know job searching is hard. But don’t give up yet!</blockquote><p>Hope my experience can inspire you to keep trying. More importantly, I summarized some tips on how you can turn your situation around and launch your dream job.</p><p>Check out my second part blog article to learn more:<br><a href="https://medium.com/@mengying-li/3-unique-and-effective-tips-for-launching-entry-level-software-engineer-position-81b436caa4fa">3 Unique and Effective Tips For Launching Entry Level Software Engineer Position</a></p><p>Also here’s some past blog article if you are interested to learn about Kubernetes, Istio or infrastructure related content: <br><a href="https://medium.com/@mengying-li/two-easy-ways-to-determine-right-size-for-aws-rds-instance-through-request-mirroring-load-test-9cd6e8ac8b5c">Right-Sizing AWS RDS? Request Mirroring Load Test Come To Rescue<br></a><a href="https://medium.com/better-programming/why-do-we-use-kubernetes-anyway-644544082f43">Why Do We Use Kubernetes, Anyway?</a><br><a href="https://medium.com/@mengying-li/clean-up-your-room-b25ad40ffc0b">Clean up your room! What do you need to delete in K8s and Istio when dealing with unused application</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30d3ebba51a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Right-Sizing AWS RDS? Request Mirroring Load Test Come To Rescue]]></title>
            <link>https://medium.com/coursera-engineering/two-easy-ways-to-determine-right-size-for-aws-rds-instance-through-request-mirroring-load-test-9cd6e8ac8b5c?source=rss-dbd909ab7ead------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cd6e8ac8b5c</guid>
            <dc:creator><![CDATA[Mengying Li]]></dc:creator>
            <pubDate>Tue, 03 Jan 2023 02:41:16 GMT</pubDate>
            <atom:updated>2023-03-22T18:15:55.193Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5jIIMbkBZtKUDdI_URQwg.png" /></figure><p>We all know feel the pain when trying to choose the right instance size for AWS RDS (Amazon Relational Database Service) instance. There are so many <a href="https://aws.amazon.com/rds/instance-types/">instance types</a> optimized to fit different use case. And within each type, there are wide variety of sizes to choose from like large, xlarge, 2xlarge, 4xlarge etc. You definitely don’t want to over provision and waste tons of money. At the same time, if you choose a database instance size that is too small, your bottleneck limitations can cause many outages or performance regressions that heavily impact your availability and latency.</p><blockquote>Choosing the right size for your AWS RDS instances is an art.</blockquote><h4>Some metrics you should keep an eye…</h4><p>Here I’m going to combine my own experience with AWS official recommendation for <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_BestPractices.html">best practice for Amazon RDS</a> to give some key point matrix for you to better understand your database performance and help you identify if you are hitting any sort of limitations. For each database of different size, there are different limitations for everything. Hitting any limit could become your bottleneck and affect your performance.</p><ul><li><strong>CPU Utilization</strong> —<em> Percentage of computer processing capacity used.</em></li></ul><p>If at any point of time, your max CPU utilization on any database instance exceed 75%, this is definitely a sign that you should scale up to more instance (horizontal scaling). If this is a one writer, multiple readers architecture and your writer instance’s CPU utilization is sometimes above 75%, this is a sign calling for larger instance size (vertical scaling) .</p><ul><li><strong>Average Active Sessions (AAS) — </strong><em>An active session is a database connection that has submitted a request to the database but has not yet received the response.</em></li></ul><p>Measuring the average number of active concurrent sessions over time provides a clear picture of the load on the database. If AAS number exceed the number of virtual CPU of this instance, then it indicates your database instance is overloaded. More detailed information regarding understanding AAS can be found <a href="https://aws.amazon.com/blogs/database/analyzing-amazon-rds-database-workload-with-performance-insights/">here</a>.</p><ul><li><strong>Freeable Memory</strong> — <em>How much RAM is available on the DB instance, in megabytes.</em></li></ul><p>The red line in the Monitoring tab metrics is marked at 75% for CPU, Memory and Storage Metrics. If instance memory consumption frequently crosses that line, then this indicates that you should check your workload or upgrade your instance.</p><ul><li><strong>Read Throughput, Write Throughput</strong> — <em>The average number of megabytes read from or written to disk per second.</em></li><li><strong>Network Receive Throughput, Network Transmit Throughput</strong> —<em> The rate of network traffic to and from the DB instance in bytes per second.</em></li><li><strong>DB Connections </strong>—<em> The number of client sessions that are connected to the DB instance.</em></li></ul><p>Though, if you are asking me, you can read all the documentations in the world, yet you can’t confidently choose what is the correct size for your current database load without actually trying it out. This part is especially true when you are downsizing from an under utilized large database instance. How can you say with confidence that the downsizing will not give you any performance regression? Similarly, how can you say with confidence that upsizing will bring you a much better performance? More importantly, which instance is the right target instance for your downsizing or upsizing?</p><p>To answer these hard questions, I’m going to break down these question and give you some practical solution to help you load test properly so that you can confidently draw your own conclusion for your case.</p><h3>How to load test reading traffic on different instance size</h3><p>Traditionally, database take both reading and writing traffic. If your database has a separation of reader and writer instances (e.g. Amazon Aurora Database), and currently has multiple reader instances with <a href="https://docs.aws.amazon.com/whitepapers/latest/amazon-aurora-mysql-db-admin-handbook/load-balancing-with-the-reader-endpoint.html">round robin load balancing traffic to each reader instance</a>, you can easily test out the current load’s performance on a different instance size by spinning up an extra reader instance with target size and terminate an old reader instance.</p><p>With the AWS build in metrics, you can easily check if the load for the current traffic is too little or too much for the new instance size. Though you need to execute with precaution using this method. Since this is load test on a production traffic, this is less ideal compared to some other methods (you can imagine many reason not to do so ahah). Take AWS Aurora database as an example, you need to make sure not to leave mixed instance size for too long. This is<a href="https://stackoverflow.com/questions/66926328/do-aws-rds-cluster-instances-need-to-be-the-same-size"> not recommended</a> by AWS due to the automatic writer failover mechanism of Aurora database. Also you need to make sure to set the failover priority to lower so that it won’t be selected as the new writer instance if anything bad happened to the writer.</p><h3>How to load test writing traffic on different instance size</h3><p>Load test writing traffic on a difference instance size is where most people is mainly stressed about when talking about database rightsizing. One obvious way to do load test is to write some load test and set up the infrastructure to see the performance difference on two database with different instance size — one the same size with production and another one with target instance where you would like to upsizing or downsizing too. While this is all great, writing load test and setting up the load testing infrastructure is no easy work for an engineer. It requires in depth knowledge for use case of the database to set up proper sql statements that you are testing on to generate similar load from production and it requires many infra knowledge to set up the load test environment properly.</p><p>Here, I would like to talk about two methods that can help you to do a shallow load test by mirroring production traffic with a lot less work to set up compare to writing your own load test. I recently used both method for load test for two different databases and I would love to share my experience as an inspiration for how you can easily load test your database and find the right size for your database.</p><h3>Method 1: Use envoy to do request mirroring</h3><p>Here’s some background information for folks who might be new to envoy or envoy request mirroring.</p><h4>What is Envoy?</h4><blockquote><a href="https://www.envoyproxy.io/">Envoy</a> is an open source edge and service proxy, designed for cloud-native applications.</blockquote><h4>What is request mirroring?</h4><p>Request mirroring (also called shadowing, shadow mirroring) is when production traffic is mirrored to destination cluster of a developer’s choosing. Shadowing production traffic allow us to test the production traffic on a test instance (in our case a test database) to get accurate comparison and understand how the test instance behave under the same load without affecting end clients in any way. This can help us to make risky changes with higher confidence and validate the test instance before pushing it to production.</p><h4>Is this the right choice for you?</h4><p>If you use envoy as a proxy in your current infrastructure and all your database request comes from your client side request, using envoy to do request mirroring is the perfect method for you. Allow me to elaborate with a picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*FqzCqtd6GDMHqCBpg8Bp0A.png" /><figcaption>Note: Clone Database is set to the target size we want to upsize or downsize to verify how the traffic load behaves on this database instance size</figcaption></figure><p>As you can see from the <a href="http://envoyproxy.io/docs/envoy/latest/start/sandboxes/route-mirror.html?highlight=request%20mirroring">envoy documentation</a>, envoy provides you powerful features like request mirroring to easily load test your database. All you need to do is do change your envoy configuration file and have it also do mirrored request to your clone application. After you set up the clone application and prod load test clone database, make sure your clone application point to the DNS of your prod load test clone database, then you are ready to go. Just leverage envoy request mirroring feature and change the envoy configuration, and voila, your envoy will make sure to send a copy of the same http request to your clone application automatically. You can wait and observe how the same load performs on your load test database, if there is any unexpected longer latency or any triggered warning. If everything looks good, you have successfully choose the right target instance size. If not, you can always repeat by changing your load test database size and repeat the same process until you are happy with the result.</p><h4>Advantages:</h4><p>This practice is very safe using the mechanism of fire and forget traffic from envoy. Particularly there’s a clone service that is in charge of sending the database traffic towards the load test clone database, you will not affect the production service by giving it extra load like firing a request mirroring traffic from the production service. This clear separation between the load test service and load test database provides an isolated safe environment for you to perform request mirroring without affecting the production traffic.</p><h4>Some precautions:</h4><ol><li>Make sure the clone application have the same set up as production application. Otherwise you introduced more variables to the load test and it will be harder to draw conclusion from two tests performed with different set up.</li><li>Make sure the clone application is linked to the clone load test database endpoint. You never want to mess up with your production database (<a href="https://thorben-janssen.com/dual-writes/">danger of double write</a>). If your application writes to more than one database (include some database you don’t want to perform rightsizing), then redirect the other database endpoint to some invalid ones is one way to avoid double write to those databases. However, if there’s retry for failed database read or write, this will affect the latency looking from the clone service side as well so keep it in mind when interpreting the load test result.</li><li>I would also like to point out with the current micro-service architecture, your service might have some downstream service that it is calling. That downstream service might write to other database. So be careful with that, or you might introduce double write to other database of your downstream service. You can identify downstream service and write some code in the clone service to not send traffic to the downstream service. For a monolith, there’s no worries on this aspect. So envoy request mirroring can be ideal for load test on a monolith service or a service with no downstream services.</li></ol><h3>Method 2: Use ProxySQL to do request mirroring for SQL traffic</h3><p>If your current infrastructure doesn’t support you to use envoy request mirroring, here’s a second option that might give you more possibility to do request mirroring for your database — use ProxySQL to do request mirroring for sql traffic.</p><p>As usual, here’s some background information for folks who might be new to ProxySQL or ProxySQL request mirroring.</p><h4>What is ProxySQL?</h4><blockquote><a href="https://proxysql.com/">ProxySQL</a> is an open source high performance, high availability, database protocol aware proxy for MySQL. ProxySQL build complex <strong>ProxySQL Query Rules</strong> to route writes to primaries, distribute reads across replicas and rewrite queries on the fly with highly granular criteria.</blockquote><h4>What is ProxySQL request mirroring?</h4><p>Summarizing in my own words, when mirroring feature is enabled through ProxySQL Query Rules, ProxySQL forward the SQL statement to prod database as usual and will also send a copy of the production traffic’s SQL statements to the clone database. ProxySQL request mirroring does not guarantee the order of execution and does not guarantee data consistency. But it is very useful when comparing performance of two database with slight different (for example different MySQL version, or in our case different DB instance size) by sending same read and write SQL statement to two different databases.</p><h4>Is this the right choice for you?</h4><p>Different from requests mirroring by envoy, we are leveraging the ProxySQL’s built-in requests mirroring function to send a mirroring sql statement to the load test clone database every time we send a sql statement to production database. This is perfect for when you have multiple micro-services communicating to one database or requests other than http that issue reads and writes to the database (e.g. using kafka to issue sql write statements). You can do requests mirroring through adding a ProxySQL layer in the middle. Just replace the database hostname inside the application configuration to the newly set up ProxySQL hostname, then we can leverage ProxySQL to do requests mirroring. Allow me to elaborate using a picture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVj72Yb-A9kIwxgGu4h-uQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zqK9uUpypnO_O7gZypsTA.png" /></figure><p>As shown in the picture, instead of mirroring the http requests to achieve simulating production traffic load, here we are focused on directly mirroring SQL statements by introducing a new proxy layer provided by open source project ProxySQL.</p><h4>Advantages:</h4><p>This practice doesn’t have the double write danger as we mentioned in the envoy requests mirroring method since only sql requests are mirrored. Also since all SQL statement going through can be mirrored by ProxySQL, we can cover scenarios where one database’s SQL statement is issued by multiple services or sources (kafka for instance). This is personally my second and only remaining choice when the envoy requests mirroring would not be sufficient.</p><h4>Some precautions:</h4><ol><li>Make sure the set up is done properly when using ProxySQL for request mirroring. As shown in picture, you will need to set up some EC2 machines to run ProxySQL service and then set up the DNS for it before you can shift traffic to this new hostname. Since we are directly shifting production SQL traffic to go through ProxySQL service, it is critical to make sure the set up is correctly. Otherwise, it will cause some down time.</li><li>Have a mechanism to shift traffic to ProxySQL service gradually. Like I mentioned before, we are adding an extra layer of ProxySQL service between your production service and production database. If we have mechanism to shift traffic smoothly and roll back when things turns wrong, it would be very nice in case things go south.</li><li>ProxySQL is a less established open source project compare to envoy. I personally ran into some errors like <a href="https://github.com/sysown/proxysql/issues/3389">this one</a> during my own request mirroring process. This blocked me from sending one of the top SQL statement to the load test clone cluster and in result leading to an inaccurate load test result. Great news is that it didn’t block forwarding the traffic to the production database, it just threw warnings when trying to send the mirroring request to the load test clone cluster. So if you are expert on ProxySQL definitely go for it, otherwise there’s some risk running into unsolvable bugs. But like I said, ProxySQL does tackle a more generalized use case where envoy request mirroring couldn’t handle.</li><li>The extra network hops of ProxySQL might introduce some latency when looking from the service side metrics. If you are only looking at database side metrics this would not add any latency at the database layer. However if you are also evaluating the latency metrics measured from the application side, you might be seeing more latency from introducing one extra ProxySQL service in the networking path. You can always rely on some tracing tool to factor out the time on ProxySQL service. But this requires more patience and precaution when looking at the data.</li></ol><h3>Conclusion</h3><p>I’ve stumbled and struggled during my first journey to do load test for rightsizing database instance. I hope that my article will give you some inspirations if you facing similar challenge.</p><p>Thank you for reading. Please reach out to me in the discussion or on <a href="https://www.linkedin.com/in/mengying-li-madeline/">linkedin</a> if you have any thoughts or comments.</p><p>Happy new year everyone :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYQIwwHYM2GFgNoAntKiUw.jpeg" /><figcaption>The new year eve’s firework photo I took</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cd6e8ac8b5c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coursera-engineering/two-easy-ways-to-determine-right-size-for-aws-rds-instance-through-request-mirroring-load-test-9cd6e8ac8b5c">Right-Sizing AWS RDS? Request Mirroring Load Test Come To Rescue</a> was originally published in <a href="https://medium.com/coursera-engineering">Coursera Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Do We Use Kubernetes, Anyway?]]></title>
            <link>https://medium.com/better-programming/why-do-we-use-kubernetes-anyway-644544082f43?source=rss-dbd909ab7ead------2</link>
            <guid isPermaLink="false">https://medium.com/p/644544082f43</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Mengying Li]]></dc:creator>
            <pubDate>Wed, 19 Jan 2022 15:51:43 GMT</pubDate>
            <atom:updated>2022-01-20T04:39:19.319Z</atom:updated>
            <content:encoded><![CDATA[<h4>An explanation guide of container orchestration for software engineers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aCqJ3W26Tndd-awJw5GmrQ.png" /></figure><p>As a less than two years old software engineer myself, I found there are mainly two types of companies that I and my friends end up going in:</p><ol><li>Big corporations where all of the engineers take Kubernetes (or other container orchestration tool) for granted</li><li>Smaller companies who are mainly using a monolith and might be talking about (or not) using Kubernetes (or other container orchestration tools) in the future.</li></ol><p>Speaking from my own experience, I’ve been in both types of companies but I still cannot figure out why do people use Kubernetes. To be more specific, what problems are container orchestration tools like Kubernetes solving? As an effort to answer this question for myself — and other Junior software engineers or beginner Kubernetes users out there — I’m writing this blog in an attempt to dig deeper into these questions.</p><p>First things first, let’s start with the definition.</p><h3>What Is Kubernetes?</h3><blockquote><a href="https://www.redhat.com/en/topics/containers/what-is-container-orchestration"><em>Short definition</em></a><em>: Kubernetes is a </em><strong><em>container orchestration tool</em></strong><em>.</em></blockquote><blockquote><a href="https://kubernetes.io/"><em>Longer definition</em></a><em>: </em><a href="https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/"><em>Kubernetes</em></a><em>, also known as K8s, is an open source system for automating deployment, scaling, and management of containerized applications.</em></blockquote><p>Yes, I hear the word container orchestration everywhere. But let’s face it, this definition is a giant blur for beginners like me. I’m 100% certain I never heard about the word “container” or the word “orchestration” in any of my computer science classes during college. At most, I heard about distributed systems. I know, technology evolves so fast.</p><p>If you remember the big and small companies I mentioned above, I felt like there’s no clear path to understand how companies went on the road of container orchestration in both cases. I feel like I was in a new universe where I saw the big bang (startup with monolith) and the advanced current world (giant corporation modern infrastructure), but I couldn’t connect the dots.</p><p>How did the monolith deployed on one server evolve and become the modern infrastructure that has hundreds (maybe thousands) of microservices deployed on Kubernetes? At what point did they feel the need to migrate to Kubernetes? What problem sets are Kubernetes solving? This is an extremely hard question to answer for junior software engineers. This is because if you are working in a big corporation like in case 1, the problems that Kubernetes is solving are no longer there (or invisible).</p><p>If you are working in startups like in case 2, then you might not reach the stage of being exposed to the problem set Kubernetes is targeted to solve. To give a more specific example, if your startup is not using containers yet, then how do you expect to face the problems of needing to orchestrate the containers?</p><p>Believe me, it’s not easy for me to figure these things out as well despite the fact that I have always been working as an infrastructure engineer and going to Kubecon for three years in a row.</p><h3>The Journey to Kubernetes</h3><p>Allow me to demonstrate the journey to Kubernetes using a made-up story of how a company is built up from the very beginning. As you could have told by my current level of experience, I couldn’t possibly witness a company’s journey from the start. So the following demonstration is a story built upon some of my personal observations from internships and full-time jobs with a combination of what I’ve researched on the internet.</p><p>I really enjoyed using this mind exercise to understand where the company I’m working for currently stands and how they reached this particular stage. I hope you enjoy reading this article as much as I enjoyed writing it. Please take my words with a grain of salt. I would be happy if you agree with me and if you gained useful information from this blog. If there’s anything you disagree with or have questions about, please comment below the article because I would love to learn more as I’m still at the beginning of my career.</p><p>Kubernetes is the most popular container orchestration tool lately and the tool I’m most familiar with. So I’m going to use Kubernetes as an example but also try to generalize this discussion that I would like to call my journey to container orchestration.</p><p>Here, I’m breaking down the development stage of a company into three stages:</p><ol><li>From monolith to microservices</li><li>From microservices to containers</li><li>From containers to container orchestration</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u48VGQC2xXMdthb_6p-Qgg.png" /><figcaption>Docker is an example of a container; Kubernetes is an example for container orchestration</figcaption></figure><p>I would like to claim that by no means I’m suggesting every company has to follow these three steps or have to follow them in order. These stages can definitely happen in parallel — overlapping in two or three stages. In reality, you are unlikely to make all teams sync in these processes. Some teams will be pioneers to try out newer infrastructures (like migrating to Kubernetes) first, and some other teams that maintain more crucial apps with heavier traffic will likely be more conservative and use the more stable and older infrastructures.</p><p>Overall, I feel like these three stages are a great way for me to understand the company development cycle and the importance of why we use Kubernetes.</p><h3>Stage 1: Monolith → Microservices</h3><p>Startups usually start with a monolith. Think about something similar to the university web projects that are built by a team of students. One giant codebase to handle everything (yes you can have all kinds of controllers, but still, at the end of the day, a giant monolith). Every engineer works on this monolith, opening PRs to implement features.</p><p>Once the team grows to roughly 50 engineers or more (or reaches a certain scale), engineers run into different problems working on the same monolith. Some problems would constantly need to do complicated rebase because the main branch changes a lot every day and other people could be working on the same file causing merge conflicts. The risk of stepping onto each other’s toes results from the unclear separation of responsibilities and ownerships of features.</p><p>Long testing time caused by a long queue to access shared staging environment to test your feature. Long build/deployment time and potentially degraded database performance resulting from a large and complicated application with heavy traffic. Developer velocity starts to slow down and the team faces various challenges.</p><p>Then, gradually the teams start to build smaller services (microservices) to handle some specific isolated functions. To give a more concrete example, assume that you are building YouTube and you would like to add a comment section. Then you can build a new comment service to handle everything related to it and establish API endpoints for the monolith or other services to retrieve related data.</p><p>This new service can have its own separate database, code repo, and even deploy and test pipelines. These newer smaller services composed of a small set of strongly related functions can be easily developed, maintained, tested, and deployed by one team. This could allow a looser coupling between the teams resulting in a faster release cycle that pushes out new features faster.</p><p>As time passes, your company starts to have more microservices, implementing either various business capabilities (following <a href="https://microservices.io/patterns/decomposition/decompose-by-business-capability.html">Decompose by business capability pattern</a>) or different subdomains (following <a href="https://microservices.io/patterns/decomposition/decompose-by-subdomain.html">Decompose by subdomain context pattern</a>). It starts to be more than a monolith. Maybe a monolith with several extra microservices.</p><p>For the backend side, you might allocate some machines (EC2 for instance) to run the extra microservices and some copies to run the main app (monolith). You might have a small ops team (maybe 1–5 people), and if a new team reaches out to you requesting a machine to run their new service, you write some scripts to provision the server and then deploy it.</p><p>You start to find out there’s not enough ops people to deploy hotfixes and other stuff every time different service teams have a new request. At the same time, you might find a few teams using Ruby and deploying on EC2 share a lot of similarities. Then you start to write some small tools, like gem tools to help people to generate a standard template to manage their infrastructure, as well as it comes in with some standardized script to build and deploy. You find this mode working for a while.</p><p>Later on, if the situation arises, you might start to consider breaking down the monolith completely into multiple microservices to better divide the responsibility between teams and achieve better developer velocity. This is a more complex topic on its own whether you should or should not break down the monolith and how should this happen (check out <a href="https://docs.microsoft.com/en-us/azure/architecture/patterns/strangler-fig">strangler fig pattern</a> for more information). I won’t go into details here but the natural trend is going from one giant monolith to gradually more microservices as the company expands in size.</p><h3>Stage 2: Microservices → Containers</h3><p>If your startup is very successful, your customers will continue to grow and your engineering team will also expand over time. It goes without saying, the complexity of the infrastructure for supporting these microservices and main applications also grows. One big problem engineers are facing is the inconsistent environment from the developers&#39; desktop to the servers that run the productions application. With different deployment environments, your production server can have completely unexpected behavior from local testing and even staging environment as shown in the picture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MqYnu_QUaaiz1KTaj_G4YA.png" /></figure><p>Of course, nobody wants to break the production code. How does modern infrastructure deal with this challenge? This is where containers come to the rescue!</p><p>According to <a href="https://www.redhat.com/en/topics/containers">Red Hat documentation</a>:</p><blockquote>“Containers are technologies that allow you to package and isolate applications with their entire runtime environment — all of the files necessary to run. This makes it easy to move the contained application between environments (dev, test, production, etc.) while retaining full functionality.”</blockquote><p>The ultimate goal is to build a container that has consistent behavior in different environments. Docker, for instance, is a popular tool for supporting companies to do containerization.</p><p>It is a well-known fact that containerization comes with its many many benefits:</p><ul><li>Portability: Able to deploy in different environments and potentially many different cloud providers’ services (for AWS service, there’s fargate, EC2, ECKS, and EKS that take containers)</li><li>Isolation: Able to run multiple containers of the same service, share resources efficiently but have isolation that brings security benefits, one service crashing doesn’t affect other services.</li><li>Consistent operation: predictable runtime environment.</li><li>Accelerated development, testing, and shipping cycles.</li><li>More importantly, containerization unlocks the potential future of container orchestration due to its high scalability.</li></ul><p>Since there’s so much to look forward to after the containerization, your older services will start to gradually migrate to new containers. At the same time, your company might be promoting the new microservices to be directly built containerized to save the future migration effort.</p><h3>Stage 3: Containers → Container Orchestration</h3><p>Now that the majority of services are on containers and running relatively stable in all environments, are all infrastructure problems resolved? Too young, too naive. New challenges always present themselves as the company grows. Allow me to demonstrate. Imagine you are working in a company where the traffic peaks during some hours or some days drastically. Then imagine hosting a shopping website where the customers drastically increase on Black Friday sales. The traffic could easily be 3x compared to regular times.</p><p>In order to properly handle all the traffic, you will need to scale up. Say that you are running 1 EC2 regularly, now you need to bring up 3EC2 instances to handle the extra load. And of course, you will need a load balancer to route the traffic to the different machines. It might look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q39mbgvmUKwKsugiFXZi6Q.png" /></figure><p>But this is NOT an easy task to deal with. So many things can go wrong. Tasks associated with containers that needed to be handled manually, including but not limited to:</p><ul><li>Deployment of containers</li><li>Redundancy and availability of containers</li><li>Scaling up or down of containers</li><li>Load Balancing</li><li>Health monitoring of containers and hosts</li><li>Service Discovery</li></ul><p>Imagine the amount of effort to write these scripts and make sure they run properly. Even under the best-case scenario where you handle these tasks associated with containers properly, with the magnitude of complexity dealing with infrastructure, things can still go north.</p><p>Yes, you can pre-provision 3 EC2 instances to deal with the anticipated growth of traffic, but what if the actual traffic is lower or higher than expected? Do you add extra logic to your script to handle these cases?</p><p>Scaling efficiently is a complex subject to discuss, and it goes way beyond finding the correct number of EC2 to spin up. A simple example can be a situation where you need to scale application A three times but not application B. This can be a real-life situation where the loads on each application spike differently and you will need to handle the scaling separately. How would you do it efficiently? Allow me to demonstrate with some drawings.</p><p>Here, I’m taking the example of m6g.xlarge EC2 instance, based on the <a href="https://aws.amazon.com/ec2/instance-types/m6g/">documentation</a> it has 4 vCPU and 16GiB. Here we are using a simple assumption, say that to maintain good performance, we would like the CPU usage of the EC2 instance to run below 75% and the memory usage to run below 80%. So in this case, we would like to keep the applications in one EC2 instance consuming less than 3 vCPU and 12.8 GiB.</p><p>Let’s consider this as an available resource size in our graph to simplify the problem. I also put some numbers regarding how much CPU and memory resources Application A and Application B need to consume shown in the graph to help better illustrate the scaling problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*sEQdhAdQJzCMj-HcG0rLIA.png" /></figure><p>Now let’s go back, how can we scale application A three times but not scaling application B. There’s definitely more than one solution to this problem. Here I would like to discuss three possible solutions.</p><h3><strong>Solution 1</strong></h3><p>The most straightforward solution would be spinning up two extra same EC2 instances and running one application A on each EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qh8UQLrtENISPdv1G_JFrw.png" /></figure><p>This will definitely work, but the issue is very obvious. While together with App A and App B in the first EC2 instance, they consume a total of three vCPU and 12.8 GiB, which equals 75% CPU and 80% memory that m6g.xlarge size EC2 has to offer. They are fully utilizing the available resources. But in the later 2 EC2 instances, we can calculate CPU and memory usage as follows:</p><pre>1.5 vCPU / 4 vCPU = 37.5% CPU usage</pre><pre>7.6 GiB / 16 GiB = 47.5% Memory usage</pre><p>Obviously, more than half of the resources on the later 2 EC2 instances are wasted. So it’s definitely not cost-efficient.</p><h3>Solution 2</h3><p>Let’s take a look at another solution. What if we scale down the two later EC2 instances to m6g.large to avoid wasting too many resources?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PXCuvSu4WwTYWOtLzBCGdg.png" /></figure><p>Similarly, we can calculate CPU and memory usage of the later two EC2 instances:</p><pre>1.5 vCPU / 2 vCPU = 75% CPU usage</pre><pre>7.6 GiB / 8 GiB = 95% Memory usage</pre><p>These numbers definitely look much better. However, there’s some hidden dangers. 95% memory usage is very high. With any unexpected spike, your application can easily run into the out-of-memory danger, causing undesired behaviors on the user side.</p><h3>Solution 3</h3><p>Instead of using a smaller instance of EC2, we can keep using m6g.xlarge but try to put two Application A’s in the second EC2 instance. We probably need to reconfigure the load balancer to route more traffic from Application A to the second EC2 instance in this solution. Let’s not go into details and assume the load balancer is doing a proper job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*Rey4TM-R4EBpfU29MPxC1A.png" /></figure><p>Similarly, we can calculate CPU and memory usage of the second EC2 instance:</p><pre>1.5 vCPU * 2 / 4 vCPU = 75% CPU usage</pre><pre>7.6 GiB * 2 / 16 GiB = 95% Memory usage</pre><p>The number is the same in solution 2 for this example. 95% memory usage is definitely entering the out-of-memory risk danger zone. The application could be killed due to being out of memory sometimes. So in a real-life scenario, this is definitely not an ideal case and might not even be an acceptable solution if we want our applications to run stably.</p><p>From the three scaling solutions above, you can easily see the challenge of scaling things individually and having unstandardized infrastructure. These behaviors can result in not being able to run the services cost effectively. These are precisely the problems container orchestration is trying to solve. If you don’t choose to use existing container orchestration tools like Kubernetes, you might end up needing to reinvent the wheels and build your container orchestration tool. Because these problems, with or without using container orchestration tool, will be the problem you need to solve once you reach a certain scale.</p><p>Let’s take a closer look at the definition of container orchestration and its use cases. This is the definition given by <a href="https://www.vmware.com/topics/glossary/content/container-orchestration.html">vmware</a>:</p><blockquote>“Container orchestration is the automation of much of the operational effort required to run containerized workloads and services. This includes a wide range of things software teams need to manage a container’s lifecycle, including provisioning, deployment, scaling (up and down), networking, load balancing and more.”</blockquote><h3>What is container orchestration used for?</h3><p>Container orchestration is used to automate and manage tasks such as:</p><ul><li>Provisioning and deployment</li><li>Configuration and scheduling</li><li>Resource allocation</li><li>Container availability</li><li>Scaling or removing containers based on balancing workloads across your infrastructure</li><li>Load balancing and traffic routing</li><li>Monitoring container health</li><li>Configuring applications based on the container in which they will run</li><li>Keeping interactions between containers secure</li></ul><p>Kubernetes is a very popular open source container orchestration tool. I personally like to imagine container orchestration tools as an extra layer of abstraction on top of servers (like EC2) to allocate the resources more efficiently when dealing with complex infrastructure. Kubernetes helps you build a pool of nodes (servers) to use and then allocate different applications on different nodes based on the application’s CPU and memory request and free available space on each node.</p><p>The scheduling, scaling, and load balancing are all done automatically. Kubernetes is a great tool to help developers focus on the application without worrying about the bare-bone metal server and be limited by the resources that come along with the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*AQlA_7YUIPkJosQxPntQJg.png" /><figcaption>Source: <a href="https://cloud.google.com/kubernetes-engine/kubernetes-comic/">Google Cloud</a></figcaption></figure><p>Combining all these tools together brings the ultimate developer experience that enables great velocity. With one button click, a default microservice from the default template is brought up with build and deployment pipelines with a Kubernetes namespace for your service and deployment. You can code features in your application codebase and all the codes are shipped to the testing environment for you to verify and test inside the cluster using the docker image you just built out. Once everything is ready to be shipped, the release is as easy as changing the docker image in the deployment pods. And voila! Your code is successfully used by customers.</p><h3>Conclusion</h3><p>It’s obvious that container orchestration is the unavoidable future for running stable applications on a large scale. Kubernetes is currently the most popular container orchestrator originally created by Google. Kubernetes is used by a number of well-known companies like Google, Spotify, Intuit, and so on, and the number is growing! I hope my blog — which is a really long version of the question of why Kubernetes gives you a clear vision of how a company grows in different stages and how they come into needing container orchestration in the end — helps you.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=644544082f43" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/why-do-we-use-kubernetes-anyway-644544082f43">Why Do We Use Kubernetes, Anyway?</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Failed CKAD first attempt? My journey to improve exam score from 53% to 98% in a month — Part 2]]></title>
            <link>https://mengying-li.medium.com/failed-ckad-first-attempt-my-journey-to-improve-exam-score-from-53-to-98-in-a-month-part-2-f9e56f47cdf9?source=rss-dbd909ab7ead------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9e56f47cdf9</guid>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[ckad]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mengying Li]]></dc:creator>
            <pubDate>Thu, 04 Nov 2021 21:04:33 GMT</pubDate>
            <atom:updated>2023-02-24T06:48:06.024Z</atom:updated>
            <content:encoded><![CDATA[<h3>Failed CKAD first attempt? My journey to improve exam score from 53% to 98% in a month — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eKD5Din-RYAgHihMkY4YdQ.png" /></figure><p>If you haven’t seen my part 1 of my aritcle, I strongly recommend it. Here’s the link: <a href="https://medium.com/@mengying-li/failed-ckad-first-attempt-my-journey-to-improve-exam-score-from-53-to-98-in-a-month-part-1-badde0746231">https://medium.com/@mengying-li/failed-ckad-first-attempt-my-journey-to-improve-exam-score-from-53-to-98-in-a-month-part-1-badde0746231</a></p><p>Now let’s continue, I love how the old saying goes: “sharing is caring”. I’m hoping my experience in CKAD will help more people to succeed in the future. As I mentioned in the title, I failed first attempt doing CKAD with score of 53% ( 66% is the passing score). Here’s my learnings from the failure and I hope you can avoid the pitfalls of CKAD. You can ace the exam as high as 98% if you keep these details in mind :)</p><h3>Technical Chapter: Common mistakes and how to avoid them</h3><p>First things first, let’s discuss potential technical mistakes you can make during the CKAD exams. These are mostly not caused by lack of Kubernetes knowledge but lack of understanding the exam. I found there’s too many tutorials on how to study for the knowledge part (cheat sheet included) but too few discussion on the test expectations and these common mistakes. Remember, correcting these mistakes is what took me from 53% to 98% (almost 100% score boost) in one month.</p><h4>1. Do context Switch</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*V2dgPx-YN9kkcms7EiaEVg.png" /><figcaption><a href="https://docs.linuxfoundation.org/tc-docs/certification/lf-candidate-handbook/exam-user-interface">Linux Foundation Certification Exams User Interface</a></figcaption></figure><p>The top left red box contains the command line to do context switch (changing k8s clusters). There are four clusters in CKAD that comprise the exam environment, made up of varying numbers of containers. Yes, I made that mistake of not doing context switch because the first few questions that command line looks identical… So, do not make the same mistake!!! It only take 2 seconds for each question to do the command line as suggested, but it takes a lot more time if you run into question where you can’t find the namespace in the cluster that it told you to troubleshoot.</p><h4>2. Look out for hints section under task section</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*xsUeprrMlI5D3cNh8xC_hg.png" /><figcaption>Under task section there’s sometimes a hint section</figcaption></figure><p>Pay attention to the hint section below task (scroll down when needed), use it when there is one. Frankly first time taking CKAD, I was too focused on the tasks and started coding right away, after stuck at the question for 5 min, I saw the extra hint section. We all know CKAD is a game of time, so wasting 5 min is a huge sin.</p><h4>3. Switch to default namespace when not specified</h4><p>Yes, I was also one of the people that got very confused with CKAD questions where some question specified the namespace to use and some not specifying any namespace. From my 98% score retake exam score, I’m confident to conclude the default namespace is the right one to use when the question didn’t specify any particular namespace. My trick is do the following command line to switch to default namespace all the time before starting any question.</p><pre>alias kn=&#39;kubectl config set-context --current --namespace &#39;<br>kn default</pre><h4>4. Watch out for busybox image, must come with ‘— restart=Never’</h4><p>This is a small detail that beginner Kubernetes user might overlook and the consequence is serious — having panic attack during the exam. Let me clarify, “the busybox image doesn’t really ‘do’ anything when you run it so it will just exit. Kubernetes will notice that it ‘crashed’ and eventually go into the CrashLoopBackOff.” (quoting explanation from <a href="https://www.reddit.com/user/lentzi90/">lentzi90</a> on this <a href="https://www.reddit.com/r/kubernetes/comments/jp2ia9/crashloopbackoff_status_using_busybox_images/">reddit post</a>).</p><p>If you use the following command line, then you will be just fine.</p><pre>kubectl run busybox --image=busybox --command --restart=Never</pre><p>Nginx base image on the other hand do not need this restart since it runs the web server and will keep doing that forever unless something stops it. So the following command line will be sufficient.</p><pre>kubectl run busybox --image=nginx --command</pre><p>If you are wondering how many base image you will need to be familiar to ace CKAD, relax, nginx and busyboxare the only two I ever encountered.</p><h4>5. Use bookmarks and kubectl command line alias</h4><p>I think this is a well known fact that CKAD is open book exam that requires fast speed to complete. There’s many tips online to help with improving speed, the most import two being using bookmarks for Kubernetes official documentations and using imperative commands with kubectl command line alias. And here’s why these two tips are important. Bookmarks are very useful because CKAD questions are identical to the official documentations’ examples so make sure you are familiar with those. kubectl command line alias is useful because you will type things like kubectl hundreds of times so it matters to be fast. Less character also allow you to make less mistakes when typing under stress for long alias (changing namespace alias) like:</p><pre>alias kn=&#39;kubectl config set-context --current --namespace &#39;</pre><h4>6. Know how to validate your service / deployment is doing what is expected</h4><p>I started off practicing using <a href="https://www.udemy.com/course/certified-kubernetes-application-developer/">Kodecloud labs</a>, and as side effect, it makes me heavily relying on the green checkmark to tell me I’m correct on every small steps. This is not how the real world looks like, each question is long and you need to learn to validate your service / deployment is behaving like expected inside the bare terminal. Learn to validate the deployment is healthy by checking the log output and pods state, learn to verify service healthiness by sending traffic to the service and check the respond.</p><h3>Non-Technical Chapter: Know what to expect for the online testing experience</h3><p>Maybe I’m a newbie to the online testing experience and a bit bad luck during first attempt, but I would like to share my journey and what the worst case scenario exam experience could look like so you know what to expect.</p><p>My first experience with the examinator is not very pleasant. I had my double shot latte and was super stressed, then wasted one hour to show him around the room for 3 / 4 times. So lesson here, go into a rather empty room and keep only one laptop on table without extra monitors. There’s some problem with sharing two screen and unplug to move around and show the room. So use one laptop will make this process a lot more simpler and faster. When you selected the time, it’s not starting at the selected time. You can enter the exam room 15 min early but verification of your room can take to up an hour. So don’t schedule for late night test ( like me who end up finishing at 1:30 am) . A couple of folks on reddit also had similar experience.</p><h4>Tip: Schedule the exam time earlier than when you are expected to start testing . Don’t do late night scheduling. Enter the exam room 15 min early. And use one laptop (without extra screen)</h4><p>After the exam started, the examinator from my first attemp keep messaging me every 10 min for different isssues, some typical ones are mouthing the question and my face is half way outside (because the questions are on the left side and fonts are small, I went closer to look into the questions). So read through the online exam rules and expect some interruption from examinator through chat box reminding you to put your whole face in the camera. At the same time, the second examinator didn’t message me a single time during the entire two hours except for the friendly reminder of 15 min the exam will stop.</p><h4>Tip: Know the online exam rules and expect some interruptions</h4><p>Last but not the least, remember to mark the exam start time (on the computer system) and use that as a reference to know how long you have been in the test. This come as a shock for me that there’s no count down clock in the exam page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*GMu3pN3U8ZwgN_WPGaE4ew.png" /></figure><p>On the top left red box in the screenshot, this is the only time bar you can see during the exam. I think green indicates you still have plenty of time. Though this is very inaccurate not knowing how long you have left and if you should go faster. What I find way more useful is to mark the time in your head (or on the notes) for local time shown on the computer when you started (blue box on the bottom right), calculate the time difference in the exam from start time to know how long you’ve been inside this test and how many time you still have. There will be the examinator reminding you 15 min before the test ends but unless you ask explicitly, the examinator won’t actively remind you in the first 1 hour and 45 minutes. Since you are not allowed to wear a watch or put a clock on your table, also you are most likely not starting at the time you choose at first, I find using computer time is the most convenient solution.</p><h4>Tip: Remember the start time and check on the computer to know how much time remaining.</h4><h3>Conclusion</h3><p>Hope you find this article helpful :) Please reach out to me in the discussion or on <a href="https://www.linkedin.com/in/mengying-li-madeline/">linkedin</a>. Most importantly, enjoy the CKAD journey and have fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9e56f47cdf9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Failed CKAD first attempt? My journey to improve exam score from 53% to 98% in a month — Part 1]]></title>
            <link>https://mengying-li.medium.com/failed-ckad-first-attempt-my-journey-to-improve-exam-score-from-53-to-98-in-a-month-part-1-badde0746231?source=rss-dbd909ab7ead------2</link>
            <guid isPermaLink="false">https://medium.com/p/badde0746231</guid>
            <category><![CDATA[ckad]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Mengying Li]]></dc:creator>
            <pubDate>Thu, 04 Nov 2021 20:50:24 GMT</pubDate>
            <atom:updated>2021-11-07T19:36:16.746Z</atom:updated>
            <content:encoded><![CDATA[<h3>Failed CKAD first attempt? My journey to improve exam score from 53% to 98% in a month — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eKD5Din-RYAgHihMkY4YdQ.png" /></figure><p>In September 2021, I passed CKAD after a second attempt with high score of 98%. I’m a junior software engineer with 1+ years of work experience, no prior exposure to docker, kubernetes just learned minimum linux command line in college. So if I can do it, anyone can do it. Yes, you can become a certified kubernetes developer straight out of college or as a college student. I scored 53/100 first time taking the test, in the free retake for CKAD, I scored 98/100. I had my fair share of failure so not a born genius. I’m writing this article for both the first time exam taker and the exam retaker audience. I will share how I studied for the exam, what my test experience is and how you ace this exam.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uPFi_bPtoLNRWuseuRw2gQ.jpeg" /><figcaption>First thing first… my certificate yay</figcaption></figure><p>What is CKAD?</p><blockquote>The Certified Kubernetes Application Developer exam (CKAD) certifies that users can design, build, configure, and expose cloud native applications for Kubernetes.</blockquote><p>It’s a 2 hours exam with 19 questions focusing on hands on lab questions (create Kubernetes objects in linux terminal to satisfy question requirements).</p><p>This exam curriculum includes these general domains and their weights on the exam:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Adv1ydpmhci4uXT2Oeqf0Q.png" /><figcaption>Screenshot from CNCF website</figcaption></figure><h3>How to practice for the exam?</h3><p>You only need two practicing materials to score as high as 98% in CKAD, and yes, it is more than sufficient. Overall I took about 2 months to finish both lessons during after work hours. I was able to do majority labs at least two times. I felt with some intense training and some background experience with Kubernetes, a month or less would be sufficient preparation time.</p><h4>1. For Kubernetes beginners, start with <a href="https://www.udemy.com/course/certified-kubernetes-application-developer/"><strong>Mumshad Mannambeth</strong>’s Udemy CKAD course</a>.</h4><p>The hands-on labs are perfect for getting familiar with Kubernetes and learn to work in a lab settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xllj931mEBGkHm3u6D3Ilg.png" /><figcaption><a href="https://www.udemy.com/course/certified-kubernetes-application-developer/">https://www.udemy.com/course/certified-kubernetes-application-developer/</a></figcaption></figure><h4>2. When you get closer to the exam date (or failed the first attempt for CKAD and want to restudy), I highly highly recommend <a href="https://github.com/dgkanatsios/CKAD-exercises">Dimitrios Gkanatsios’s github CKAD exercise repo</a>.</h4><p>I found his exercise questions nearly identical to the ones I met in the exam and having done exercises in this repo boosted my score from 53% to 98%. So hands down the best exercises for CKAD.</p><p>Don’t shy away because there’s no lab environment to do these CKAD exercises, you can bring up a cluster in a cloud provider (like DigitalOcean) in a few minutes and practice there, or using the lab environment in the udemy course above is also a quick solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iOL-T2fi5CAmMMvjHlIjFg.png" /><figcaption><a href="https://github.com/dgkanatsios/CKAD-exercises">https://github.com/dgkanatsios/CKAD-exercises</a></figcaption></figure><h3>To be continued …</h3><p>I highly highly recommend everyone to continue on reading <a href="https://mengying-li.medium.com/failed-ckad-first-attempt-my-journey-to-improve-exam-score-from-53-to-98-in-a-month-part-2-f9e56f47cdf9">Part 2</a> of this blog article. In second half, I discussed about the common pitfalls and mistake that you could avoid during the CKAD exam. This is the key reason that I raised my score from 53% to 98% in a month. Knowing the test experience and knowing what to expect is crucial for acing CKAD.</p><p>Here’s the link to the article: <br><a href="https://mengying-li.medium.com/failed-ckad-first-attempt-my-journey-to-improve-exam-score-from-53-to-98-in-a-month-part-2-f9e56f47cdf9">https://mengying-li.medium.com/failed-ckad-first-attempt-my-journey-to-improve-exam-score-from-53-to-98-in-a-month-part-2-f9e56f47cdf9</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=badde0746231" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean up your room!]]></title>
            <link>https://mengying-li.medium.com/clean-up-your-room-b25ad40ffc0b?source=rss-dbd909ab7ead------2</link>
            <guid isPermaLink="false">https://medium.com/p/b25ad40ffc0b</guid>
            <category><![CDATA[istio-service-tutorial]]></category>
            <category><![CDATA[kubernetes-tutorial]]></category>
            <category><![CDATA[istio-service-mesh]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mengying Li]]></dc:creator>
            <pubDate>Tue, 08 Dec 2020 05:47:33 GMT</pubDate>
            <atom:updated>2022-04-15T21:25:57.629Z</atom:updated>
            <content:encoded><![CDATA[<h3>Clean up your room! What do you need to delete in K8s and Istio when dealing with unused application</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ZtdCJNGX2_saE6AqsYs0vw.png" /></figure><p>There are many tutorials teaching you how to deploy your service to a cloud infrastructure and how to get your application up and running. However, what do you do when an application is no longer in use? What are the K8s (short for kubernetes) and Istio resources related to unused application that you need to delete? Deleting is always a daunting task for beginner users/developer. While you can simple do “kubectl delete” and hope for the best, being mindful about your deletion and having the knowledge of the resource you are deleting certainly offers some peace of mind and some confidence.</p><p>Here, I’m going to show you how to delete things cleanly and properly after identifying an application is no longer needed using the examples from open source project <a href="https://github.com/istio-ecosystem/admiral">Admiral</a>. I will walk you through the steps to delete K8s and Istio resources and help you to identify the correct objects to delete without breaking the other services or leaving an endpoint of old services leading to failed response. Note that it is still the service owner’s responsibility to identify all other applications calling the soon to be deleted application and reroute the traffic to some working applications. I’m just walking you through some basic steps to delete the resources along with short introductions of the resources and why you need to delete them.</p><h3>Deleting k8s resources</h3><h4>Deployment</h4><p><a href="https://www.redhat.com/en/topics/containers/what-is-kubernetes-deployment">A K8s deployment is a resource object that provides declarative updates to applications.</a> A deployment allows you to describe an application’s life cycle, such as which images to use for the app, the number of pods there should be, and the way in which they should be updated. We use deployment to bring up running pods and update them as needed to serve as an application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*XyvOkki85648O9U73vle_w.png" /><figcaption>Example deployment from open source project <a href="https://github.com/istio-ecosystem/admiral">Admiral</a></figcaption></figure><p>If the application is no longer needed, the first thing we need to do is to stop all the running pods related to this application. To accomplish this, we just need to find the correct deployment in the according namespace and run:</p><p><strong><em>kubectl delete deployment &lt;my_deployment_name&gt; — &lt;my_namepsace&gt;</em></strong></p><p>This will gracefully handle destroying all pods related to the application. Note that manually deleting pods one by one would not work because K8s deployment are designed to keep a predefined number of pods always running. So if the deployment object is still there, it will keep bringing up new pods when old pods die.</p><h4>Service</h4><p><a href="https://kubernetes.io/docs/concepts/services-networking/service/">A K8s service is a resource object that exposes an application running on a set of pods as a network service.</a> By selecting pods by labels, a service can provide an interface enabling our set of pods (call them “frontend”) to communicate with another sets of pods (call them “backend”) without needing to remember the exact pod IPs. This is very beneficial because pods are created and destroyed dynamically so we don’t need to keep track of different pods IPs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/1*GRL5ixeUqC2uhmw-3R1WSQ.png" /></figure><p>After our application deployment object is gone, we need to clean up the service object as well to prevent other pods (services) from talking to this service resulting in requesting failures. To do this, we need to find the correct service in the proper namespace. Make sure to verify the service has selector matching the pods label (which is the same as labels defined in the deployment object we just deleted).</p><p><strong><em>kubectl delete service &lt;my_service_name&gt; — &lt;my_namepsace&gt;</em></strong></p><p>This will close the portal other pods/services tries to talk to and delete more cleanly.</p><p>After deleting basic K8s related resources, we can move on to more fine grain traffic control resources like <a href="https://istio.io/">Istio</a> resources. If you don’t use Istio to control your traffic, feel free to skip this part. Also, feel free to skip any particular resource that you didn’t use in your application. I want to bring special attention that the Istio resources to route traffic to your application might not live in the same namespace as your deployment and service in some cases. So double-check every step’s parameters before running the deletion is very important. Finally, only delete the whole Istio related routing object when you are sure that deployments of the same application in different clusters are all deleted and that the whole application is no longer in need.</p><h3>Deleting istio resources</h3><h4>ServiceEntry</h4><blockquote>ServiceEntry enables adding additional entries into Istio’s internal service registry, so that auto-discovered services in the mesh can access/route to these manually specified services. A service entry describes the properties of a service (DNS name, VIPs, ports, protocols, endpoints). These services could be external to the mesh (e.g., web APIs) or mesh-internal services that are not part of the platform’s service registry (e.g., a set of VMs talking to services in K8s).</blockquote><p>— <a href="https://istio.io/latest/docs/reference/config/networking/service-entry/">Istio ServiceEntry documentation</a></p><p>Entries in service register can receive traffic by its host name and be targeted by other Istio resources. In short, <strong>ServiceEntry enable creation of new names¹.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*8_r-nPFDg5_8Jr72PU7ORg.png" /></figure><p>If you used service entry to gave the new application a name addressable via DNS like for example ‘stage.greeting.global’ , it will show up in SE.spec.hosts field. Find the correct ServiceEntry object by verifying its hosts fields have the right string used to reference your application. Delete the ServiceEntry object using the following command:</p><p><strong><em>kubectl delete serviceentry &lt;my_serviceentry_name&gt; — &lt;my_namepsace&gt;</em></strong></p><p>This will remove the entry from Istio’s internal service registry and it can no longer be a valid target for other Istio resources.</p><h4>VirtualService</h4><blockquote>A VirtualService defines a set of traffic routing rules to apply when a host is addressed. Each routing rule defines matching criteria for traffic of a specific protocol. If the traffic is matched, then it is sent to a named destination service (or subset/version of it) defined in the Istio’s internal service registry.</blockquote><p>—<a href="https://istio.io/latest/docs/reference/config/networking/virtual-service/"> Istio VirtualService documentation</a></p><p>In short, <strong>VirtualService configure and route names¹.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*LZcTV00zIbO7Mpc7_BchHg.png" /></figure><p>When used together with ServiceEntry, one common use case can be the VS.spec.hosts field is the addressable DNS name ‘stage.greeting.global’ and route to destination ‘greeting.sample.svc.cluster.local’ to a specific version or port when matching some prefix. Similar to ServiceEntry, we can find the correct VirtualService object by verifying its hosts field have the right string used to reference your application, and one more step further, the routing destination points to the deployment pods you just deleted. To delete the VirtualService object, use the following command:</p><p><strong><em>kubectl delete virtualservice &lt;my_virtualservice_name&gt; — &lt;my_namepsace&gt;</em></strong></p><p>This will remove unnecessary routing configuration to the deleted destination of deployment.</p><h4>DestinationRules</h4><blockquote>DestinationRule defines policies that apply to traffic intended for a service after routing has occurred. These rules specify configuration for load balancing, connection pool size from the sidecar, and outlier detection settings to detect and evict unhealthy hosts from the load balancing pool.</blockquote><p>— <a href="https://istio.io/latest/docs/reference/config/networking/destination-rule/">Istio DestinationRule documentation</a></p><p>DestinationRule gives service operator the ability to describe how client should connect to the service. In short, <strong>DestinationRule describe how to communicate with the workload behind a name¹.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*ocAFIsKpAJ1k7fs8Uh613Q.png" /></figure><p>When used together with ServiceEntry, one common use case can be the DR.spec.host field is the addressable DNS ‘stage.greeting.global’, the traffic policy defines loadbalancing policy and enforce tls related policy. Similar to serviceEntry, find the correct DestinationRule object by verifying its hosts fields have the right string used to reference your application. We can delete the DestinationRules object using the following command:</p><p><strong><em>kubectl delete destinationrule &lt;my_destinationrule_name&gt; — &lt;my_namepsace&gt;</em></strong></p><p>This will remove DestinationRule configurating pointing to the DNS name related to your application.</p><h4>Gateway</h4><blockquote>Gateway describes a load balancer operating at the edge of the mesh receiving incoming or outgoing HTTP/TCP connections. The specification describes a set of ports that should be exposed, the type of protocol to use, SNI configuration for the load balancer, etc.</blockquote><p>— <a href="https://istio.io/latest/docs/reference/config/networking/gateway/">Istio Gateway documentation</a></p><p>A VirtualService can be bound to Gateway to forward traffic arriving at particular host or port. In short, <strong>Gateway exposes names¹.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*2YjpEdlBWr1PGLMa14R36Q.png" /></figure><p>So if the public facing gateway host name connected to the application is no longer needed, we should delete the gateway object as well. To delete it, do:</p><p><strong><em>kubectl delete gateway &lt;my_gateway_name&gt; — &lt;my_namepsace&gt;</em></strong></p><p>This will remove the pubic facing url from existence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*ME--Na1vRIOmfozyKNrOKg.jpeg" /><figcaption>Don’t everyone love K8s</figcaption></figure><p>That’s all the contents for K8s and Istio resources deletion. Hope this article is helpful to you. Would love to hear if you have any feedback.</p><p>[1]CALCOTE, LEE BUTCHER ZACK. <em>ISTIO: up and Running</em>. O’REILLY MEDIA, INC, USA, 2019.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b25ad40ffc0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>