<?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 Usha Devasi on Medium]]></title>
        <description><![CDATA[Stories by Usha Devasi on Medium]]></description>
        <link>https://medium.com/@usha-dewasi?source=rss-f9196eb33547------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_aYrbGNqerl8npJhBE7aIQ.jpeg</url>
            <title>Stories by Usha Devasi on Medium</title>
            <link>https://medium.com/@usha-dewasi?source=rss-f9196eb33547------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 05:29:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@usha-dewasi/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[Kafka : Messaging System]]></title>
            <link>https://usha-dewasi.medium.com/kafka-messaging-system-68bb32de1d23?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/68bb32de1d23</guid>
            <category><![CDATA[publish-subscribe-pattern]]></category>
            <category><![CDATA[streaming-platforms]]></category>
            <category><![CDATA[kafka-workflow]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[zookeeper-in-kafka]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Sun, 05 May 2024 19:33:23 GMT</pubDate>
            <atom:updated>2024-05-05T19:33:23.739Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kafka : Messaging System</h3><p>Apache Kafka stands as a <strong>distributed streaming platform</strong> engineered to manage high-throughput, real-time data streaming and its processing efficiently. Originally crafted by <strong>LinkedIn</strong> to track various events, clicks, messages, and logs from diverse sources, it later emerged as an open-source endeavor under the Apache Software Foundation umbrella. Its prowess lies in its <strong>ability to publish, subscribe to, store, and process streams of records in a fault-tolerant manner</strong>.</p><p>To delve deeper into its significance, let’s step back and grasp the underlying necessity.</p><p><strong>Background</strong>: The challenge of handling a continuous influx of data into distributed systems from multiple sources is formidable. Imagine managing hundreds or thousands of log entries per second from distinct sources. Consider how to store and index these logs for future searchability or cope with spikes or service downtime. The solution to these quandaries is what we term a messaging system.</p><p>Within the realm of messaging systems, two primary types prevail: Queue and Publish-Subscribe (Pub-Sub). <strong><em>Kafka is classified as a Pub-Sub based messaging system</em></strong>.</p><p><strong>Core Components</strong>:</p><p><strong>Producer</strong>: Applications or services responsible for publishing (writing) events to Kafka topics.</p><p><strong>Consumer</strong>: Applications or services tasked with consuming (reading) topics and processing the stream of published events.</p><p><strong>Broker</strong>: Servers dedicated to storing data and serving clients. A Kafka cluster comprises one or more brokers to ensure fault tolerance and load balancing.</p><p><strong>Topic</strong>: Represents a feed name or category to which records are published. Topics are partitioned to facilitate usage across multiple brokers.</p><p><strong>Partition</strong>: Enables the parallelization of data for a topic by splitting it.</p><p><strong>Offset</strong>: A unique identifier for a record in a partition, denoting its position within the partition alongside the aforementioned components.</p><p><strong><em>Kafka relies on Zookeeper for coordinating between Kafka brokers and maintaining metadata about the Kafka cluster</em></strong>.</p><p><strong>Zookeeper</strong> tracks broker statuses, performs leader elections for partitions among tasks, and oversees the overall health of the Kafka cluster. It accomplishes these tasks by altering offset values within its key-value store. Messages remain accessible for any number of consumers, and they get archived after a set time, ensuring retrieval in case of issues while maintaining sequence.</p><p>The below image shows how a message looks like and what it contains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*T0Ruq2KQIgJxWbfcxK1eiw.png" /><figcaption><strong>Kafka Message</strong></figcaption></figure><p><strong>Workflow Overview</strong>: Messages trail from producers sequentially. Consumers can retrieve messages from any topic on a broker. Kafka clusters, comprising numerous brokers, communicate with Zookeeper, the metadata collector, which furnishes producer information about brokers and updates consumer offset times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*csaDaLo3B4t2PUI5mJ42Qg.png" /><figcaption><strong>Kafka Workflow</strong></figcaption></figure><p>There is also a concept of leader and followers in partition. Will discuss that in detail in one of our upcoming article and get an understanding of how it works, what is a leader , who select it and how and so on.</p><p>But for most let’s check out when to use Kafka and when not to.</p><p><strong>When to Use Kafka</strong>:</p><ul><li>Real-Time Data Processing</li><li>Decoupling of System Dependencies</li><li>Log Aggregation</li><li>Event Sourcing</li><li>Message Buffering</li></ul><p><strong>When NOT to Use Kafka</strong>:</p><ul><li>Low Volume Data</li><li>Complex Queries</li><li>Immediate Message Consumption</li><li>High Overhead</li></ul><p><strong><em>In essence, Kafka serves as a robust solution for real-time data processing and decoupling system dependencies, among other applications, while it might not be suitable for scenarios requiring lower data volumes or complex querying capabilities.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68bb32de1d23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Basics : DNS]]></title>
            <link>https://usha-dewasi.medium.com/the-basics-dns-10fb5d937939?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/10fb5d937939</guid>
            <category><![CDATA[basic-system-design]]></category>
            <category><![CDATA[basics-of-internet]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[about-dns]]></category>
            <category><![CDATA[domain-name-server]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Fri, 26 Apr 2024 03:01:18 GMT</pubDate>
            <atom:updated>2024-04-26T03:01:18.669Z</atom:updated>
            <content:encoded><![CDATA[<h3>DNS: The Basics of internet</h3><p>DNS is Domain Naming System.<br>It provide human readable domain to users and translates that domain into IP address to be used by computer and other devices over internet.</p><p>TLD’s are top level domain , its the right most part of the domain e.g <strong>.com<br>TLD’s can be : </strong>Generic TLD’s (GTLD’s) or Country code TLD’s also known as CCTLD’s.</p><p><strong><em>examples of </em></strong><br>GTLD’s : .com, .org, .net etc<br>CCTLD’s: .in, .de , .us etc</p><p>Domain also contain subdomains: Subdomains are the sub division of domain name that allow the creation of separate sections or page within the website.</p><h3><strong><em>Importance:</em></strong></h3><p><strong>1.</strong> <strong>User friendly</strong> : With DNS, User don’t have to remember or mesmerise the long IP addresses. I even can’t imagine how would have been our lives without it.<br><strong>2. LB</strong> (load balancer): DNS can distribute coming user request across multiple servers which in return contributes towards improving performance and reliability of the website.<br><strong>3. Scalability:</strong> DNS is a hierarchical and distributed system which allow growing number of domains and IP addresses to sustain over internet.</p><h3>How DNS work ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RgZ11agsZO_OTchJEhPmQQ.png" /></figure><p><strong>DNS Resolvers</strong>: The are of 2 types and are used for caching and forwarding the query.</p><ol><li><strong><em>Recursive resolver</em></strong>: They act as an intermediary between DNS server and the user. Once this resolver find the answer to the query , it cache the information and returns the result so that for next time the result can be used from Cache instead of connecting the server again.</li><li><strong><em>Forward resolver</em></strong>: As the name suggest , these resolvers just forward the DNS query to other servers and typically these other servers as none other than the recursive servers.</li></ol><h3><strong>DNS Resolution:</strong></h3><p><strong>I<em>t’s a process that is mixed of iterative and recessive queries utilising the DNS server hierarchical infrastructure and resolver mechanism.</em></strong></p><p>we have gone through resolvers but not yet DNS queries , let’s check them out too.</p><p>There are 2 types of queries : <strong><em>Recursive</em></strong> and <strong><em>Iterative</em></strong>.<br>Recursive queries try to get result via executing it in one go meaning the query will get the full response from DNS server however in Iterative queries the result from DNS will be fetched doesn’t matter whether it is the complete result or not and if not then it will forward the remaining query portion to another server who might be having the remaining response and so on meaning it works in instalments or in a iterative manner to get the whole query result so as the name suggest itself.</p><p>Now the last but not the least important part is about Caching and Time to live (also known as TTL). we all have seen and observed this but might not be aware of.<br>Let me refresh it for you so that you can relate it back and never forget it in future.</p><p><strong>Cache</strong>: To speed up the DNS resolution , resolvers and servers do cache the result so that next time it can be used directly instead of navigating to DNS server . This results in time saving as well as reducing network traffic.</p><p><strong><em>Negative (-ve) cache</em></strong>: You may be 🤔 thinking, that is this. <br>It is the <strong><em>process of caching non-existing DNS record</em></strong>. It is important from the perspective that what if someone is trying to click random DNS just to consume resource or create traffic over the internet (think it to be done on massive level).</p><p><strong><em>TTL (Time to live): </em></strong>Each DNS record contain TTL and it specific how long the record can be cached. Once it expires that time (in secs) onwards then it will be taken freshly from DNS server and will be cached and again when the time expire the process repeats. <em><br></em><strong><em>e.g</em></strong><em> </em>Banking , you will be logged out after specific duration if no activity preformed for a certain time in order to avoid frauds.</p><p>After reading this article, please do check the url you get in your Browser as part of practice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10fb5d937939" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Covid Changed My Life …]]></title>
            <link>https://usha-dewasi.medium.com/how-covid-changed-my-life-c14282d41d7e?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/c14282d41d7e</guid>
            <category><![CDATA[human-behavior]]></category>
            <category><![CDATA[life-changing-events]]></category>
            <category><![CDATA[life-in-corona]]></category>
            <category><![CDATA[be-empathetic]]></category>
            <category><![CDATA[tough-times]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Thu, 07 Apr 2022 06:06:25 GMT</pubDate>
            <atom:updated>2022-04-07T06:06:25.941Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Covid Changed My Life …</h3><p>It was the time in 2019 when everything was going as usual 💁🏻‍♀️.<br>Early, Dec 2019 was the time when Wuhan, China outbreak happened but still World was normal, our lives were normal again as usual.</p><p>It was <strong><em>hard to define:- What is Normal</em></strong> until Covid-19 started across Globe, at least for me.</p><p>For me it was more like: If you have never tasted a bad apple, you will never be able to find a difference between what a good Apple means.</p><p>I remembered in 2019, I went to visit my family back in India. In March 2020, went on vacation to Netherland, even till that time everything was very casual in Germany, except shortage of Sanitiser🧴 and Toilet Paper🧻 🤦🏻‍♀️. When I came back from the Netherland trip, suddenly but since then everything got changed. In the next few days, News across the globe was all about Corona. Every country did lockdown, restrictions, people lost their jobs and lives, domestic violence increased … really painful to think about the situation again.<br>Felt like <strong><em>everything is Paused Except time ⏳.</em></strong></p><p>For me <strong><em>it was hard</em></strong> too, thinking🤔 how I am gonna survive without going out and not meeting people. But that was not an option at all. So, thought why don’t I try to do the stuff which I wanted to do for a long time, actually since my childhood which was apparently writing and that was the time when I started writing my blogs and also started teaching again after 11 years along with my professional job in IT, the difference was this time I was teaching Technology and the reason behind that was : <br>I felt myself to be <strong><em>privileged being in IT</em></strong> because at least I have the flexibility to do work from home and get paid.<br>Think and compare yourself being it Software Industry versus people who lost their jobs and struggling to survive e.g. hawkers, shopkeepers, restaurants workers, etc.</p><p>That’s how I kept myself busy, pursuing what I liked to do.<br>By the way, I forgot to mention that I was really good at writing poems and lyrics since I was a kid but thanks to my shyness it gave chance to others to become stars and not me.</p><p>But again, coming back to Corona time. I kept myself hard and brave until the mid of 2021 when <strong>Oxygen shortage Crisis</strong> was on the Top in India. Now people were dying more because of Oxygen shortage instead of Covid. Of course, Covid was the trigger but those lives could have been saved if, we had sufficient Oxygen. It was hard to keep my emotions within myself, I cried a number of times seeing the dead bodies all over the media channels and that was the time also when I lost my Uncle.</p><p>Till today, Dec 2019 was the time when I visited my family. I had plans to visit in Dec 2021 but then, exactly during my visit time, the <strong>Omicron variant</strong> came. I hope you all imagined what would have happened.<br>YES, I canceled my flight with pain in my heart and tears in my eyes, because my parents didn’t want me to come in such a bad situation, to be more specific: after seeing the <strong>chaos at Delhi Airport</strong> they said NO. And believe me, in this whole time, I still don’t feel that my Uncle is no more with us rather I feel it more as some kind of bad dream.</p><p>I never liked Berlin, the place where I live before Covid because I felt people here are so grumpy and nobody cares about you or whatever you do. But now, I do like and love Berlin because it changed my point of view since Corona. Usually, Berliners don’t care but when you need them they will be with you even if you don’t ask. During corona, everyone was so supportive of each other. <br>Not only that, Berlin is the place where people will fight for you and stand by your side if they see something wrong is happening to you.<br>People here don’t care what you do, how you look, what you wear etc but they do care about your rights and that’s also why Berlin is also famous for having protests every other day.</p><p><strong><em>From a Professional point of view</em></strong>, I never did work from home before. For me, it was pretty clear that If I want to work, I will go to the office else stay home being on vacation. But now it&#39;s exactly the opposite, I am much more focused on doing home office and whenever I miss people, I go to the office.</p><p>Although, I understand it is difficult for many people because they used to meet people during their commute, office time, lunchtime and if they/you need anything it was super easy to talk to your colleagues who are sitting next to you and also to detach yourself from work but <strong><em>NOW you can’t</em></strong>.</p><p>That’s why I would like to <strong>request all of you</strong>, in order to have the same attachment even being remote by having your video ON while being on call, take some virtual break with your mates, try to make it at least a bit close to the real world what you used to have before Corona. Also, be flexible to talk and respond as I have seen many people who say the other person is directly asking me for a call… folks don’t act like a jerk, just imagine if you are working in a team and being remote, how will you be more productive if you always ask or waiting for a scheduled meeting?<br>Even enjoy your personal life as you used to do earlier, if you are working remotely it doesn’t mean that you need to work more than your working hours.<br>Remember if you stay healthy and focused you can do the same work during your working hours but if not then even if you sit for 15 hrs it will stress you out and result in nothing more.</p><p>Corona taught me a lot of lessons, some of them are listed below:</p><ol><li><strong><em>Life is so fragile so Love it, Embrace it, Respect it and Enjoy it</em></strong>.</li><li><strong><em>Don’t take</em></strong> anybody or anything to be <strong><em>granted</em></strong>.</li><li>Be <strong><em>empathetic</em></strong>.</li><li><strong><em>Don’t think about a reason to talk to someone</em></strong>.</li><li><strong><em>Help people</em></strong> as much as you can, it’s a tough time for all of us.</li></ol><p>We have changed so much over time that we became so suspicious, competitive, and emotionless such that whenever anybody tries to contact us the very first thing that comes to our mind are: <br> * <strong>Why this person is calling or messaging me?</strong><br> * <strong>Is this person need something from me?</strong><br> * <strong>I should be prepared with some kind of excuse. What excuse should I make?</strong></p><p>Let me tell you about an incident.<br>Since Corona started, I also <strong><em>started making it my habit to randomly ping my contacts to check how they are doing</em></strong>.<br>Recently, I messaged a person saying:<br><strong><em>Me</em></strong>: How are you doing and how’s your day?<br>Do you know, what response I got?<br>Instead of saying, I am fine or ….<br><strong><em>Other Person</em></strong>: Hi, How can I help you?<br><strong><em>Me</em></strong>: No no, I was just checking how’s your day? I am all good and don’t need any help 😉.</p><p>One more incident or rather an observation, I had:<br>When you try to make people comfortable, and if they are not mature enough they <strong><em>take you for granted</em></strong> thinking that you are nice because you are weak but let me tell you if somebody is nice to you it&#39;s the person’s strength.</p><p>Seriously !!!!! but where are we going? Is this what we became?</p><p>Now, <strong><em>I know what Normal means… after all this</em></strong>.</p><p>When I started writing this blog, I was thinking while writing that I have a lot of things to tell and from where should I begin and where to end but I hope you all understood what I wanted to say.</p><p>Try to retrospect your past 2.5 years, hope you will find a lot of similarities with what I had.<br>And even if not, I hope you all are fine 😊 and healthy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c14282d41d7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maven and Creating Maven Project using Archetype]]></title>
            <link>https://usha-dewasi.medium.com/maven-and-creating-maven-project-using-archetype-fb753fe089fb?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb753fe089fb</guid>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[archetypes]]></category>
            <category><![CDATA[build-tool]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[apache-maven]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Thu, 28 Oct 2021 07:03:44 GMT</pubDate>
            <atom:updated>2021-10-29T06:24:32.452Z</atom:updated>
            <content:encoded><![CDATA[<h3>Maven and Creating Maven Project using Archetype in Secs</h3><p><strong>Expectations from the article:</strong><br>- <em>What is the Build tool and different types of build tools?<br> -</em><strong><em>What is Maven?</em></strong><em><br>- Where to find Maven dependencies?<br>- </em><strong><em>How to create a Maven Project in a few seconds?</em></strong></p><p><strong>Build Tool<br></strong>It’s an essential tool required for the process of building an Application/Project.</p><p>It does the following:<br>* Generating the Source code<br>* Generating documentation from the source code<br>* Compile the source code<br>* Package the source code into Jar<br>* Install the Packaged code into the repository</p><p>Few types of build tools:<br>- <strong>Maven</strong><br>- Gradle<br>- Webpack<br>- Gulp<br>- CMake</p><p><strong>What is Maven?</strong><br>- Maven is the most commonly used build tool that helps in project management. The build tool helps in building and documenting the Project.</p><p>It is based on <strong>P</strong>roject <strong>O</strong>bject <strong>M</strong>odel and that’s the reason you can also find POM.xml in the root directory of your project.<br>POM contains all the dependencies and configurations required for your project. When you execute a task, MAVEN will try to search for POM.xml</p><p><strong>Maven (mvn) dependencies can be found</strong> at: <a href="https://mvnrepository.com/">https://mvnrepository.com/</a></p><p><strong>Different approaches to creating mvn project:</strong><br>- From IDE<br>- Spring initializr: <a href="https://start.spring.io/">https://start.spring.io/</a><br>- From Command-line (CLI)</p><p><strong>How to create a maven project using CLI in secs?</strong><br>- mvn project can be generated <strong>using archetype</strong>.</p><p>Archetype: <strong><em>It is a templating toolkit</em></strong></p><p>To create a simple mvn project, execute the below command:</p><pre>mvn archetype:generate \<br>-DgroupId=com.mycompany \<br>-DartifactId=my-project \<br>-DarchetypeArtifactId=maven-archetype-quickstart \<br>-DarchetypeVersion=1.4</pre><pre><strong>OR</strong></pre><pre>mvn archetype:generate \<br>-DarchetypeGroupId=org.apache.maven.archetypes \<br>-DarchetypeArtifactId=maven-archetype-quickstart \<br>-DgroupId=com.mycompany \<br>-DartifactId=my-project</pre><p><strong><em>Note:</em></strong> These must all be on a single line. This will create a directory called my-project containing all the project descriptors so that you do need not create any project skeleton. <br>You can disable the interactive mode by setting it <strong>false</strong> but it&#39;s good to have it.</p><p>OR</p><p>Use the command mvn archetype:generate , by doing so it will ask you all other details like groupId, artifactId, version, package etc one by one(<em>there is some default value for some of the fields like Version</em>) which in the above case we did all in one line as part of our command and at the end, it will show you all the value you provided and ask for confirmation.</p><blockquote><strong>References:</strong><br><a href="https://maven.apache.org/what-is-maven.html#providing-guidelines-for-best-practices-development">Best practices</a><br><a href="https://maven.apache.org/pom.html">Details about POM</a><br><a href="https://maven.apache.org/users/index.html">For Quickstart and Troubleshooting</a></blockquote><p><strong><em>Intention</em></strong>: To make learning Simple. Let me know if you have any feedback or what to know something specific.<br>HAPPY CODING!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb753fe089fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices: Saga Pattern]]></title>
            <link>https://usha-dewasi.medium.com/microservices-saga-pattern-d90af751bea4?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/d90af751bea4</guid>
            <category><![CDATA[sec]]></category>
            <category><![CDATA[saga-pattern]]></category>
            <category><![CDATA[technical-error]]></category>
            <category><![CDATA[data-consistency]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Sun, 21 Feb 2021 12:32:34 GMT</pubDate>
            <atom:updated>2021-02-21T12:32:34.726Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will help you to get to understand the followings in a better way:</p><blockquote>- What is “Saga”?<br>- Why and where we need Saga?<br>- How to use Saga?<br>- What important points to be considered while saga Implementation?<br><strong>Note</strong>: Beware of taking care of Technical error while using Saga Pattern.</blockquote><p>Saga: The term ‘<strong><em>saga’ </em></strong>was coined by <a href="https://dl.acm.org/doi/10.1145/38714.38742">Hector Garcia-Molina in 1987</a>.</p><p><strong>What is Saga?</strong><br>It&#39;s a mechanism that divides long-lived, distributed transactions into quick ones with compensating actions for recovery.<br>It&#39;s a useful way to implement <strong><em>eventually consistent transactions</em></strong>.<br>Saga focuses mainly on transactional aspects of atomicity and consistency.</p><p><strong>Background and Problem</strong><br>In microservice, we usually say that each service must have its own database. However, some business transactions span multiple services. But how to model our business transactions that require inputs from multiple services?<br>e.g. <br>- Money transfer from one bank to another.<br>- Online food delivery system.</p><p><strong>Traditional approach</strong>: is using distributed transactions across multiple services, databases or message brokers. It uses 2PC(2 phase commit) to ensure whether the transaction either is committed or rolled back.</p><p><strong>Problems using Distributed Transactions:</strong><br>- Many modern technologies are not being supported by Distributed transactions e.g. Kafka or rabbitMQ (message brokers), Cassandra(NoSQL database) is not being supported.<br>- In order to commit using the traditional approach, all the required services need to be available and it forms a synchronous IPC, which reduces the total availability.</p><p><strong>Solution:</strong><br>To solve the complex problem of maintaining consistency, we need to use a mechanism that is based on the concept of loose coupling and asynchronous services.<br>Here sagas come into the picture to provide an effective and robust solution to this.<br>Define a saga for each system that needs to update data in multiple services. Saga is a sequence of local transactions. Each local transaction updates the data within the single service and to maintain data consistency these services coordinate with each other using asynchronous messaging.<br>Sagas don’t follow the ACID properties as they <strong>lack isolation</strong>, which means it only follows ACD properties.</p><p>As of now, we understood that local transaction commits takes place, so it needed to have compensating transactions too for rollback using compensate request meaning Saga manage itself for failure management when needed.<br>Compensation requests are idempotent.</p><p><strong>How does Saga work?</strong><br>For implementing sagas, the saga pattern requires a <strong><em>cycle log</em></strong>, which basically records the start of a saga and also all the requests. The process is coordinated using the <strong><em>Saga Execution Coordinator</em></strong>(SEC)</p><p><strong>Types of SEC:</strong></p><ol><li><strong><em>Choreography based</em></strong> — Distribute the decision making and sequencing among saga participants/services. They primarily communicate by exchanging <strong><em>domain events</em></strong>. The triggering service will not be aware of how other services are communicating with each other but in the end, it will get the response.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5vxSyoXym0fughlwMRuKg.png" /></figure><p><strong><em>2. Orchestration based </em></strong>— Saga’s coordination logic is kept in Centralize orchestrator which sends the <strong><em>command messages</em></strong> to services telling them which service has to perform which operation. The triggering service will always be aware of how other services are communicating with each other and it will also get the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XyCHDgsUvnzs0YILEa_Clw.png" /></figure><p><strong>Most Important points to be considered while implementing Saga Pattern:</strong><br>- Only be used to roll back transactions logically, occurred due to business errors.<br>- Saga Pattern doesn’t deal with technical errors.</p><h3>Explanation:</h3><p>Saga Pattern is most popular in the Payment session(fintech domain).<br>Let’s take up a scenario where I as a customer trying to use an expired credit card, will get the error saying <strong><em>your Card is no more Valid</em></strong>. This is part of violating business validation — <strong><em>Saga Worked 👍🏼</em></strong></p><p>But what if I am using a valid Prepaid card with a future expiration date but also not having sufficient money in it. I started doing shopping but at the time of reading/writing the database something technical error happened (could be an infrastructure issue) and at this moment the event got lost somehow then the rollback of the transaction will not be possible but the transaction will take place meaning my order got placed successfully. In this case, the <strong><em>Saga Pattern 👎🏻 failed.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d90af751bea4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Choice: Risk OR Convenience?]]></title>
            <link>https://usha-dewasi.medium.com/your-choice-risk-or-convenience-7d9f709b389f?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d9f709b389f</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[protocol]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[whatsapp]]></category>
            <category><![CDATA[facebook]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Sun, 10 Jan 2021 11:48:30 GMT</pubDate>
            <atom:updated>2021-01-10T11:48:30.986Z</atom:updated>
            <content:encoded><![CDATA[<p>Your Choice: Risk OR Convenience?</p><p>Be aware of what are you agreeing for…</p><p>Many of you heard a lot about WhatsApp in recent days because of the <strong>Updated Policy.</strong></p><p>It’s important to discuss and get more clarification on what this WhatsApp new Policy is all about because WhatsApp is being used by more than 1.5 billion people worldwide.<br>On a personal level, I must admit that WhatsApp made my life very easy while staying away from my friends and family in this corona situation.<br>I hope, you all can also relate to your condition and how your WhatsApp usage got raised.<br>It because an essential part of life.<br>I am not sure about other countries but in India, the government documents are also being shared via WhatApp and are accepted legally too.<br>I am a bit surprised too to understand the psychology behind how WhatsApp is the most popular App among Uneducated people too.</p><p>Generally, I don’t write about such topics but Now I think that this time, it&#39;s really needed because many of us unintentionally just accept and click on the AGREE button for policies/Terms and Condition of the app we use.<br>I request you all to read the detailed policy here: <a href="https://www.youtube.com/redirect?v=e0qm0aFWPdY&amp;redir_token=QUFFLUhqbkpnUzVpSExHRUllN3VYT0p4REVxM1BicmJXZ3xBQ3Jtc0tscU9vSEYxMGZKWkF6N29KaEdPdlhTaFhkSjRERzNzNEdKb1plTjVFTFFmTl93d2RMcnhiTEk4Rm1qRkc4aWt6Y19BM0w5eG5jMnRtRUU0M25WZEVRVk1UNDJKQjM5WmZONExLZlpEN1dsc0FmRUZWWQ%3D%3D&amp;event=video_description&amp;q=https%3A%2F%2Fwww.whatsapp.com%2Flegal%2Fupdates%2Fprivacy-policy%2F">https://www.whatsapp.com/legal/update...</a> and also let your friends and family about it but don’t spread wrong info and rumors about it.<br>After knowing the Policy it&#39;s your choice whether you want to stop using it Or want to continue the usage.</p><p><strong>1st: <em>Rumors and fact Checking</em></strong></p><p><strong>Rumor</strong>: All our data, specifically the messages/chats will be shared by the WhatApp to the parent company FACEBOOK and other the 3rd parties.<br><strong>Fact</strong>: <br><strong>For WhatsApp</strong>: Still, the newly updated policy states that the messages come with E2E encryption. I will try to give you an overlook.<br><strong><em>BUT</em></strong> <br><strong>For Bussiness WhatsApp</strong>: YES, your details will be shared and WhatsApp may take your Personal chats too if it&#39;s done via Bussiness WhatsApp.</p><p><strong>Detail</strong>:<br>For Encryption, many of the messenger services use the signal protocol for encryption.<br><strong>Signal is an open-source protocol </strong>from Open Whisper Systems that was developed by security experts Trevor Perrin and Moxie Marlinspike and is now considered the <strong><em>encryption standard</em></strong>. The encryption protocol was checked by international security researchers and is considered very secure. It is also recommended by Edward Snowden.</p><p><strong>2nd: <em>Account deletion🤔?</em></strong></p><p>Even if you delete your WhatsApp account, the already shared information(especially after your agreement with the policy) will remain with WhatsApp.</p><p><strong>3rd: </strong><em>What will be </em><strong><em>shared after the updated policy?</em></strong></p><p>WhatsApp will share its users’ personal information, including phone numbers, IP addresses, contacts, &amp; more with Facebook from Feb. 8</p><p><strong>4th: <em>What if I don’t accept ‘Terms and Conditions’?</em></strong></p><p>You will not be able to use WhatsApp after 8 Feb.</p><p>If you are sad ☹️ now, don’t want to compromise your privacy, and are thinking 🤔, what to do then don’t worry we have some good alternatives 😊</p><ol><li>Signal which is very much similar to WhatsApp but without any compromise and also based on Signal protocol plus the encryption is by default.<br>For using this app, you need to provide your phone number as you will get the OTP (One-time password/pin) and the username is mandatory too but in the username, you can provide anything(Smiley will work too 😊)</li><li>Telegram App: It requires opt-in encryption.</li></ol><p>I am a bit scared to use WhatApp now, thinking of how FACEBOOK used user’s info with “Cambridge Analytica” for US election campaigns in 2014.</p><p>One thing I forgot to mention, the EU has different terms and conditions. <br><strong>Reason:</strong><br>WhatsApp was in 2014 purchased by data giant Facebook. With the takeover came an update of the terms of use, which met with criticism and aroused suspicion, especially in Europe. Data from WhatsApp should be shared with the Facebook group. Because of the criticism — also <a href="http://www.cnet.de/88166823/eu-kritisiert-wahtsapp-in-offenem-brief/">from the EU</a> — <a href="http://www.computerbild.de/artikel/cb-News-Internet-WhatsApp-Facebook-stoppt-Datenaustausch-in-Europa-16099541.html">WhatsApp stopped the data exchange with Facebook</a> again <a href="http://www.computerbild.de/artikel/cb-News-Internet-WhatsApp-Facebook-stoppt-Datenaustausch-in-Europa-16099541.html">in Europe</a>. But the story still leaves a pale aftertaste, especially since the legal dispute has not yet been resolved.<br>In May 2020: <a href="https://www.dw.com/en/germanys-data-chief-tells-ministries-whatsapp-is-a-no-go/a-53474413">https://www.dw.com/en/germanys-data-chief-tells-ministries-whatsapp-is-a-no-go/a-53474413</a></p><p><strong><em>Putting a few references for you</em></strong>:</p><p><a href="https://www.welivesecurity.com/2021/01/07/whatsapp-updates-privacy-policy-share-user-data-facebook/">https://www.welivesecurity.com/2021/01/07/whatsapp-updates-privacy-policy-share-user-data-facebook/</a></p><p><a href="https://www.dw.com/en/whatsapp-update-to-expand-data-sharing-sparks-criticism/a-56164619">https://www.dw.com/en/whatsapp-update-to-expand-data-sharing-sparks-criticism/a-56164619</a></p><p><a href="https://thewire.in/tech/whatsapp-updated-policy-data-sharing-criticism">https://thewire.in/tech/whatsapp-updated-policy-data-sharing-criticism</a></p><p><a href="https://indianexpress.com/article/technology/social/whatsapp-new-2021-terms-of-service-and-privacy-policy-new-changes-accept-or-delete-7134815/">https://indianexpress.com/article/technology/social/whatsapp-new-2021-terms-of-service-and-privacy-policy-new-changes-accept-or-delete-7134815/</a></p><p><a href="https://www.thequint.com/collection/privacy-matters">https://www.thequint.com/collection/privacy-matters</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d9f709b389f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes: Observability/Health Check]]></title>
            <link>https://usha-dewasi.medium.com/kubernetes-observability-health-check-43ed724d7c77?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/43ed724d7c77</guid>
            <category><![CDATA[livenessprobe]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[probe]]></category>
            <category><![CDATA[readiness]]></category>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Sat, 29 Aug 2020 16:50:29 GMT</pubDate>
            <atom:updated>2020-08-29T16:50:29.991Z</atom:updated>
            <content:encoded><![CDATA[<p>What this article contains :<br>- What is the need of Observability OR Health check<br>- How to do Heath check<br>- What are Probes in term of Kubernetes<br>- Type of Probes<br>- Purpose of these probes and how they are different from each other <br>- Different implementation mechanisms<br>- How to Configure these different implementations<br>- Why and how to write named port<br>- Commands to see these probe status and How to troubleshoot if some problem exit in your config file.<br>- Few tips to understand 😊<br>- Summary</p><h3>Why Heath check is needed?</h3><p>We all know that Kubernetes can autoscale (up or down)the service instances as per need but how Kubernetes know whether the container inside a pod is up and running?<br>- Then here comes the term <strong>Health check</strong> which means continuously keeping track of.<br>Now the question is what actually is being done here and how?<br>- <strong>Probes</strong></p><blockquote>A Probe is a diagnostic performed periodically by the kubelet on a Container. To perform a diagnostic, the kubelet calls a Handler implemented by the container (Implementation mechanism).</blockquote><p><strong>Pods</strong> are the smallest deployable unit that may contain one or more containers in it. Container <strong>probes</strong> are small processes that run periodically. The result of these <strong>probes</strong>(Success, Failed, or Unknown ) determines the container’s state.</p><p>Liveness probes try to keep pods healthy by restarting them again, whereas readiness probes make sure that pods are ready to serve requests by receiving them only when all the containers inside that particular pod are ready. <br>(<em>check below diagrams for both probes to get a better understanding</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*jmt8rFK5iSJpU12eeVR5-Q.png" /></figure><p>Both the probes(<strong>readiness and liveness</strong>) have <strong><em>3 mechanisms </em></strong>to get implemented.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_akHwiz9-QAAC_hJPSiq3w.png" /></figure><p>Few important Fields that can be used to precisely control the behaviour of liveness and readiness checks are:</p><ul><li>initialDelaySeconds: The number of seconds after the container has started before liveness or readiness probes are initiated.<br>The minimum(Defaults) value is 0.</li><li>periodSeconds: How often (in seconds) to perform the probe.<br>Default value: 10 seconds<br>The minimum value is 1</li><li>Additional fields in case of HTTP GET are host, scheme, path, httpHeaders, port</li></ul><h3>Readiness probes:</h3><p>This probe check “Is pod ready to serve the request?”<br>It runs on the container during its whole lifecycle because a pod is considered as ready when all the container/containers inside the pod are ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HctaEGzYToIYNsOqq_QXOw.png" /></figure><p>When the pod is ready(meaning all containers are ready inside it), then in <strong>Status </strong>will also change from “pending” to “running” (if no problem exists else some other status will be provided)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vwi-9pXqUdM6OKwBaNoBgQ.png" /></figure><p>If a pod’s readiness probe fails, the pod is removed from the Endpoint object meaning now the client connected to the service will not be redirected to this pod.</p><h3>Adding readiness probe to a pod in your .yaml:</h3><h3>1. Exec:</h3><p>Containers status is determined by the process’s exit status code.</p><pre><strong>readinessProbe</strong>:<br>  <strong>exec</strong>:<br>    <strong>command</strong>:<br>    - cat<br>    - /tmp/healthy<br>  <strong>initialDelaySeconds</strong>: 5<br>  <strong>periodSeconds</strong>: 5</pre><h3>2. HTTP GET</h3><p>It sends the request to the container and the HTTP status code of response determines whether the container is ready or not.</p><pre><strong>readinessProbe:<br>  httpGet:<br>    path: </strong>/health<strong><br>    port: </strong>http<strong><br>  initialDelaySeconds: </strong>5<strong><br>  periodSeconds: </strong>10<strong><br>  timeoutSeconds: </strong>5<strong><br>  failureThreshold: </strong>10</pre><h3>TCP Socket</h3><p>It opens a TCP connection to the specified port of the container. If the connection is established then the container is considered ready.</p><pre><strong>readinessProbe</strong>:<br>      <strong>tcpSocket</strong>:<br>        <strong>port</strong>: 8080<br>      <strong>initialDelaySeconds</strong>: 5<br>      <strong>periodSeconds</strong>: 10</pre><h3>Liveness Probes:</h3><p>Many applications running for long periods of time eventually transition to broken states, and cannot recover except by being restarted. So, Kubernetes will periodically execute the probe and restart the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-h7L5I_yCeencHXnl6MaA.png" /></figure><h3>1. Exec:</h3><p>It executes a command inside the container and checks the process’s exit status code.<br>If the status code is <strong>o, </strong>it is successful but all other codes are considered as failure.</p><pre><strong>livenessProbe</strong>:<br>      <strong>exec</strong>:<br>        <strong>command</strong>:<br>        - cat<br>        - /tmp/healthy<br>      <strong>initialDelaySeconds</strong>: 5<br>      <strong>periodSeconds</strong>: 5</pre><h3>2. HTTP GET</h3><p>It sends the request to the container based on the IP address, port, the path you provide. If the HTTP status code of the response is in between 2xx or 3xx, the probe is considered as successful but if the server returns an error or even if don’t respond it is a failure and time for probe to restart the container.</p><pre><strong>livenessProbe</strong>:<br>      <strong>httpGet</strong>:<br>        <strong>path</strong>: /healthz<br>        <strong>port</strong>: 8080<br>        <strong>httpHeaders</strong>:<br>        - <strong>name</strong>: Custom-Header<br>          <strong>value</strong>: Awesome<br>      <strong>initialDelaySeconds</strong>: 3<br>      <strong>periodSeconds</strong>: 3</pre><h3>TCP Socket</h3><p>It opens a TCP connection to the specified port of the container. If the connection is established then the is probe is ok else the container needs to be restarted.</p><pre><strong>livenessProbe</strong>:<br>      <strong>tcpSocket</strong>:<br>        <strong>port</strong>: 8080<br>      <strong>initialDelaySeconds</strong>: 15<br>      <strong>periodSeconds</strong>: 20</pre><h3>Named Port:</h3><p>As the topic(Named port) is self-explanatory that we can provide a name to a port and that is called as “Named port”. <br>But the question is why we need it?<br>-In the configuration .yaml file, we use the port number at a number of places and its always a good idea to make your file look clean and easy to read along with minimising the error changes which can happen while providing the port number. e.g.</p><pre><strong>ports</strong>:<br>- <strong>name</strong>: liveness-port<br>  <strong>containerPort</strong>: 8080<br>  <strong>hostPort</strong>: 8080<br><br><strong>livenessProbe</strong>:<br>  <strong>httpGet</strong>:<br>    <strong>path</strong>: /healthz<br>    <strong>port</strong>: liveness-port</pre><h3>Commands to check the status of your pod and troubleshoot if any problem exists in your config:</h3><ol><li>check all pods</li></ol><pre>$ kubectl get all</pre><pre> OR </pre><pre>$ kubectl get pods -n &lt;your NameSpace&gt;</pre><p>2. If Pod “xyz” fails then Check the detailed information of failed pod</p><pre>$ kubectl describe pod xyz</pre><p>3. Check the root cause, what caused this failure.</p><pre>$ kubectl logs xyz</pre><p>4. If You want more into it, then shell into the container to get the understanding of what files and created and where they are placed.</p><p>5. If you want to write or edit the config file, use</p><pre>$ vim &lt;.yaml file&gt;</pre><p>[<strong><em>Note</em></strong>: you can also use Kubernetes dashboard to check pod status]</p><blockquote><strong>Tips:</strong><br>1. Readiness probes are configured similarly to liveness probes. The only difference is that you use the <em>readinessProbe</em> field instead of the <em>livenessProbe</em> field.<br>2. Use namespace corresponding to pods in command line</blockquote><h3>Summary :</h3><p>Readiness and Liveness probes are used for Kubernetes Health check.<br>Readiness checks whether the container/containers inside the pod are ready to receive Incoming traffic or not while Liveness probe checks whether the container is still alive or not if not then restart it.</p><p>[<strong>NOTE</strong> : startupProbe Indicates whether the application within the container is started. All other probes are disabled if a startup probe is provided until it succeeds. A container does not provide a startup probe, the default state is Success. And that’s the reason we haven’t discussed startupProbe in this article]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43ed724d7c77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes: Centralized Configuration Data And Secrets]]></title>
            <link>https://usha-dewasi.medium.com/kubernetes-centralized-configuration-data-and-secrets-cc122736348d?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc122736348d</guid>
            <category><![CDATA[configmap]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[centralized-configuration]]></category>
            <category><![CDATA[secrets]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Wed, 12 Aug 2020 05:56:53 GMT</pubDate>
            <atom:updated>2020-08-12T05:56:53.493Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why we need Configuration as Data?</h3><p>We need Configuration as centralised data as it fulfils the below-mentioned criteria:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EhLrEbyLqp7mAG1MyTsigg.png" /></figure><ul><li><strong><em>Abstraction</em></strong>: If the Configuration is external to the container, Kubernetes can destroy and create pods independent of the actual state of the container.</li><li><strong><em>Reusability</em></strong>: Same configuration data can be used by one or many pods. We might not want to share the storing configuration information inside a container which we might share publicly.</li><li><strong><em>Service discover</em></strong>: We can use Configuration data to locate service in and out of the cluster.</li><li><strong><em>Data Protection</em></strong>: We need to be able to protect sensitive information. By using storing configuration as data inside of our cluster, we can keep passwords outside of the container image and easily share the image with anyone we want.</li></ul><h3>Runtime Configuration Injection through Object Reference :</h3><p>This can be done in pods via 2 ways: <strong><em>ConfigMap and Secret</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RvCbbc33G8bB9FW_vWcj4A.png" /></figure><p>Let’s first go through ConfigMap and than later with secrets.</p><h3>ConfigMap</h3><p>A ConfigMap is an API object used to store non-confidential data in key-value pairs. A ConfigMap allows you to decouple environment-specific configuration from your container images so that your applications are easily portable. It is having 2 parts: One is to <strong>create</strong> and Other is to <strong>consume </strong>it.</p><p>To create a ConfigMap object, we’ve to add a kubectl command called kubectl create configmap that offers three different ways to specify key-value pairs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJPJOilECd4AIRrYczvgtA.png" /></figure><h3>Commands to Create ConfigMap (imperative) :</h3><p># <strong><em>Literals<br></em>Case 1<em>. </em></strong><em>Create a new configmap named my-config with key1=config1</em></p><p>kubectl create configmap my-config <strong>--from-literal</strong>=key1=config1</p><p><strong>Case 2.</strong><em>Create a new configmap named my-config with key1=config1 and key2=config2 (meaning with numbers of key-value pairs)</em></p><p>kubectl create configmap my-config <strong>--from-literal</strong>=key1=config1 <strong>--from-literal</strong>=key2=config2</p><p># <strong><em>Individual file with environment variables<br></em></strong>kubectl create configmap my-config <strong>--from-env-file</strong>=config.txt</p><p><em># </em><strong><em>File or directory<br></em></strong>kubectl create configmap my-config <strong>--from-file</strong>=config.txt</p><p><em>ConfigMap does not provide secrecy or encryption. If the data you want to store are confidential, use a </em><a href="https://kubernetes.io/docs/concepts/configuration/secret/"><em>Secret</em></a><em> rather than a ConfigMap, or use additional (third party) tools to keep your data private e.g. Ansible</em></p><h3>Creating ConfigMaps (Declarative):</h3><p>Meaning we first start by configuring the .yaml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*IcvSftY-KtqqIhvw1apScQ.png" /></figure><h3>Mounting/Consuming a ConfigMap:</h3><ol><li>Injected as environment variables</li><li>Mounted as volume</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YjwUCz0cCbwFGildUB-RHw.png" /></figure><h3>Secrets:</h3><p>Kubernetes Secrets let you store and manage sensitive information, such as passwords, OAuth tokens, and ssh keys. Storing confidential information in a Secret is safer and more flexible than putting it in a Pod definition or a container image.</p><p>Creating secrets is very much similar to configMap, the main difference is that secrets use <strong>base64-encoded value</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2Qnls3Na2FPulyfddR-EA.png" /></figure><p>Let’s see how to create secrets using imperative way.</p><h3>Commands to Create Secrets (imperative) :</h3><p># <strong><em>Literals<br></em></strong><em>Create a new secret named my-secret with pwd=admin</em></p><p>kubectl create secret generic db-secret <strong>--from-literal</strong>=pwd=admin</p><p># <strong><em>file with environment variables<br></em></strong>kubectl create secret generic db-secret <strong>--from-env-file</strong>=secret.env</p><p><em># </em><strong><em>SSH key File<br></em></strong>kubectl create secret generic ssh-key-secret --from-file=ssh-privatekey=/path/to/.ssh/id_rsa</p><h3>Creating Secrets (Declarative):</h3><p>Meaning we first start by configuring the .yaml<br>For that, we first need to manually encode into base64.</p><p>The name of a Secret object must be a valid <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names#dns-subdomain-names">DNS subdomain name</a>. The <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#secret-v1-core">Secret</a> contains two maps: data and stringData. The data is used to store arbitrary data, encoded using base64, stringData is provided for convenience and allows you to provide secret data as unencoded strings.</p><p>echo -n &#39;admin&#39; | base64</p><p>You need to put the value in the above command for which you want secret instead of ‘admin’.<br>Once you get the secret than put the value in YAML like :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*2RvFujqdlkHGE9A3pXW-OQ.png" /></figure><h3>Secrets in Pods as Volume :</h3><p>Value has to be encoded into base64, manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*vyN3CICnnq_UFiPGpQ_r6g.png" /></figure><p><strong>Conclusion:</strong><br>I hope this article will be helpful to get a step by step understanding of configuring in Kubernetes, especially for the beginners.<br>Share your feedback/response, it motivates to write more articles and more videos.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc122736348d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes: Core Concept]]></title>
            <link>https://usha-dewasi.medium.com/kubernetes-core-concept-4f9902db27c7?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f9902db27c7</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubectl]]></category>
            <category><![CDATA[pods]]></category>
            <category><![CDATA[kubernetes-object]]></category>
            <category><![CDATA[kubernete-components]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Sun, 26 Jul 2020 13:50:50 GMT</pubDate>
            <atom:updated>2020-07-26T13:50:50.503Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why this Article???</h3><p><strong><em>*</em></strong><em> Basic understanding of Kubernetes<br></em><strong><em>*</em></strong><em> What is Kubernetes Object, how to create and manage them?<br></em><strong><em>*</em></strong><em> What is Pod?<br></em><strong><em>*</em></strong><em> How to configure pods and debug them?<br>* Hands-on knowledge along with theory.</em></p><h3>What is Kubernetes?</h3><ul><li>Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem.</li></ul><p>One liner definition would be that Kubernetes is an open system platform as service, used for Container-Orchestration.</p><h3>Why we need Kubernetes?</h3><ul><li>Containers are a good way to bundle and run your Application. In a production environment, there is not one but many containers running that needs to be managed in order to give assure of zero downtime for your application.<br>E.g. If a container goes down, another container needs to start. Wouldn’t it be easier if this behaviour was handled by a system? Think 🤔 about it, Isn’t it a good idea to get rescued by Kubernetes?</li></ul><p>In past we have seen different ways of deployment :<br>1. Traditional Deployment (having physical servers)<br>2. Virtualized Deployment (using Hypervisor and VM’s)</p><p>But now we have : <br>Container Deployment (Using Docker, Kubernetes or AWS etc…)</p><p><strong><em>For getting the hands-on experience you can use Kubernetes but from a learning perspective, it will be a good idea to get started with Minikube.<br></em>[Note:]</strong> If you installed Minikube locally, run <strong>minikube start</strong>.</p><h3>Kubernetes Components :</h3><p>A Kubernetes cluster consists of the components that represent the control plane and a set of machines called nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*24oloz5b_cZ3i4QXupiQbQ.png" /></figure><p><strong>Command to use Kubernetes is :</strong> kubectl(people pronounce it in different ways)</p><h3>Kubernetes Object:</h3><p>These are persistent entities in the Kubernetes system and is used to represent the state of your cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuH8Dc4wYFtsZo3bQ6AFIA.png" /></figure><p>These objects can describe:<br><em>* What containerized applications are running (and on which nodes)<br>* The resources available to those applications<br>* The policies around how those applications behave, such as restart policies, upgrades, and fault-tolerance.</em></p><p>In spec (Specification), we write what we need Kubernetes to do but the status gives the actual status. These objects are created by us but Kubernetes is responsible to maintain and minimize the difference between Spec and the Status.<br>So, let’s take the same example as above that a container is down which mean there is a gap between our desire and the actual state so here Kubernetes will instantly create a replica of the container.</p><h3>How To Create and Manage these Objects?</h3><p>While creating a Kubernetes object, always keep in mind that there are different techniques depending on how and where you what to create these objects as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CeanSKIdEZ_zbtw2kg8d1g.png" /></figure><p><strong>Imperative commands</strong> work on Live objects so it is fast but at the same time developer need to have detailed knowledge as there is <strong><em>no track/history</em></strong> maintained.</p><p>$ kubectl create namespace &lt;provide namespace&gt;<br>$ kubectl run &lt;podName&gt; --image=nginx --restart= never --namespace=&lt;namespace&gt;<br>$ kubectl edit pod/&lt;podName&gt; --namespace=&lt;namespace&gt;</p><p>By using — restart=never, it automatically understands that a pod needs to be created.</p><p><strong>Declarative object configuration</strong> is suitable for more elaborative changes as it is opposite of the previous one, it takes<strong><em> .yaml file</em></strong> at the very first place and also maintain the log of all the transactions done in past. It enables working on directories, where different operations might be needed for different objects.</p><p>$ kubectl create -f &lt;filename&gt;.yaml<br>$ kubectl delete pod/&lt;podName&gt;</p><p>[Note]: You can <strong>mix</strong> these different techniques/methods but it is highly <strong><em>recommended not to do.</em></strong></p><h3>What is Pod?</h3><p>The pod is the smallest executable unit in Kubernetes application. It encapsulates an application’s container (or, in some cases, multiple containers) and shared resources.<br>Most commonly used container is Docker but pods support others too.<br>When a Pod gets created (directly by you, or indirectly by a <a href="https://kubernetes.io/docs/concepts/architecture/controller/">_controller_</a>), it is scheduled to run on a <a href="https://kubernetes.io/docs/concepts/architecture/nodes/">Node</a> in your cluster. The Pod remains on that node until the process is terminated, the pod object is deleted, the Pod is <em>evicted</em> for lack of resources, or the node fails. Pods are incapable of self-healing.<br>If the pod is having multiple containers than the containers communicate with each other locally inside the pod via localhost but if container wants to communicate other containers, not belonging from the same container than the communication takes place via the port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6iAdQAk_aKGOCBl1B8dOnA.png" /></figure><p>The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zsG3pDRmY3QtTpUfa93HCg.png" /></figure><p>Let’s see how to proceed towards our hands-on practice using the below commands: <br>Create an alias for kubectl ( avoid typo mistake and work faster)<br>$ alias k=kubectl</p><p>$ k version</p><p><strong>Shortcuts: </strong><br>$ kubectl get ns (where ns is namespaces)</p><p>$ kubectl describe pvc claim(persistent volume claims)</p><p><strong>Delete Kubernetes Objects:</strong><br>$ kubectl delete pod &lt;podname&gt; --grace-period=0 --force<br>so that you need not wait for all the process to get deleted</p><p>For Configuring Pods and debugging them is shown in the hands-on practice Video tutorial.</p><p><a href="https://www.youtube.com/watch?v=rNc92EsfcJI&amp;feature=youtu.be">https://www.youtube.com/watch?v=rNc92EsfcJI&amp;feature=youtu.be</a></p><p><strong>Conclusion</strong>: Here, I tried to provide a basic understanding of the core Kubernetes concepts via theory as well as a practical overview. Hope now where will be some difference in your understanding when you started and now at the end after going through the article and video. This is the first time I made a video, So really sorry if the video quality is not that good.</p><p>Your feedback matters a lot to improve constantly and to keep motivated too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f9902db27c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overview  to Helm]]></title>
            <link>https://usha-dewasi.medium.com/overview-to-helm-b8a2d97b9902?source=rss-f9196eb33547------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8a2d97b9902</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[helm]]></category>
            <dc:creator><![CDATA[Usha Devasi]]></dc:creator>
            <pubDate>Sat, 25 Jul 2020 10:21:01 GMT</pubDate>
            <atom:updated>2020-07-25T10:21:01.599Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview to Helm</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*LhpwAOc6BCEkEp9xRA6w6A.png" /><figcaption><a href="https://www.pngwing.com/en/free-png-zyycn">Helmsman</a></figcaption></figure><h3>What’s HELM?</h3><ol><li>A <a href="https://en.wikipedia.org/wiki/Helmsman"><strong><em>helmsman</em></strong></a><em> or </em><strong><em>helm</em></strong> is a person who steers a ship, sailboat, submarine, other type of maritime vessel, or spacecraft.</li><li><a href="https://helm.sh/"><strong><em>The package manager for Kubernetes</em></strong></a><strong><em>,</em></strong> Helm is the best way to find, share, and use software built for Kubernetes.</li></ol><p>In simpler words, Kubernetes is a steer/wheel of the ship and Helm is the person who helps in navigation using the Steer.</p><h3><strong>Use HELM, Why ???</strong></h3><p>Kubernetes works like magic 🧙🏻‍♀️ but believe me there is no magic, everything needs to configured. Writing and maintaining YAML manifests for all Kubernetes objects can be a time consuming and tedious task. Even for a simple deployment you would need at least 3 YAML manifests with duplication and hardcoded value and now think how difficult it could be when alot of complicated settings are present and you need to run the same for each and every system. Here comes the Helm, Helm simplify this process and create package which means no more maintaining these kind of random groups of YAML files for describing pods, replica sets, services, RBAC settings, etc. With helm, there is a structure and a convention for a software package that defines a layer of YAML <strong>templates </strong>and another layer that make change in the templates called <strong>values.</strong> These values are injected into templates, thus allowing a separation of configuration, and defines where changes are allowed. This whole package is called a <strong>Helm</strong> <strong>Chart</strong>.</p><p>Essentially, you create structured application packages that contain everything they need to run on a Kubernetes cluster including <strong>dependencies</strong> the application requires.</p><h3>Describing Helm:</h3><p>Helm has two parts : the Client (CLI) and the server(Tiller).<br>The Client lives in Local workspace and the server in Kubernetes cluster to execute whenever required. When you push the resources via CLI then the tiller make sure that the state like create, update, delete etc are properly done from the charts. To understand fully we need to know about 3 concepts and they are as follow:<br><strong>1. Chart : <em>deployable unit for Kubernetes bound applications.<br></em></strong>Charts are used to pack all the required K8S components for an application to deploy, run and scale. It is also where dependencies are defined, and configurations are updated and maintained. In other word’s we can say that it as a package of pre-requisite Kubernetes resources.</p><p>Charts are compromised of several files at specific or well known locations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtXjTwkXcrpi6kPLEIXXKw.png" /></figure><p><strong>2. Release :</strong> A Specific instance of chart which has been deployed using the cluster. when an application is installed by Helm, a release is being created.<br>Releases can be tracked with helm ls</p><p><strong>3.Repository :</strong> Group of published charts which are made available for others OR a place where helm charts are held and maintained. In essence, these are a set of templates and configuration values stored as code, sometimes packed as a .tar.gz file .</p><h3>Installing Helm:</h3><p>For Mac- brew install helm</p><p>For Windows - choco install kubernetes-helm</p><p>For Linux — scoop install helm</p><h3>Benefits of Helm:</h3><p><strong>Manage Complexity:</strong> Charts describe even the most complex apps, provide repeatable application installation, and serve as a single point of authority.</p><p><strong>Easy Updates: </strong>Take the pain out of updates with in-place upgrades and custom hooks.</p><p><strong>Simple Sharing: </strong>Charts are easy to version, share, and host on public or private servers.</p><p><strong>Rollbacks: </strong>Use helm rollback to roll back to an older version of a release with ease.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8a2d97b9902" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>