<?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 Yash Gupta on Medium]]></title>
        <description><![CDATA[Stories by Yash Gupta on Medium]]></description>
        <link>https://medium.com/@yashguptaa?source=rss-8b323afffe56------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Yash Gupta on Medium</title>
            <link>https://medium.com/@yashguptaa?source=rss-8b323afffe56------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:00:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yashguptaa/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[Master the Art of Referencing with React’s useRef Hook: A Beginner’s Guide]]></title>
            <link>https://javascript.plainenglish.io/master-the-art-of-referencing-with-reacts-useref-hook-a-beginner-s-guide-b9b87281320c?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9b87281320c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Mon, 30 Jan 2023 15:46:30 GMT</pubDate>
            <atom:updated>2023-01-30T15:46:30.015Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*TtQ2-IUpQuLiqZ8_9kswew.png" /></figure><p>The useRef hook in React allows you to create a reference to a DOM element or a component instance. This can be useful for various tasks such as creating animations, managing focus or text selection or triggering imperative methods on a component. In this blog post, we will explore the use cases and examples of the useRef hook.</p><p>One common use case for the useRef hook is creating animations. For example, if you want to animate a component&#39;s position or size, you can use the useRef hook to create a reference to the component and then use that reference to update the component&#39;s style directly. Here is an example of how you can use the useRef hook to create an animation that slides a component in and out of view:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06009ce0795a3121b727df3e83ff34aa/href">https://medium.com/media/06009ce0795a3121b727df3e83ff34aa/href</a></iframe><p>Another use case for the useRef the hook is managing focus or text selection. For example, if you want to focus a text input when a component is rendered, you can use the useRef hook to create a reference to the input and then use the .current property to call the focus method on the input. Here is an example of how you can use the useRef hook to focus a text input when a component is rendered:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91609bdb3fef5f5f513d76c207443bd5/href">https://medium.com/media/91609bdb3fef5f5f513d76c207443bd5/href</a></iframe><p>Finally, the useRef the hook can also be used to trigger imperative methods on a component. For example, if you have a custom video player component, you can use the useRef hook to create a reference to the component and then use the .current property to call the play or pause method on the component. Here is an example of how you can use the useRef hook to control a custom video player component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59c30aa0bf39e085ad1938eb33680bbc/href">https://medium.com/media/59c30aa0bf39e085ad1938eb33680bbc/href</a></iframe><p>Here are a few “gotchas” or things to keep in mind when working with the useRef hook in React:</p><ol><li>The useRef hook returns an object with a single property current that initially is set to null. It&#39;s important to keep in mind that current will persist between renders and it&#39;s not a state but a way to store a value that will remain unchanged over time.</li><li>Remember that when you store a value in the current property of a ref, it will not trigger a re-render. So, if you change the value of a ref, it won&#39;t trigger the component to update.</li><li>If you are trying to access the ref before it’s been created, it will return null, so you need to be careful when you try to access the current property of a ref, it&#39;s recommended to check if it&#39;s not null before trying to access it.</li><li>Be careful when passing a ref to a component. React will call the useEffect hook on the component and the component will re-render. This can cause an infinite loop if you&#39;re not careful.</li><li>useRef does not trigger an effect when the component re-renders, so it&#39;s a good way to keep some values that should not change between renders.</li><li>Finally, be mindful that useRef is not a replacement for the state, it&#39;s a way to store a value that should not change between renders and should not trigger a re-render.</li></ol><p>In conclusion, the useRef hook in React is a powerful tool that allows you to create references to DOM elements or component instances. Whether you&#39;re creating animations, managing focus or text selection, or triggering imperative methods on a component, the useRef</p><p><strong><em>Thanks for reading!</em></strong><em><br>Hope you enjoyed this post, follow me on </em><a href="https://www.linkedin.com/in/yg18/"><em>LinkedIn</em></a><em> and </em><a href="https://medium.com/@yashguptaa"><em>Medium</em></a><em> for more content. If you have any feedback or suggestions, leave them in the comments below and I’ll do my best to get back to you.</em></p><p>Do check out my other blogs:</p><ul><li><a href="https://javascript.plainenglish.io/state-management-with-context-api-and-custom-multiselect-hook-in-reactjs-ed3109cce175">State Management with Context API &amp; Custom MultiSelect Hook in React</a></li><li><a href="https://blog.devops.dev/introduction-to-kubernetes-monitoring-and-exploring-prometheus-9bd0358ce504">Introduction to Kubernetes Monitoring And exploring Prometheus</a></li></ul><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>.</em></p><p><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Interested in scaling your software startup</em></strong><em>? Check out </em><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9b87281320c" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/master-the-art-of-referencing-with-reacts-useref-hook-a-beginner-s-guide-b9b87281320c">Master the Art of Referencing with React’s useRef Hook: A Beginner’s Guide</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[State Management with Context API & Custom MultiSelect Hook in React]]></title>
            <link>https://javascript.plainenglish.io/state-management-with-context-api-and-custom-multiselect-hook-in-reactjs-ed3109cce175?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed3109cce175</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Wed, 27 Jul 2022 10:58:25 GMT</pubDate>
            <atom:updated>2022-07-29T06:39:19.574Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to create custom hooks, use Context API in React, and use state management anywhere in your application.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtzvMk9SotP91rpPP1qvJg.png" /><figcaption>State Management with Context API and custom hooks</figcaption></figure><h4>Overview</h4><ul><li>Create a custom multi-select hook</li><li>Create a Context and use the multi-select hook inside it</li><li>Create a demo to test state management using React hooks and context API</li></ul><h4>Prerequisites</h4><ul><li>Basic knowledge about React <a href="https://reactjs.org/docs/hooks-intro.html">hooks</a> and <a href="https://reactjs.org/docs/context.html">Context API</a></li></ul><h4>Section 1: Create a custom multi-select hook</h4><ul><li>The name of the custom hook is useSelection</li><li>We initially declare a useState for our selection. Inside this hook we have three functions : addSelection, addMultipleSelection, and clearSelection.</li><li>addSelection accepts 2 args, item to set and clear to empty the selection.</li><li>addMultipleSelection to set multiple selections inside the array (we will see below how to use it).</li><li>clearSelection to clear the state to an empty array.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a1f7ae8b7b0c10df00bdd23a7397e79/href">https://medium.com/media/8a1f7ae8b7b0c10df00bdd23a7397e79/href</a></iframe><h4>Section 2: Create multiSelectionContext and MultiSelectionProvider</h4><ul><li>Create multiSelectionContext using createContext provided by React.</li><li>Create MultiSelectionProvider which contains the multiSelectionContext.Provider and passes the values from useSelection hook that we created above. This way we can use the useSelection as a context in any part of the application without using prop drilling.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/980505108a2ac92468e63c84363f0381/href">https://medium.com/media/980505108a2ac92468e63c84363f0381/href</a></iframe><h4>Section 3 : Create ListComponent to use the multiSelectionContext</h4><ul><li>In this component, we are creating a list and onClick adding that list item to our state using context and highlighting it using the setSelection and addMultipleSelection functions.</li><li>We also use clearSelection to clear the state once a user clicks on the Clear button.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0827446343a4ff7856c0398688d10b83/href">https://medium.com/media/0827446343a4ff7856c0398688d10b83/href</a></iframe><h4>Section 4: Wrap ListComponent with MultiSelectionProvider</h4><ul><li>The last thing is that we need to wrap the ListComponent with our MultiSelectionProvider so that the component inside can use the values of custom hooks we created.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/206abfabd12febb72b3569ce7903f429/href">https://medium.com/media/206abfabd12febb72b3569ce7903f429/href</a></iframe><h4>The final Component will look like this:</h4><ul><li>On selecting all 3 list items, we see that all have background style updated.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*pdAZrNyQtHcdryec7J4_KA.png" /></figure><ul><li>Also if we log the selection it contains all the 3 list items.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*iJdKqa5fd53bHSi8iw8GiA.png" /><figcaption>selection state value</figcaption></figure><p>Hopefully, you understand how we can create our own custom hooks and use Context API in React to prevent prop-drilling and use state management anywhere in the application.</p><p>You can also view the final code here:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fvm0k9k&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fvm0k9k&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fvm0k9k%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/287d89de90c241ae134d0d4886ef9242/href">https://medium.com/media/287d89de90c241ae134d0d4886ef9242/href</a></iframe><p><strong><em>Thanks for reading!</em></strong><em><br>Hope you enjoyed this post, follow on </em><a href="https://www.linkedin.com/in/yg18/"><em>LinkedIn</em></a><em> and </em><a href="https://medium.com/@yashguptaa"><em>Medium</em></a><em> for more content. If you have any feedback or suggestions, leave them in the comments below and I’ll do my best to get back to you.</em></p><p>Do check out my other blogs:</p><ul><li><a href="https://yashguptaa.medium.com/stages-in-devops-and-tools-used-in-different-stages-of-an-application-da7a476ea02">Stages in DevOps and Tools used in Different Stages of an Application</a></li><li><a href="https://blog.devops.dev/importance-of-logging-in-kubernetes-and-intro-to-grafana-loki-f8dc6f736e6">Importance of Logging In Kubernetes, Intro to Grafana Loki &amp; deploying with helm-charts</a></li><li><a href="https://blog.devops.dev/introduction-to-kubernetes-monitoring-and-exploring-prometheus-9bd0358ce504">Introduction to Kubernetes Monitoring And exploring Prometheus</a></li></ul><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>. Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><strong><em> </em></strong><em>and </em><a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>. Check out our </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Community Discord</em></strong></a><em> and join our </em><a href="https://inplainenglish.pallet.com/talent/welcome"><strong><em>Talent Collective</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed3109cce175" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/state-management-with-context-api-and-custom-multiselect-hook-in-reactjs-ed3109cce175">State Management with Context API &amp; Custom MultiSelect Hook in React</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stages in DevOps and Tools used in Different Stages of an Application]]></title>
            <link>https://blog.devops.dev/stages-in-devops-and-tools-used-in-different-stages-of-an-application-da7a476ea02?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/da7a476ea02</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Sat, 23 Jul 2022 08:03:31 GMT</pubDate>
            <atom:updated>2022-07-27T18:23:56.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*xOlnGImjP5keKltlkI_LMQ.png" /><figcaption>DevOps different stages</figcaption></figure><p>DevOps is a combination of methods and tools that enables businesses to develop, test, and distribute software more quickly and reliably.<br>DevOps can be customized to meet the unique requirements of a project or organization. The process is prone to change as new features and tests are added to create a more secure application or as efforts are made to optimize the pipeline for quicker builds and less manual labor.</p><p>Let’s take a look at various stages in DevOps through which the application goes through from the initial stage to deploying and monitoring it in a production-ready environment.</p><h3>Stages</h3><h4>Development</h4><p>The first stage is writing the code, fixing bugs, and adding new features. For different applications, the skillset of the developer can vary. For example- For frontend development, we need a <a href="https://reactjs.org/">ReactJs</a>/<a href="https://angular.io/">Angular</a> Developer, For the Backend, <a href="https://nodejs.org/en/">NodeJs</a>/<a href="https://www.java.com/en/">Java</a>/<a href="https://www.python.org/">Python</a> are the languages most commonly used.</p><h4>Source Code</h4><p>We need a code editor for building and debugging modern web and cloud applications. There are many editors with different additional features available in the market.</p><p>A few of the popular editors are <a href="https://code.visualstudio.com/">Visual Studio Code(VS Code)</a>, <a href="https://www.sublimetext.com/">Sublime Text</a>, <a href="https://netbeans.apache.org//">Netbeans</a>, <a href="https://atom.io/">Atom</a></p><h4>Repository</h4><p>The project’s files and each file’s revision history are all stored in a central repository. Within the repository, you can manage and discuss the work on your project. Artifact is the Version of the code that we are going to release.</p><p>Famous tools that are used include <a href="https://github.com/">Github</a>, <a href="https://about.gitlab.com/">Gitlab</a>, <a href="https://bitbucket.org/product">Bitbucket</a></p><h4>Unit Test</h4><p>Individual pieces of source code are thoroughly tested using unit tests to see if they are fit for use. It helps catch any bugs or issues in the way the application is expected to behave.</p><p>Few frameworks for testing <a href="https://nunit.org/">NUnit</a>, <a href="https://junit.org/junit5/">JUnit</a>, <a href="https://jestjs.io/">Jest</a></p><h4>Static Code Analysis</h4><p>Static code analysis is a technique for debugging that involves looking at the source code prior to running a program. By comparing a set of code to a set (or sets) of coding standards, it is accomplished.</p><p>Platforms/Tools for Code analysis- <a href="https://www.sonarqube.org/">Sonarqube</a>, <a href="https://github.com/">Github</a>, <a href="https://embold.io/">Embold</a></p><h4>Build</h4><p>After your code is pushed to a repository, it gets tested and needs to pass all the necessary checks in place. A build is run to make it easier for developers to integrate the changes into a project.</p><p>Platforms used — <a href="https://www.jenkins.io/">Jenkins</a>, <a href="https://androidhiro.com/source/android/example/griddle/1474">Griddle</a>, <a href="https://azure.microsoft.com/en-us/services/devops/pipelines/">Azure</a></p><h4>Build and Push Image</h4><p>If your build succeeded, a custom Docker image of your application is created using the Dockerfile. This image is then validated and pushed to the Docker registry which is then used for the deployment of applications to various environments.</p><p>The main tools used are <a href="https://www.docker.com/">Docker</a>, <a href="https://www.ansible.com/">Ansible</a>, <a href="https://podman.io/">Podman</a></p><h4>Deployment of Application</h4><p>Now your application is ready to be hosted on the server. For this many tools can be used. Kubernetes is one such way to run containerized applications on a cluster of hosts. It makes deploying and managing large-scale applications fairly simple. Other than this Cloud services such as AWS and GCP can also be used by using their subscription models.</p><p>Tools used are <a href="https://kubernetes.io/">Kubernetes</a>, <a href="https://aws.amazon.com/">AWS</a>, <a href="https://cloud.google.com/">Google Cloud</a></p><h4>Monitor and Operate</h4><p>When the application is deployed, it is important to continuously monitor the traffic, user interactions, behavior, and other insights to gain a broad sense of the product and continuously improve it with updates for a better user experience. We can use many tools for resource monitoring(CPU load, RAM consumption, disk space)</p><p>Tools for monitoring are <a href="https://grafana.com/">Grafana(Prometheus, Loki, Tempo)</a>, <a href="https://www.elastic.co/what-is/elk-stack">ELK (Elastic, Logstash, Kibana)</a>, <a href="https://www.splunk.com/">Splunk</a></p><h4>Continuous Integration, Continous Delivery, and Continous Deployment</h4><p>In DevOps, it is important to automate the majority of the processes which helps in easier and faster deployments from start to finish. Some common terms used during the pipeline phases are Continuous Integration, Continous Delivery, and Continous Deployment. Let’s understand what they relate to.</p><ul><li>In Continuous Integration, We Perform automated testing after routinely integrating a developer’s code into the centralized codebase to make sure no regressions have been introduced. These help to reduce problems in size and make them simpler to handle by merging smaller changes more frequently, which boosts productivity across the teams.</li><li>Continuous Delivery automates the procedure for deploying the latest build into use. Every new build should undergo automated testing. It controls automatic provisioning and configuration of deployment environments and, and release of the new versions to production.</li><li>In Continous Deployment, Every build that successfully passes the pipeline’s checks and balances is automatically deployed to the production environment without the manual need of approving the new releases.</li></ul><blockquote><strong><em>Thanks for reading!</em></strong><em><br>Hope you enjoyed this post, follow on </em><a href="https://www.linkedin.com/in/yg18/"><em>LinkedIn</em></a><em> and </em><a href="https://medium.com/@yashguptaa"><em>Medium</em></a><em> for more content. If you have any feedback or suggestions, leave it in the comments below and I’ll do my best to get back to you.</em></blockquote><p>Do check out my other blogs:</p><ul><li><a href="https://blog.devops.dev/importance-of-logging-in-kubernetes-and-intro-to-grafana-loki-f8dc6f736e6">Importance of Logging In Kubernetes, Intro to Grafana Loki &amp; deploying with helm-charts</a></li><li><a href="https://blog.devops.dev/part-1-setup-prometheus-kube-state-metrics-and-integrate-grafana-with-kubernetes-6c21f60d167f">Part-1: Setup Prometheus, Kube State metrics and Integrate Grafana with Kubernetes</a></li><li><a href="https://yashguptaa.medium.com/introduction-to-kubernetes-monitoring-and-exploring-prometheus-9bd0358ce504">Introduction to Kubernetes Monitoring And exploring Prometheus</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da7a476ea02" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/stages-in-devops-and-tools-used-in-different-stages-of-an-application-da7a476ea02">Stages in DevOps and Tools used in Different Stages of an Application</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Importance of Logging In Kubernetes, Intro to Grafana Loki & deploying with helm-charts]]></title>
            <link>https://blog.devops.dev/importance-of-logging-in-kubernetes-and-intro-to-grafana-loki-f8dc6f736e6?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8dc6f736e6</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Sat, 02 Jul 2022 09:33:07 GMT</pubDate>
            <atom:updated>2022-07-16T14:37:11.666Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*QuVwJ6ji6oWXORkrtIikkQ.png" /><figcaption>Logging in Kubernetes and Grafana Loki</figcaption></figure><p>You can learn more about what is going on inside your application by using application logs. The logs are very helpful for tracking cluster activity and troubleshooting issues. Most modern apps include some sort of logging functionality, and most container engines are built to handle that functionality as well. The standard output and standard error streams are the simplest and most often used logging methods for containerized applications.</p><p>However, a robust logging solution typically requires more than the native capability offered by a container engine or runtime. You’ll typically still want to view your application’s logs, for instance, if a container collapses, a pod is removed, or a node dies. As a result, logs ought to have their own storage and lifespan that is separate from nodes, pods, and containers. The phrase “cluster-level-logging” refers to this idea. A separate backend is necessary for cluster-level logging in order to store, process, and query logs. Although Kubernetes does not come with a built-in logging solution, you can incorporate a variety of third-party logging solutions into your Kubernetes cluster.</p><p>Cluster-level logging architectures are described in the assumption that a logging backend is present inside or outside of your cluster. If you’re not interested in having cluster-level logging, you might still find the description of how logs are stored and handled on the node to be useful.</p><h4>What Logs can you have in Kubernetes?</h4><ol><li><strong>Application Logs</strong></li></ol><p>The logs from the Kubernetes-based applications are the first type of logs. These logs include the information that your application output during operation. Usually, the container where the application runs write this data to stdout.</p><p>2. <strong>Kubernetes Cluster Logs</strong></p><p>Kubernetes own components generate their own logs</p><ul><li>Kube-apiserver</li><li>Kube-scheduler</li><li>Etcd</li><li>Kube-proxy</li><li>Kubelet</li></ul><p>These logs are an excellent location to search for information if you’re having a cluster-level issue (as opposed to one that only affects a specific container or pod).</p><p>3.<strong> Kubernetes Events</strong></p><p>Kubernetes records what it refers to as “events,” which can be errors(such as the exhaustion of resources). or modifications to the state of an object(such a container starting or being created) in a cluster.</p><p>4. <strong>Kubernetes Audit Logs</strong></p><p>It is possible to set up Kubernetes to log requests to the Kube-apiserver. These include queries made by users (such as asking for a list of pods that are currently executing) and Kubernetes resources for example- container requests access the storage.</p><p><strong>Cluster Level Architecture</strong></p><p>As Kubernetes does not come with a native solution for cluster-level logging, There are a few widely used methods you can take into consideration.</p><ul><li><a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#using-a-node-logging-agent">Using a node logging agent that runs on every node</a>.</li><li><a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#sidecar-container-with-logging-agent">Using a sidecar container with the logging agent</a></li><li><a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#exposing-logs-directly-from-the-application">Push logs directly to a backend from within an application</a>.</li></ul><h4><strong>Intro To Loki</strong></h4><p><a href="https://grafana.com/oss/loki/">Loki</a> is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by <a href="https://prometheus.io/">Prometheus</a>. It only indexes metadata about your logs i.e labels for each log stream.</p><h4><strong>Promtail</strong></h4><p>It is an agent which ships the contents of local logs to a private Loki instance or Grafana Cloud. It is usually deployed to every machine that has applications needed to be monitored. Its main job is to <strong>discover targets</strong>, <strong>attach labels to log streams</strong> &amp; <strong>Push them to the Loki instance</strong></p><h4>Deploying Loki</h4><p>For deploying Loki, We use the Loki <a href="https://github.com/grafana/helm-charts/tree/main/charts/loki-distributed">helm-chart</a> and add the values according to preference.</p><p>Note: Since it is a string, even the default values from the helm charts have to be repeated here in the values section.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/412c0ef4b081d97821fd1821cce4cd9a/href">https://medium.com/media/412c0ef4b081d97821fd1821cce4cd9a/href</a></iframe><p><strong>Deploying Promtail</strong></p><p>Install promtail using this <a href="https://github.com/grafana/helm-charts/tree/main/charts/promtail">helm-chart</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ab1de7c3475769bdb8211342e0b43a3/href">https://medium.com/media/5ab1de7c3475769bdb8211342e0b43a3/href</a></iframe><p>Now the Promtail pods will be running on all nodes. The logs will be collected by Promtail. We can view them in Grafana by navigating to <strong>Grafana → Click on “Explore” → Choose data source as “Loki” to view logs collected</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8dc6f736e6" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/importance-of-logging-in-kubernetes-and-intro-to-grafana-loki-f8dc6f736e6">Importance of Logging In Kubernetes, Intro to Grafana Loki &amp; deploying with helm-charts</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Kubernetes Monitoring And exploring Prometheus]]></title>
            <link>https://blog.devops.dev/introduction-to-kubernetes-monitoring-and-exploring-prometheus-9bd0358ce504?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bd0358ce504</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 05:32:29 GMT</pubDate>
            <atom:updated>2022-07-19T11:44:21.529Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*6sDaMnyMQInDkE00xI1TDQ.png" /></figure><p>Application performance monitoring is featured in many of the operational operations and complications that Kubernetes brings. Designing solutions has always included extensive monitoring. It is a procedure that continuously gathers data about a system in order to analyze it. The majority of the time, monitoring is done actively by pinging or probing a system with a tool to see what replies it receives. These replies are subsequently examined to learn more about the system’s operation.</p><p><strong>What can you actually monitor in Kubernetes?</strong></p><p>Each of the various layers and components that make up a Kubernetes cluster will have different failure points that we need to keep an eye on.</p><ol><li><strong>Kubernetes cluster and node monitoring</strong></li></ol><p>You can receive a comprehensive picture of the whole cluster&#39;s health and capacity by keeping an eye on the cluster.</p><ul><li><strong>Use of cluster resources</strong>-Identify any unused cluster infrastructure. Maybe we’re at capacity?</li><li><strong>Node availability and health-</strong>Are there enough nodes accessible to replicate our applications? How healthy are the nodes? Will our supply of resources run out?</li></ul><p>2.<strong> Monitoring Kubernetes deployments and pods</strong></p><p>By examining Kubernetes components such as namespaces, Deployments, Replica Sets, or Daemon Sets, we may determine whether our applications have been correctly deployed and are now operating in accordance with configurations.</p><ul><li><strong>Missing and failed pods</strong>: Check if all pods are running for all applications or if any pod stopped working</li><li><strong>Running Vs Required Resources</strong>: How many of each service’s instances are active and available for use? And based on the infrastructure, how many do you anticipate having?</li><li><strong>Use of pod resources in comparison to requests and limits</strong> — Check if CPU and memory requests and limits are set? What is the actual usage against those?</li></ul><p>3.<strong> Monitoring Kubernetes-based application deployments</strong></p><p>Apart from this infrastructure, we ultimately want our applications to be operational because our end users will consume them, and their performance and stability are crucial.</p><ul><li><strong>Applications are accessible-</strong> Application is available and responding as desired.</li><li><strong>Application performance and health-</strong> What are the number of requests it currently supports and how many can it handle in total? What is the latency or responsiveness?</li></ul><p><strong>4. Monitor Kubernetes Metrics</strong></p><p>Component metrics for the Kubernetes System can provide a clearer picture of what is going on within them. Building dashboards and alerts are where metrics come in very handy.</p><p>We have 2 metric types: system metrics and service metrics.</p><ul><li>System metrics are universal metrics that can be obtained from any entity being monitored (e.g. usage of CPU and memory by container and node)</li><li>Application code clearly defines and exports service metrics (e.g. number of 500s served by the API server).</li></ul><p>Both these metrics can come from containers or system infrastructure components. Metrics can both be used to measure the performance of the system and the services they provide.</p><p>The HTTP server’s /metrics endpoint typically has metrics available. Components that by default don’t expose this can have them by using the <a href="https://kubernetes.io/docs/concepts/cluster-administration/system-metrics/#:~:text=In%20most%20cases%20metrics%20are,using%20%2D%2Dbind%2Daddress%20flag.">--bind-address</a> flag.</p><h4><strong>Prometheus-Monitoring Tool for Kubernetes</strong></h4><p>It is a time-series database. Prometheus may be used to monitor servers, databases, standalone virtual machines, and pretty much anything else. Prometheus will scrap systems at regular intervals to monitor them.</p><p><strong>What does target scraping mean?</strong></p><p>By making HTTP requests to specific endpoints that are listed in Prometheus’ settings, Prometheus anticipates being able to retrieve metrics.</p><p><strong>Features</strong></p><ul><li><a href="https://prometheus.io/docs/prometheus/latest/querying/basics/">PromQl</a>, query language used for Prometheus.</li><li>Stores data in <a href="https://prometheus.io/docs/concepts/data_model/">time-series</a> format.</li><li>Collection of metrics via <a href="https://prometheus.io/docs/introduction/faq/#why-do-you-pull-rather-than-push">pull-model</a></li></ul><p><strong>Components</strong></p><ul><li>The primary Prometheus <a href="https://github.com/prometheus/prometheus">server</a> that collects and saves time series data.</li><li><a href="https://prometheus.io/docs/instrumenting/clientlibs/">Client libraries</a> for instrumenting application code;</li><li>P<a href="https://github.com/prometheus/pushgateway">ush gateway</a> for jobs that may not exist long enough to be scrapped.</li><li>E<a href="https://prometheus.io/docs/instrumenting/exporters/">xporters</a> for third-party systems metrics like HAProxy, StatsD, Graphite, etc.</li><li>Using an <a href="https://github.com/prometheus/alertmanager">alert manager</a> to manage notifications</li></ul><p><strong>How does Prometheus works?</strong></p><ul><li>Data Retrieval Worker: Obtaining or retrieving metrics from applications, services, servers, and other target resources in order to push or store them in the local TSDB.</li><li><a href="https://prometheus.io/docs/prometheus/latest/storage/"><strong>Storage (Time Series Database)</strong> </a>— Stores the time series data on local disc.</li><li><strong>HTTP Server-</strong> Accepts <a href="https://prometheus.io/docs/prometheus/latest/querying/basics/">PromQL queries</a> for that data. Server API is used to display that data in Dashboard/UI through Prometheus Dashboard or some data visualization tools like Grafana.</li></ul><p><strong>Ways to Extract metrics from systems</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*jUjN9Y0OR3eNBmjro92i2g.png" /><figcaption>Workflow in Prometheus</figcaption></figure><p><a href="https://prometheus.io/docs/instrumenting/clientlibs/"><strong>Instrumenting</strong></a></p><p>By ‘instrumenting‘ your application, the application exposes Prometheus-compatible metrics on a URL. Prometheus will define it as a target and scrap it at regular intervals. Instrumentation in Prometheus terms means adding client libraries to your application in order for them to expose metrics to Prometheus. While instrumenting, you will essentially create <a href="https://prometheus.io/docs/concepts/metric_types/#metric-types">memory objects</a> (like gauges or counters) that you will increment or decrement on the fly.</p><p><a href="https://prometheus.io/docs/instrumenting/exporters/"><strong>Exporters</strong></a></p><p>By using the <strong>prebuilt exporters</strong>: Prometheus includes a vast array of exporters for technologies that are already in use. Systems that don’t export metrics in Prometheus format are connected by those Exporters to Prometheus.</p><p><a href="https://github.com/prometheus/pushgateway"><strong>Push</strong></a><strong> </strong><a href="https://github.com/prometheus/pushgateway"><strong>Gateways</strong></a></p><p>By utilizing the Pushgateway: Some applications or jobs do not immediately expose metrics. Alternatively, you might have decided not to explicitly publish such metrics through your app. In that case, These jobs can instead push their metrics to a Pushgateway because they might not last long enough to be scrapped. These metrics are then made available to Prometheus by the Pushgateway.</p><p>We can deploy Prometheus using <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack">helm-chart</a> or you can follow my post on how to set it up —<a href="https://blog.devops.dev/part-1-setup-prometheus-kube-state-metrics-and-integrate-grafana-with-kubernetes-6c21f60d167f"> Setup Prometheus, Kube State metrics and Integrate Grafana with Kubernetes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bd0358ce504" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/introduction-to-kubernetes-monitoring-and-exploring-prometheus-9bd0358ce504">Introduction to Kubernetes Monitoring And exploring Prometheus</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part-2: Setup Prometheus, Kube State metrics and Integrate Grafana with Kubernetes]]></title>
            <link>https://blog.devops.dev/part-2-setup-prometheus-kube-state-metrics-and-integrate-grafana-with-kubernetes-4a91bf5bee29?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a91bf5bee29</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Fri, 17 Jun 2022 12:33:02 GMT</pubDate>
            <atom:updated>2022-06-23T18:45:18.675Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RNOzyS81VeMylxw_IyW0dQ.png" /></figure><p>In the previous blog, we set up Prometheus in our local Kubernetes cluster along with ConfigMap which included the Prometheus configurations. We were able to access the Prometheus dashboard on the localhost</p><h4>Overview</h4><p>In this blog, we continue from where we left off.</p><ul><li>A brief look at what is Kube State Metrics</li><li>Setting up Kube State Metrics in our cluster to monitor all the API objects</li><li>Integrate Grafana on Kubernetes with Prometheus</li></ul><h4>Prerequisites</h4><ul><li>Kubernetes Cluster setup</li><li>Followed all the steps in Part 1- Refer to <a href="https://yashguptaa.medium.com/part-1-setup-prometheus-kube-state-metrics-and-integrate-grafana-with-kubernetes-6c21f60d167f">this</a></li></ul><h4>Kube State Metrics</h4><p>Kube State Metrics is a service that communicates with the Kubernetes API server to obtain information about all API objects such as deployments, pods, and DaemonSets. It essentially gives Kubernetes API object metrics that aren’t available via native Kubernetes monitoring components.</p><p>Few key objects you can monitor with Kube State Metrics:</p><ul><li>Monitor node status, node capacity (CPU and memory)</li><li>Monitor replica-set compliance (desired/available/unavailable/updated status of replicas per deployment)</li><li>Monitor pod status (waiting, running, ready, etc)</li><li>Monitor the resource requests and limits.</li></ul><h4>Setting Up Kube State Metrics</h4><p><strong>Step 1: </strong>Firstly, We create a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/">Service Account</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab3bd2c9486ba52016f98a9f4e746400/href">https://medium.com/media/ab3bd2c9486ba52016f98a9f4e746400/href</a></iframe><p>Apply the changes by running the following command:</p><pre>kubectl apply -f service-account.yaml</pre><p><strong>Step 2: </strong>Next, We Create <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole">Cluster Role</a> for Kube-State-Metrics to access all the Kubernetes API objects.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/faa5be4d60cb5d552a55f8aea5cb5954/href">https://medium.com/media/faa5be4d60cb5d552a55f8aea5cb5954/href</a></iframe><p>Apply the changes by running the following command:</p><pre>kubectl apply -f cluster-role.yaml</pre><p><strong>Step 3: </strong>To bind the Cluster Role with the Service Account, We will use <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding">Cluster Role Binding</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83172416b1148bc6a6762e8156e0271e/href">https://medium.com/media/83172416b1148bc6a6762e8156e0271e/href</a></iframe><p>Apply the changes by running the following command:</p><pre>kubectl apply -f cluster-role-binding.yaml</pre><p><strong>Step 4: </strong>Now, We create a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Deployment</a> using the Kube-State-Metrics docker image</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59e55c7830fe18f0d2215f96d590e99b/href">https://medium.com/media/59e55c7830fe18f0d2215f96d590e99b/href</a></iframe><p>Apply the changes by running the following command:</p><pre>kubectl apply -f deployment.yaml</pre><p>To view the metrics locally we can use port-forwarding. For that, we get the name of the deployment pod with kubectl get pods -n kube-system the command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7MT0X6UMna5ZHO9B3esog.png" /></figure><p>Then use the pod name for port forwarding</p><pre>kubectl port-forward &lt;pod-name&gt; 8080:8080 -n monitoring</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rANcIlerYaEbqbQWqYkJ6w.png" /></figure><p>If we go to localhost:8080, we see something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*ITbGck66-UjXIrqMGQk4gQ.png" /><figcaption>Kube-state-metrics on localhost</figcaption></figure><h4>Setup Grafana on Kubernetes</h4><p><a href="https://grafana.com/grafana/">Grafana</a> is a free and open-source dashboard application. It may connect to a variety of data sources, including <a href="https://grafana.com/oss/prometheus/">Prometheus</a>, <a href="https://www.elastic.co/what-is/elasticsearch">Elastic Search</a>, <a href="https://aws.amazon.com/cloudwatch/">AWS CloudWatch</a>, <a href="https://cloud.google.com/products/operations">Google Cloud’s operations</a>, and others. Through Prometheus, we can construct dashboards on Grafana for all Kubernetes metrics.</p><p><strong>Step 1:</strong> Create Config Map containing the data source configuration for Prometheus. We can add more data sources for Grafana in this file if necessary</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f47bf36ca732e47238d9ccac2a693680/href">https://medium.com/media/f47bf36ca732e47238d9ccac2a693680/href</a></iframe><p>Apply the changes by running the following command:</p><pre>kubectl apply -f grafana-datasource-config.yaml</pre><p><strong>Step 2: </strong>Now, We Create a Deployment using the Grafana docker image</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7668b69483ddd3fbddfee9ac86fdcc2/href">https://medium.com/media/b7668b69483ddd3fbddfee9ac86fdcc2/href</a></iframe><p>Apply the changes by running the following command:</p><pre>kubectl apply -f grafana-deployment.yaml</pre><p>We can access the Grafana on localhost using port-forwarding</p><p>First, get the name of the pod with kubectl get pods -n monitoring</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zG0TnqTSEseVJrGXJfSKGg.png" /></figure><p>Then use the grafana pod name for port forwarding like below</p><pre>kubectl port-forward &lt;grafana-pod-name&gt; 3000:3000 -n monitoring</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SwXDeAxoyrKbrYDTS667Dw.png" /></figure><p>Now We can access the dashboard on localhpst:3000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ddLkaifRAKedqomOq-O3UA.png" /><figcaption>Grafana login</figcaption></figure><p>The default credentials are listed below:</p><pre>Grafana Credentials<br>User: admin<br>Password: admin</pre><p>We can now access Grafana and use it to import or build dashboards and visualize the metrics data.</p><h4>Conclusion</h4><p>In this part, we learned about Kube-State-Metrics &amp; Grafana, how to deploy them on Kubernetes, and access it on our localhost. I’ll also set up a Grafana Dashboard &amp; view the metrics in the form of visualizations in my next post.</p><p>Connect with me on <a href="https://www.linkedin.com/in/yg18/">LinkedIn</a> | <a href="https://twitter.com/Yash_gupta18">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a91bf5bee29" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/part-2-setup-prometheus-kube-state-metrics-and-integrate-grafana-with-kubernetes-4a91bf5bee29">Part-2: Setup Prometheus, Kube State metrics and Integrate Grafana with Kubernetes</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part-1: Setup Prometheus, Kube State metrics and Integrate Grafana with Kubernetes]]></title>
            <link>https://blog.devops.dev/part-1-setup-prometheus-kube-state-metrics-and-integrate-grafana-with-kubernetes-6c21f60d167f?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c21f60d167f</guid>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Fri, 17 Jun 2022 12:33:01 GMT</pubDate>
            <atom:updated>2022-06-23T18:43:35.486Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J0njktxaeoWFhgLed59pTA.png" /><figcaption>Setup Prometheus, Kube State metrics and Integrate Grafana on Kubernetes</figcaption></figure><p>When a number of servers, services, and applications are running on a Kubernetes cluster and services interact in a distributed Microservice environment, monitoring the pods, containers, and servers is critical to ensure the system’s health and availability of the appropriate cores/instances.</p><p>Prometheus monitoring is one of the most popular monitoring tools for Docker and Kubernetes. This post will show you how to use Prometheus to monitor Kubernetes clusters. You’ll learn how to set up a Prometheus server, metrics exporters, and Kube-State-Metrics, as well as how to pull, scrape, and collect metrics, configure Alertmanager alerts, and Grafana dashboards.</p><h3>Prerequisites</h3><p>Before you begin with this guide, below are the prerequisites:</p><ul><li>A Kubernetes cluster. (You can refer <a href="https://k3d.io/v5.4.2/#quick-start">k3d</a> docs or any other Kubernetes engine)</li><li>A fully configured <a href="https://kubernetes.io/docs/tasks/tools/">kubectl</a> command-line interface on your local machine</li></ul><h4>Create a Namespace</h4><p>We’ll start by building a Kubernetes namespace for all of our monitoring components. A namespace is where Kubernetes starts all of its resources. The system utilizes the default namespace unless one is supplied. We’ll create a monitoring namespace to provide us with more control over the cluster monitoring process.</p><p>For easy reference, we are going to name the namespace: <strong>monitoring</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86428c2996493116448e8df9dfdce60c/href">https://medium.com/media/86428c2996493116448e8df9dfdce60c/href</a></iframe><p>Apply changes by running the below command</p><pre>kubectl create -f monitoring-namespace.yaml</pre><h4>Create Roles &amp; Service Account</h4><p>Next, in the monitoring namespace, we’ll create a role that grants access to all Kubernetes resources and a service account to which the role will be applied. We’ll create a <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole">ClusterRole</a>, since a typical role only allows access to resources inside the same namespace, and Prometheus will need access to nodes and pods across the cluster to obtain all of the metrics we’ll provide.</p><p>The <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/">ServiceAccount</a> is a unique identity for resources and pods that are currently executing. If no ServiceAccount is specified then the default service account is applied, so we’re going to make a default service account for the Monitoring namespace. That means Prometheus will use this service account by default.</p><p>In the end, we’re applying a <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding">ClusterRoleBinding</a> to bind the role to the service account.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ea5d9535f6004ff4dc1edb2fa827e25/href">https://medium.com/media/8ea5d9535f6004ff4dc1edb2fa827e25/href</a></iframe><p>Apply changes by running the below command</p><pre>kubectl create -f clusterRole.yaml</pre><h4>Create a ConfigMap</h4><p>In Kubernetes, a <a href="https://kubernetes.io/docs/concepts/configuration/configmap/">ConfigMap</a> gives configuration data to all pods in a deployment. This Config Map contains 2 data sources</p><ul><li>prometheus.rules</li><li>prometheus</li></ul><p>In the 1st section, we are creating a ConfigMap with the name=”prometheus-server-conf” in monitoring the namespace where the Prometheus Deployment should also be running.</p><p>prometheus.rules will contain all the alert rules for sending alerts to the alert manager.</p><p>Below that in the data section, there’s a very simple prometheus.yml file.</p><p>The prometheus.yaml contains all the configurations to dynamically discover pods and services running in the Kubernetes cluster. We have the following scrape jobs in our Prometheus scrape configuration.</p><ul><li>kubernetes-apiservers: Collects all the metrics from the API servers.</li><li>kubernetes-nodes: Collects all Kubernetes node metrics</li><li>kubernetes-pods: All the pod metrics will be discovered if the pod metadata is annotated with prometheus.io/scrape and prometheus.io/port annotations.</li><li>kubernetes-cadvisor: Collects all <a href="https://prometheus.io/docs/guides/cadvisor/">cAdvisor</a> metrics.</li><li>kubernetes-service-endpoints: All the Service endpoints will be scrapped if the service metadata is annotated with prometheus.io/scrape andprometheus.io/port annotations. It will be a black box monitoring.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af8d7ca91f2a6daf1e971748578c6e41/href">https://medium.com/media/af8d7ca91f2a6daf1e971748578c6e41/href</a></iframe><p>Apply changes by running the below command</p><pre>kubectl create -f config-map.yaml</pre><h4>Create a Prometheus Deployment</h4><p>The Prometheus config map is mounted as a file in /etc/prometheus. We are using the official <a href="https://hub.docker.com/r/prom/prometheus">Prometheus image</a> from the docker hub.</p><p>This file may vary depending on how you configured and deployed Prometheus. The prometheus.yml key containing Prometheus’s configuration is mounted to /etc/prometheus/prometheus.yml.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/696e497153af56aa63a51d758d89b670/href">https://medium.com/media/696e497153af56aa63a51d758d89b670/href</a></iframe><p>Apply changes by running the below command</p><pre>kubectl apply -f prometheus-deployment.yaml</pre><h4>Connection to Prometheus Dashboard</h4><p>There are two ways to access the Prometheus dashboard that has been deployed.</p><ul><li>Using Kubectl Port Forwarding</li><li>Using NodePort/Load Balancer by exposing the Prometheus Deployment</li></ul><p>If you want to go with the port-forward way, use the below command</p><pre>kubectl port-forward &lt;your-prometheus-deployment-podName&gt; 8080:9090 -n monitoring</pre><p>Else use the 2nd option. For this we create prometheus-service.yaml , we have to use the Kubernetes service to access the Prometheus dashboard over an IP or a DNS name.</p><p>We will expose Prometheus on all Kubernetes node IPs on port 30000.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a15fb6d8d80ac946dfe75da335b12d78/href">https://medium.com/media/a15fb6d8d80ac946dfe75da335b12d78/href</a></iframe><p>The above-mentioned service’s annotations ensure that Prometheus ignores the service endpoint.</p><ul><li>prometheus.io/scrape: The default configuration will scrape all pods and, if set to-false, this annotation will exclude the pod from the scraping process.</li><li>prometheus.io/port: Scrape the pod on the indicated port instead of the pod’s declared ports (default is a port-free target if none are declared).</li></ul><blockquote>We also have prometheus.io/path which is used if the metrics path is not /metrics</blockquote><p>Apply changes by running the below command:</p><pre>kubectl create -f prometheus-service.yaml --namespace=monitoring</pre><p>Once the service is up, we can view the dashboard on localhost:9090</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uY8CAAnt5crqP0mUZcx7fQ.png" /><figcaption>Prometheus Dashboard</figcaption></figure><h4>Conclusion</h4><p>In this tutorial, we set up ClusterRole, ServiceAccount, and Setup ConfigMap with Prometheus configurations &amp; mounted them in a Prometheus Deployment. We also set up a Prometheus service to access the dashboard on our localhost.</p><p>In the next part, we will see what is Kube state metrics &amp; how to set them up. We’ll also look at how to integrate Grafana with our Prometheus as a data source.</p><p>Follow the next part here</p><p><a href="https://yashguptaa.medium.com/part-2-setup-prometheus-kube-state-metrics-and-integrate-grafana-with-kubernetes-4a91bf5bee29">Part-2: Setup Prometheus, Kube State metrics and Integrate Grafana with Kubernetes</a></p><p>Connect with me on <a href="https://www.linkedin.com/in/yg18/">LinkedIn</a> | <a href="https://twitter.com/Yash_gupta18">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c21f60d167f" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/part-1-setup-prometheus-kube-state-metrics-and-integrate-grafana-with-kubernetes-6c21f60d167f">Part-1: Setup Prometheus, Kube State metrics and Integrate Grafana with Kubernetes</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Application Deploy to Kubernetes with Argo CD and K3d]]></title>
            <link>https://yashguptaa.medium.com/application-deploy-to-kubernetes-with-argo-cd-and-k3d-8e29cf4f83ee?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e29cf4f83ee</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[argo]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Mon, 06 Jun 2022 12:31:54 GMT</pubDate>
            <atom:updated>2022-06-06T12:33:33.311Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*pghIzR-YfRe7pmXTycGlmw.png" /><figcaption>Deployment Argo CD and Kubernetes</figcaption></figure><h4>Overview</h4><ul><li>Argo CD is a solution that allows us to keep track of the status of apps running on a Kubernetes cluster. This is accomplished by specifying the state as YAML-based configurations within a GitHub repository. It monitors running programs in real-time and compares the actual, live state to the desired target state.</li><li>It supports webhook alerts from GitHub, GitLab, and Bitbucket and can handle a variety of Kubernetes manifests, including Jsonnet, Kustomize applications, Helm charts, and YAML/JSON files.</li><li>In this post, We’ll learn how to utilize Argo CD to synchronize and deploy an application from a GitHub repository</li></ul><h4><strong>Prerequisites</strong></h4><ol><li>Have a k3d (or any Kubernetes engine of your choice) cluster up with at least one worker node up. Look <a href="https://k3d.io/v5.4.2/#quick-start">here</a> for more info</li><li>Knowledge of Kubernetes commands.</li><li>Have argo installed locally using brew install argocd .</li></ol><p><strong>STEP 1 — Basic Kubernetes Setup</strong></p><p>Validate if you have a cluster up with kubectl get nodes. This should return nodes with Ready status.</p><pre>kubectl get nodes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6YQxQSUetb-iwlJp9sYrw.png" /></figure><p><strong>STEP 2 — Setup Argo CD namespace &amp; installation of scripts</strong></p><p>Create argocd namespace in the cluster &amp; run the Argo CD script</p><pre>kubectl create namespace argocd</pre><p>Now, run Argo CD install script</p><pre>kubectl apply -n argocd -f <a href="https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml">https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</a></pre><p>See if all Kubernetes pods are up with</p><pre>kubectl get pods -n argocd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kPncC3xQ88JRfJsir3rfQQ.png" /><figcaption>Argo CD pods</figcaption></figure><p><strong>STEP 3 — Accessing Argo CD UI</strong></p><p>Argo UI by default will run on port 80. To access it on port 8090 or any other alternative port on the local machine, run the following command</p><pre>kubectl port-forward -n argocd svc/argocd-server 8080:443</pre><p>Open localhost:8080 on the web browser to view Argo CD UI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M27OxCLaOcSQqjZ6b0JTwQ.png" /><figcaption>Argo CD log in screen</figcaption></figure><p>The username here will beadmin . To get the password run the following command,</p><pre>kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath=”{.data.password}” | base64 -d; echo</pre><p>Also, log in to Argo CD via command line to deploy through the command line with the command</p><pre>argocd login</pre><p><strong>STEP 4 — Deploying Example application to Argo CD</strong></p><p>Now we will deploy an <a href="https://github.com/argoproj/argocd-example-apps">example application</a> that is maintained by Argo CD to test the functionality.</p><p>To create an app we run the following command specifying the example repo and passing the default destination and namespace.</p><pre>argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default</pre><p>we can check the status of the guestbook application</p><pre>argocd app get helm-guestbook</pre><p>It will show that the status is OutOfSync which is normal. It means the application has not yet been deployed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qi1GC5Y71CfzIV5YX2A3jw.png" /></figure><p>To sync(deploy) the application, we run</p><pre>argocd app sync guestbook</pre><p>Now if go to our Argo CD UI, we see helm-guestbook as one of our applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYMDLT07S_QpRLWqyFnmzw.png" /><figcaption>guestbook app deployed on Argo CD</figcaption></figure><p>To view the guestbook application running you do the following</p><p>Get pod name by running</p><pre>kubectl get pods</pre><p>Then use the output to port-forward the pod.</p><pre>kubectl port-forward helm-guestbook-d9cdf5d87-2gd9n 9090:80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*hn9D1MtYbp0zlkHfopKklw.png" /><figcaption>Port-forward guestbook application pod</figcaption></figure><p>You can now access the guestbook application at localhost:9090</p><h4>What if you have multiple apps?</h4><p>If you have multiple apps you can use the idea of “<a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/#app-of-apps-pattern">app of apps</a>” to enable controlling apps at a higher level. Argo CD can sync each application into Kubernetes repeatedly by going through a hierarchy of directories containing independent apps. We need to configure the <a href="https://github.com/argoproj/argo-helm/blob/main/charts/argo-cd/values.yaml">Argo CD helm chart</a> file where we can set recurse: true to recurse directory.</p><p><strong>Conclusion</strong></p><p>In this blog, we saw the basic setup, installation &amp; deployment of Argo CD on Kubernetes using k3d. Hope this will help you in understanding Argo CD. For more in-depth, you can refer to the <a href="https://argo-cd.readthedocs.io/en/release-1.8/">official documentation</a>.</p><p>Connect with me on <a href="https://www.linkedin.com/in/yg18/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e29cf4f83ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps- Get Started with Shell Scripting]]></title>
            <link>https://yashguptaa.medium.com/devops-get-started-with-shell-scripting-c895e48a4865?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/c895e48a4865</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Mon, 23 May 2022 10:39:21 GMT</pubDate>
            <atom:updated>2022-05-23T10:46:53.139Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*1_I76txkWDs9i_HDezsC8g.png" /><figcaption>Scripting</figcaption></figure><p>In your day-to-day work as a DevOps engineer, you’ll come across various scenarios where we need to automate stuff to save us time and be more productive. Scripts will be used in the CI/CD workflow in one form or another. The following are some of the most commonly used scripting languages.</p><ul><li>Bash/Shell</li><li>Golang</li><li>Python</li></ul><p>In this tutorial, we will learn about Shell scripting specifically.</p><h3>Prerequisites</h3><ul><li>Comfortable with Linux commands</li></ul><p>Let’s get started</p><h3>1. Initial Script</h3><ol><li>Create a directory inside which we’ll create a script file</li></ol><pre>mkdir scripts<br>cd scripts<br>touch script.sh</pre><h4><em>What is #!/bin/bash?</em></h4><p>This is known as She-bang. It’s the most popular shell used for user login on a Linux system is /bin/bash. This line is always written on top of shell script.</p><h4>What is echo?</h4><p>echo is the print statement for the bash. Whatever is written after echo will be printed when we run the script. Ex: echo &quot;Hello world&quot;```</p><p>Let’s Open the script.sh file &amp; write the first script. This is what your 1st script will look like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*-P20xu9plDzXKIQb3N_2AQ.png" /><figcaption>script.sh</figcaption></figure><p>This will simply print the statement “My first shell script” when we run it. To run the script we run the following command:</p><pre>bash script.sh</pre><h3>2. Variables</h3><p>To use variables we simply use define the variable followed by the value</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/141/1*EvEVIJw5WjRpH87F-m1NJQ.png" /><figcaption>script.sh</figcaption></figure><h3>3. User Input</h3><p>To get input from the user we use the “read” command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/206/1*147UPCT-qFUdCEQWAus-oQ.png" /><figcaption>script.sh</figcaption></figure><p>On running, the user will need to enter the age. On entering, we get the output as specified in the echo statement.</p><h3>4. Arguments</h3><p>We can specify arguments when running a bash file.</p><pre>bash script.sh args1</pre><p>args1 is an argument that can be accessed inside the script using $1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*hGUKPNGnsfQ9mxlIIZtQ-Q.png" /><figcaption>script.sh</figcaption></figure><h3>5. If-Else</h3><p>It works the same way as in other languages. You specify the condition. If it satisfies it goes inside the initial block otherwise inside the else block. Here we are checking if the argument is “hello” and on that basis decide the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*8pANu64fKs1do6b4fbbn5w.png" /><figcaption>script.sh</figcaption></figure><pre>bash script.sh hello</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c895e48a4865" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Environment variables in helm chart with config maps]]></title>
            <link>https://yashguptaa.medium.com/using-environment-variables-in-helm-chart-with-config-maps-ee05cbd99171?source=rss-8b323afffe56------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee05cbd99171</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[helm-chart]]></category>
            <dc:creator><![CDATA[Yash Gupta]]></dc:creator>
            <pubDate>Thu, 24 Mar 2022 18:40:44 GMT</pubDate>
            <atom:updated>2022-03-24T18:40:44.647Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*F8UptqomV_GgLwod.png" /></figure><h3>Overview</h3><p>In the last post we discussed how to pass environment variables to a docker image from Kubernetes pod manifest. So continuing where we left off, In this post we will be using environment variables with Config maps in helm charts. We will create a Helm Chart &amp; see how we can use environment variable with config map &amp; use them in our docker image.</p><p>For full code refer this <a href="https://github.com/yashgupta18/helm_chart">repository</a></p><h3>Prerequisites</h3><ul><li>Basic knowledge of <a href="https://kubernetes.io/">Kubernetes</a>, <a href="https://docs.docker.com/">Docker</a>, <a href="https://nodejs.org/en/docs/">NodeJS</a>.</li></ul><h3>Steps</h3><ol><li><strong>Create a folder named helmchart. Directory structure will look like this:</strong></li></ol><pre>helmchart<br>|--templates<br>|-- |--config.yaml<br>|-- |--pod.yaml<br>|--Chart.yaml<br>|--values.yaml</pre><p><strong>2. Create helmchart/Chart.yaml</strong></p><p>This file provides the metadata about the chart to your definitions such as name, description, version.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc2f61524979ce27cb39793c993906b5/href">https://medium.com/media/cc2f61524979ce27cb39793c993906b5/href</a></iframe><p><strong>3. Create helmchart/values.yaml</strong></p><p>This file contains the configuration value- message in this case. These values can then be used in templates file by using syntax {{ .Values.message }}</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b0f1e0f89e58d3a461d73409f1f1a78/href">https://medium.com/media/1b0f1e0f89e58d3a461d73409f1f1a78/href</a></iframe><p><strong>4.</strong> <strong>Create helmchart/templates/config.yaml</strong></p><p>Here we create a <strong>ConfigMap</strong> where we use the value of message from values.yaml</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3bfd5b4a4475c7ccf81ab4ccd9000382/href">https://medium.com/media/3bfd5b4a4475c7ccf81ab4ccd9000382/href</a></iframe><p><strong>5. Create helmchart/templates/pod.yaml</strong></p><p>This file contains the pod configuration. We are using the image <a href="https://hub.docker.com/repository/docker/yg18/website"><strong>yg18/website</strong></a> for our container. We are passing environment variable which is using the value from config.yaml which specifies the message value as environment variable.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7492b13876e9b1e45e99e5ca0b182a08/href">https://medium.com/media/7492b13876e9b1e45e99e5ca0b182a08/href</a></iframe><p><strong>6. Run the following commands to install helm chart &amp; deploy the chart to minikube:</strong></p><ul><li>Start minikube &amp; Install the helm application</li></ul><pre>minikube start<br>kubectl config use-context minikube</pre><pre>helm install &lt;app-name&gt; &lt;chart-name&gt;<br>helm install mypod helmchart/</pre><ul><li>View the chart and pod created in minikube</li></ul><pre>kubectl get pods<br>helm ls</pre><ul><li>Port forward the pod to view the application in localhost:3001</li></ul><pre>kubectl port-forward &lt;podName&gt; 3001:3000</pre><pre>kubectl port-forward helm-practice-1 3001:3000</pre><ul><li>Now we see the message we set in values.yaml in our running application. Now let’s change the message value in values.yaml &amp; redeploy the pod.</li></ul><pre>helm upgrade mypod .</pre><pre>kubectl delete pod helm-practice-1</pre><p>We deleted the pod because image was using the earlier value of message. Restarting the pod will get the latest value from the ConfigMap &amp; rerun the pod with latest value</p><h3>Conclusion</h3><p>In this post you learned about how to create Helm Charts &amp; use environment variables in ConfigMap &amp; pass the values over to Pod manifest to be used by the docker image.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee05cbd99171" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>