<?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 Arun Kumar Peddapalli on Medium]]></title>
        <description><![CDATA[Stories by Arun Kumar Peddapalli on Medium]]></description>
        <link>https://medium.com/@arunfnc?source=rss-51b92d962f91------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZPHEqZnX5zx3PFF1MBgPzg.jpeg</url>
            <title>Stories by Arun Kumar Peddapalli on Medium</title>
            <link>https://medium.com/@arunfnc?source=rss-51b92d962f91------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 00:30:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arunfnc/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[Understanding shareProcessNamespace in Kubernetes]]></title>
            <link>https://medium.com/fournine-cloud/understanding-shareprocessnamespace-in-kubernetes-77f3d651a5d8?source=rss-51b92d962f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/77f3d651a5d8</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Arun Kumar Peddapalli]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 09:49:07 GMT</pubDate>
            <atom:updated>2025-02-24T09:49:07.085Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes allows you to run and manage multiple containers inside a pod. Normally, each container in a pod runs in its own process namespace, meaning one container <strong>cannot see or interact</strong> with the processes running inside another container.</p><p>However, Kubernetes provides an option called <strong>shareProcessNamespace</strong>, which allows containers in the same pod to share the same process namespace. This means they can see and interact with each other’s processes, making certain use cases much easier to handle.</p><p>In this blog, we’ll break down:</p><ul><li>What shareProcessNamespace does</li><li>When to use it</li><li>Understanding shareProcessNamespace with a real world example</li><li>How to enable it in Kubernetes</li></ul><h3>What is shareProcessNamespace?</h3><p>By default, containers in a Kubernetes pod are isolated from each other at the process level. Each container has its own <strong>process namespace</strong>, which means:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*Ksy92dx7XuXmJOGeSp6Bgw.png" /><figcaption>shareProcessNamespace</figcaption></figure><ul><li>One container <strong>cannot see</strong> the processes running inside another container.</li><li>They have separate process trees.</li><li>They cannot send signals (e.g., kill, debug, strace) to each other’s processes.</li></ul><p>When <strong>shareProcessNamespace: true</strong> is enabled, all containers in the pod <strong>share the same process namespace</strong>. This allows:<br>✅ One container to see the processes running in another container.<br>✅ Debugging or monitoring processes across containers.<br>✅ Sending signals (e.g., kill, strace, gdb) from one container to another.</p><h3>Let’s Understand with a Real-World Example</h3><p>Imagine a company with multiple employees. There are two ways the office can be set up:</p><h4>🔒 Private Offices (Default Kubernetes Behavior)</h4><p>Each employee (container) works in a separate <strong>private office</strong> (process namespace). They:</p><ul><li>Cannot see what others are doing inside their office.</li><li>Cannot talk to others directly unless they open the door (inter-container communication).</li><li>Work in complete isolation.</li></ul><h4>🚪 Open Workspace (shareProcessNamespace: true)</h4><p>Now, imagine an <strong>open workspace</strong> where all employees share the same room:</p><ul><li>Everyone can see what others are working on (shared process namespace).</li><li>They can directly interact and help each other.</li><li>If someone needs to supervise all work (like a monitoring agent), they can do it easily.</li></ul><p>In Kubernetes, shareProcessNamespace: true is like having an open workspace—it allows better coordination between containers inside the same pod.</p><h3>When to Use shareProcessNamespace?</h3><p>You should consider enabling shareProcessNamespace when:</p><p>✅ <strong>Debugging Multi-Container Pods:</strong></p><ul><li>A sidecar container can inspect and debug another container’s processes.</li></ul><p>✅ <strong>Process Management:</strong></p><ul><li>One container can manage or restart another container’s processes.</li><li>Useful for applications where one container acts as a supervisor for others.</li></ul><p>✅ <strong>Security &amp; Monitoring Tools:</strong></p><ul><li>Tools like strace, gdb, or top in one container can observe processes in another container.</li></ul><h3>How to Enable shareProcessNamespace?</h3><p>To enable shareProcessNamespace, update your pod specification like this:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: shared-process-pod<br>spec:<br>  shareProcessNamespace: true  # Enable process namespace sharing<br>  containers:<br>  - name: main-container<br>    image: ubuntu<br>    command: [&quot;sleep&quot;, &quot;3600&quot;]<br>  - name: sidecar-container<br>    image: busybox<br>    command: [&quot;top&quot;]</pre><h3>What Happens Here?</h3><ul><li>The <strong>main-container</strong> runs an Ubuntu image with a sleep command.</li><li>The <strong>sidecar-container</strong> runs BusyBox with top to monitor processes.</li><li>Since shareProcessNamespace: true is enabled, the sidecar container can see and manage the processes running inside the main container.</li></ul><h3>Verifying That It Works</h3><p>After deploying the pod, you can check the process list from inside one container:</p><pre>kubectl exec -it shared-process-pod -c sidecar-container -- ps aux</pre><h3>Summary</h3><ul><li><strong>shareProcessNamespace allows containers in the same pod to share the same process namespace.</strong></li><li><strong>It is useful for debugging, process management, and monitoring.</strong></li><li><strong>Containers can see and interact with each other’s processes, just like working in a shared space.</strong></li><li><strong>Be mindful of security risks when enabling it.</strong></li></ul><p><strong>Why did the two containers enable </strong><strong>shareProcessNamespace?</strong><br>Because one said, <strong>&quot;I feel so isolated!&quot;</strong> and the other replied, <strong>&quot;Let&#39;s share our processes and make debugging easier!&quot;</strong> 😆</p><p>🚀 Stay ahead in the world of Kubernetes and cloud technologies!</p><p>🔹 Follow us on <strong>Medium</strong> for insightful articles, best practices, and deep dives into K8s, DevOps, and more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77f3d651a5d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fournine-cloud/understanding-shareprocessnamespace-in-kubernetes-77f3d651a5d8">Understanding shareProcessNamespace in Kubernetes</a> was originally published in <a href="https://medium.com/fournine-cloud">Fournine Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Cardinality in Prometheus Monitoring]]></title>
            <link>https://medium.com/fournine-cloud/understanding-cardinality-in-prometheus-monitoring-96ad082b6398?source=rss-51b92d962f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/96ad082b6398</guid>
            <category><![CDATA[improvement]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[prometheus]]></category>
            <dc:creator><![CDATA[Arun Kumar Peddapalli]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 04:36:01 GMT</pubDate>
            <atom:updated>2023-07-24T04:36:01.214Z</atom:updated>
            <content:encoded><![CDATA[<p>Prometheus is a powerful open-source monitoring system used to collect, store, and query time-series data. It is widely used in modern DevOps practices and is known for its simple and efficient data model. In this blog, we will explore one of the most important concepts in Prometheus: cardinality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVeoJxL6TJQH3sj93sS5aw.png" /><figcaption>Post Image</figcaption></figure><h3>What is Cardinality?</h3><p>In Prometheus, cardinality refers to the number of unique time series that are stored in the database. Each time series is identified by a set of labels, and the cardinality is the number of distinct label sets that are present in the data. High cardinality means that there are many distinct label sets, while low cardinality means that there are fewer distinct label sets.</p><p>Imagine that you have a Prometheus instance that is monitoring numerous servers, each with multiple services running on them. Let’s say that you have a metric called <strong><em>http_requests_total</em></strong> that tracks the number of HTTP requests received by each service. You decide to include labels for the server and service name in this metric, so that you can distinguish between requests made to different services on different servers.</p><p>Here is an example of what the metric might look like:</p><pre>http_requests_total{server=”server1&quot;, service=”api”} 100<br>http_requests_total{server=”server1&quot;, service=”frontend”} 500<br>http_requests_total{server=”server2&quot;, service=”api”} 200<br>http_requests_total{server=”server2&quot;, service=”frontend”} 300</pre><p>In this example, there are four distinct time series, each identified by a unique combination of labels. The cardinality of this metric is four, because there are four distinct label sets present in the data.</p><p>Now imagine that you decide to add a label for the HTTP method used for each request, so that you can track the number of GET and POST requests separately. Here is an example of what the metric might look like now:</p><pre>http_requests_total{server=”server1&quot;, service=”api”, method=”GET”} 50 http_requests_total{server=”server1&quot;, service=”api”, method=”POST”} 50<br>http_requests_total{server=”server1&quot;, service=”frontend”, method=”GET”} 200<br>http_requests_total{server=”server1&quot;, service=”frontend”, method=”POST”} 300<br>http_requests_total{server=”server2&quot;, service=”api”, method=”GET”} 100<br>http_requests_total{server=”server2&quot;, service=”api”, method=”POST”} 100<br>http_requests_total{server=”server2&quot;, service=”frontend”, method=”GET”} 150<br>http_requests_total{server=”server2&quot;, service=”frontend”, method=”POST”} 150</pre><p>In this example, there are now eight distinct time series, each identified by a unique combination of labels. The cardinality of this metric has increased to eight, because there are eight distinct label sets present in the data.</p><p>As you can see, adding additional labels to metrics can quickly increase the cardinality of your data set. This can impact the performance and resource utilization of your Prometheus deployment, so it’s important to carefully consider which labels are necessary for analysis, and to regularly monitor and optimize the system to ensure that it continues to perform well as the data set grows.</p><h3>Why is Cardinality important?</h3><p>Cardinality is an important consideration when designing and scaling a Prometheus deployment. High cardinality can result in increased memory usage and longer query latencies, while low cardinality can result in less flexible queries and less granularity in the data.</p><p>For example, imagine that you have a Prometheus instance that is monitoring numerous servers, each with multiple services running on them. If you create a unique time series for each combination of server and service, you could quickly end up with a very high cardinality. This could result in slow query performance and increased resource usage.</p><h4>The Impact of High Cardinality</h4><p><strong>A. Increased Resource Utilization</strong></p><p>When you have high cardinality metrics in Prometheus, it can significantly increase the amount of storage space required to store the time-series data. Each unique combination of labels creates a new time-series, which means that high cardinality can quickly result in numerous time-series. This can increase the amount of memory and storage required by Prometheus, leading to higher resource utilization and increased costs.</p><p><strong>B. Slower Query Times</strong></p><p>High cardinality can also impact query times in Prometheus. When querying metrics, Prometheus needs to search through all the time-series data to find the relevant data points. With high cardinality, this process can take longer due to the large number of time-series that need to be searched. As a result, queries can take longer to complete, and users may experience slower response times.</p><p><strong>C. Performance Issues</strong></p><p>In addition to increased resource utilization and slower query times, high cardinality can also impact the performance of Prometheus. When Prometheus is unable to handle the high number of time-series, it may lead to performance issues such as slow ingestion of new data or even system crashes. This can have a significant impact on your monitoring system and cause downtime for your applications.</p><h4><strong>Managing Cardinality:</strong></h4><p>To manage and reduce cardinality, Prometheus provides several tools and techniques, including:</p><ol><li><strong>Label drop</strong>: Removing unnecessary labels from metrics before they are stored in the database. This can help reduce the number of distinct label sets and improve query performance.</li><li><strong>Label relabelling</strong>: Modifying or merging labels to reduce the number of distinct label sets. This can be useful when dealing with metrics that have multiple labels that are not all needed for analysis.</li><li><strong>Downsampling</strong>: Reducing the resolution of data over time to reduce the number of time series stored in the database. This can help reduce the amount of data stored in the database and improve query performance.</li><li><strong>Federation</strong>: Splitting the data across multiple Prometheus servers to reduce the cardinality of each individual server. This can be useful when dealing with large amounts of data that cannot be efficiently stored on a single server</li></ol><h4>Best Practices:</h4><p>Here are some best practices to follow when dealing with cardinality in Prometheus:</p><ol><li><strong>Limit the number of labels</strong>: Only include labels that are necessary for analysis. Avoid adding labels that are not needed, as they can quickly increase cardinality.</li><li><strong>Use label drop and relabelling</strong>: Remove unnecessary labels from metrics before storing them in the database. Modify or merge labels to reduce the number of distinct label sets.</li><li><strong>Monitor and optimize</strong>: Regularly monitor and optimize the system to ensure that it continues to perform well as the data set grows.</li></ol><h4>Conclusion:</h4><p>Cardinality is a key factor in the health and happiness of your Prometheus system. By keeping it under control, you can avoid performance problems and resource headaches. So, show your system some love and manage that cardinality!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96ad082b6398" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fournine-cloud/understanding-cardinality-in-prometheus-monitoring-96ad082b6398">Understanding Cardinality in Prometheus Monitoring</a> was originally published in <a href="https://medium.com/fournine-cloud">Fournine Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Argo CD using helm]]></title>
            <link>https://medium.com/fournine-cloud/installing-argo-cd-using-helm-ed4a0cd0845a?source=rss-51b92d962f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed4a0cd0845a</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Arun Kumar Peddapalli]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 07:01:44 GMT</pubDate>
            <atom:updated>2023-01-02T07:01:44.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zi0TgcJ4Qw4gcUE99IEY-w.jpeg" /></figure><p>Argo CD is a powerful continuous delivery tool that helps developers automate the deployment process of their applications. In this blog, we will cover the steps to install Argo CD using Helm, a package manager for Kubernetes.</p><p>Before we begin, make sure you have the following prerequisites:</p><ul><li>A Kubernetes cluster (can be local or remote)</li><li>Helm installed on your local machine</li><li>kubectl configured to access your cluster</li></ul><p>Step 1: Add the Argo CD Helm repository</p><p>First, we need to add the Argo CD Helm repository to our local machine:</p><pre>helm repo add argo https://argoproj.github.io/argo-helm</pre><p>Step 2: Install Argo CD using Helm</p><p>Next, we can install Argo CD using the Helm command:</p><pre>helm install argocd argo/argo-cd</pre><p>This will install Argo CD in the default namespace. If you want to install it in a different namespace, you can use the --namespace flag.</p><p>Step 3: Access the Argo CD dashboard</p><p>To access the Argo CD dashboard, we need to get the URL of the dashboard. To do this, use the following command:</p><pre>kubectl -n argocd get svc</pre><p>This will show the list of services in the argocd namespace. The Argo CD dashboard service should be listed. Copy the EXTERNAL-IP and paste it in your browser to access the Argo CD dashboard. You will be asked to enter the username and password to log in. The default username and password are admin.</p><h4><strong>Creating a Git repository</strong></h4><p>To deploy applications using Argo CD, you need to set up a Git repository that contains your application source code and deployment manifests. You can use any Git hosting service, such as GitHub, GitLab, or Bitbucket, for this purpose.</p><p>Once you have a Git repository, you need to create a personal access token (PAT) for Argo CD to access it. The PAT should have read-only access to the repository.</p><h4>Creating an application in Argo CD</h4><p>With the external IP and PAT in hand, you can now create your first application in Argo CD. To do this, follow these steps:</p><ol><li>In the Argo CD web UI, click on the + New App button.</li><li>In the Repository URL field, enter the URL of your Git repository.</li><li>In the Revision field, enter the branch or commit hash of the revision you want to deploy.</li><li>In the Destination section, select the namespace and cluster where you want to deploy the application.</li><li>In the Sync Options section, you can specify additional options for the application, such as the resource filter and sync policy.</li><li>Click on the Create button to create the application.</li></ol><p>Once the application is created, Argo CD will automatically sync the application to the destination namespace and deploy it. You can view the status of the deployment and any errors in the Overview tab of the application page.</p><h4>Updating an application</h4><p>To update an application, you can simply make changes to the source code in your Git repository and push the changes to the repository. Argo CD will automatically detect the changes and sync them to the destination namespace.</p><p>Alternatively, you can manually trigger a sync from the Argo CD web UI by clicking on the Sync button in the Overview tab of the application page.</p><h4>Deleting an application</h4><p>To delete an application, click on the Delete button in the Overview tab of the application page. This will delete the application from Argo CD and also delete all the resources associated with the application in the destination namespace.</p><h4>Conclusion</h4><p>In this blog, we have walked through the steps to install and set up Argo CD on a Kubernetes cluster, and create and manage applications using Argo CD. Argo CD is a powerful tool that can help you automate the deployment of applications to Kubernetes clusters and streamline your continuous delivery workflow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed4a0cd0845a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fournine-cloud/installing-argo-cd-using-helm-ed4a0cd0845a">Installing Argo CD using helm</a> was originally published in <a href="https://medium.com/fournine-cloud">Fournine Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Kubernetes services?]]></title>
            <link>https://medium.com/fournine-cloud/what-are-kubernetes-services-cd72eb74b95b?source=rss-51b92d962f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd72eb74b95b</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[load-balancing]]></category>
            <dc:creator><![CDATA[Arun Kumar Peddapalli]]></dc:creator>
            <pubDate>Thu, 03 Nov 2022 10:32:55 GMT</pubDate>
            <atom:updated>2022-11-03T10:32:55.934Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Is A Kubernetes “<strong>Service</strong>”?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFnRIJFFzTZaVT-o8Apjow.png" /><figcaption>Image: What are Kubernetes services?</figcaption></figure><h4><em>What is a Kubernetes Service?</em></h4><p>Kubernetes Service enables a group of pods to be assigned a name and unique IP address so that they can be managed by the cluster. This abstraction enables you to identify and isolate the functionality of each Service within your containerized apps. Since pods are ephemeral, a Service enables a group of pods (which provide specific services such as web services, image processing, and so on) to be named and have a unique IP address (ClusterIP). As long as the ClusterIP is in use, the Service’s IP address will not change. Policies are also defined for service access.</p><h3>Service Types in Kubernetes</h3><p>Kubernetes supports three different types of Service:</p><ol><li>ClusterIP</li><li>NodePort</li><li>LoadBalancer</li></ol><p>Let’s take a brief overview of each Service type</p><h3>1. ClusterIP</h3><p>The default Kubernetes Service type is <a href="https://en.wikipedia.org/wiki/Cluster_IP">ClusterIP</a>. It gives you an internal service that other applications inside your cluster can access, but there is no external access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*zfUOjrfhvInnPZyXlY_RqQ.png" /><figcaption>ClusterIP Traffic Flow</figcaption></figure><p>Lets see the YAML for ClusterIP</p><pre>apiVersion: v1<br><strong><em>kind: Service</em></strong><br>metadata:  <br>  name: clusterip-service<br>spec:<br>  selector:    <br>    app: web-app<br>  <strong><em>type: ClusterIP</em></strong><br>  ports:  <br>  - name: http<br>    port: 80<br>    targetPort: 80<br>    protocol: TC</pre><p><em>When to use ClusterIP?</em></p><ul><li>Debugging services, or connecting to them directly from laptop for some reason using Kubernetes proxy.</li><li>Allowing internal traffic so that other applications in the same cluster can contact the service.</li><li>Designed to be NOT accessible from the external of the cluster.</li></ul><h3>2. NodePort</h3><p>A NodePort Service is very similar to a ClusterIP service. It is also the default way to get external traffic to your service. But with a NodePort, you open a specific port inside each pod on a specific node, and then you use that specific port for sending traffic to your service. This is the simplest way to get external traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*F0QEVX6L9rYTBqplX4rADA.png" /><figcaption>NodePort Traffic Flow</figcaption></figure><p>Lets see the YAML for NodePort</p><pre>apiVersion: v1<br><strong><em>kind: Service</em></strong><br>metadata:  <br>  name: nodeport-service<br>spec:<br>  selector:    <br>    app: web-app<br>  <strong><em>type: NodePort</em></strong><br>  ports:  <br>  - name: http<br>    port: 80<br>    targetPort: 80<br>    nodePort: 30036<br>    protocol: TCP</pre><p><em>When to use NodePort?</em></p><ul><li>Very convenient to create a service easily contactable from the external on your laptop during the tests.</li><li>NodePort only have one service per port.</li><li>NodePort can only use ports 30000–32767.</li><li>If Node/VM IP address change, we need to deal with that.</li></ul><h3>3. LoadBalancer</h3><p>A <a href="https://www.nginx.com/resources/glossary/load-balancing/">LoadBalancer</a> Service is the standard way to expose your Service to the internet. There are several options for using a LoadBalancer Service, including with a Public IP address and with a DNS name. Public IP LoadBalancers are the most common, and they give you a single Public IP address that anyone can access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*YJJhWDmRovaooJKt7vALrA.png" /><figcaption>LoadBalancer Traffic Flow</figcaption></figure><p>Lets see the YAML for LoadBalancer</p><pre>---<br>apiVersion: v1<br><strong><em>kind: Service</em></strong><br>metadata:<br>  name: loadbalancer-service<br>spec:<br>  ports:<br>    - port: 80<br>  <strong><em>type: LoadBalancer</em></strong><br>  selector:<br>    app:  web-app</pre><p><em>When to use LoadBalancer?</em></p><ul><li>All traffic on the port we specify will be forwarded to the Service. There is no filtering, no routing, etc.</li><li>The big downside of it is that it is usually only available on a Cloud environment where We have to pay to allocate a Load Balancer for your Service.</li><li><em>LoadBalancer</em> have an IP for each service.</li><li>It’s expensive.</li></ul><h3>What is Kubernetes Ingress and why is it useful?</h3><p>The <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/">Ingress</a> is similar to other services that use a NodePort or LoadBalancer, but it is different in that it doesn’t route traffic directly. Instead, Ingress acts as a proxy by making itself visible on the Internet. Under the hood, this allows it to use internal service routing to get traffic where it needs to go.</p><p>The Ingress API object in Kubernetes is used to define how external users should be able to access the services in a Kubernetes cluster, typically via HTTPS/HTTP. You can set up rules for traffic routing without creating a lot of Load Balancers or exposing each service on the node if you use Ingress. This makes it the best option for production use.]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*Pp1xLtVi6-CnFsIm-hSEZw.png" /><figcaption>Ingress traffic flow</figcaption></figure><p>Lets see the YAML for Ingress</p><pre>apiVersion: extensions/v1beta1<br><strong><em>kind: Ingress</em></strong><br>metadata:<br>  name: ingress<br>spec:<br>  backend:<br>    serviceName: other<br>    servicePort: 8080<br>  rules:<br>  - host: www.example.com<strong><br></strong>    http:<br>      paths:<br>      - backend:<br>          serviceName: web-app<br>          servicePort: 8080<strong><br></strong>  - host: blog.example.com<br>    http:<br>      paths:<br>      - path: /bar/*<br>        backend:<br>          serviceName: blog<br>          servicePort: 8080</pre><p><em>When to use Ingress?</em></p><ul><li>Externally reachable URLs for applications deployed in Kubernetes clusters</li><li>Name-based virtual host and URI-based routing support</li><li>Load balancing rules and traffic, as well as SSL termination</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd72eb74b95b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fournine-cloud/what-are-kubernetes-services-cd72eb74b95b">What are Kubernetes services?</a> was originally published in <a href="https://medium.com/fournine-cloud">Fournine Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes monitoring — How to monitor using prometheus?]]></title>
            <link>https://medium.com/fournine-cloud/kubernetes-monitoring-how-to-monitor-using-prometheus-f2eff767f6bb?source=rss-51b92d962f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2eff767f6bb</guid>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Arun Kumar Peddapalli]]></dc:creator>
            <pubDate>Wed, 26 Oct 2022 11:45:31 GMT</pubDate>
            <atom:updated>2022-10-27T11:31:56.462Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes monitoring — How to monitor using prometheus?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A02RdHRrMDcx-jqq7r46VQ.png" /><figcaption>How to monitor kubernetes using promethues?</figcaption></figure><h4>Why Monitor Kubernetes Containers in Production?</h4><p>Running containers at production scale positions challenges for the DevOps Engineers who are responsible for the orchestration and versioning of its lifecycle. Kubernetes can be deployed as a public cloud or private on-premise software</p><p>When monitoring Kubernetes containers in production, there are multiple options that you have to choose from. They all won’t offer you the same level of features or quality and so you need to find good tools that suit your needs like</p><ol><li>Ability to handle a large number of containers</li><li>Data visualisation is available</li><li>3rd party support before deploying new version</li></ol><h4>How Prometheus helps monitoring Kubernetes Containers in Production?</h4><p>Prometheus is an open-source monitoring system and time series database. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.</p><p>Prometheus and Grafana Kubernetes Cluster monitoring provides information on potential performance bottlenecks, cluster health, performance metrics. At the same time, visualize network usage, resource usage patterns of pods, and a high-level overview of what is going on in the cluster.</p><p>Prometheus became most used Kubernetes monitoring system because of these features:</p><ol><li><strong>Multi-dimensional data model:</strong> it’s based on key-value pairs, much as how Kubernetes labels infrastructure metadata. It powers the Prometheus query language and enables flexible and precise time series data.</li><li><strong>Accessible format and protocols:</strong> Metrics are published utilising a common HTTP transport, are human readable, and have self-explanatory formats.</li><li><strong>Service discovery:</strong> Prometheus server is responsible for routinely scraping the targets (metrics are pulled, not pushed). It’s ideal for ephemeral Kubernetes workloads because they can be set to filter and match container metadata.</li><li><strong>Modular and high available components:</strong> Different composable services carry out tasks like metric gathering, alerting, graphic presentation, etc. These services are all made to facilitate sharding and redundancy.</li></ol><h4>Setting up Promotheus in kubernetes</h4><p>The Best way to set up Prometheus is to use Helm charts to install it in a Kubernetes cluster. As a prerequisite, you need to have Helm installed on the machine.</p><p>Authenticate to your cluster and Perform below commands to install Prometheus</p><ul><li>Add the Helm repo for Prometheus and Grafana.</li></ul><p>To install Prometheus, you first need to add theprometheus-community Helm repository by using the helm repo addcommand followed by the helm repo updatecommand to pull in the latest metadata:</p><ul><li>Create a namespace for monitoring<br>Create a new namespace for monitoring to isolate the monitoring resources</li><li>Install the Prometheus chart in the monitoring namespace.</li></ul><p>Before you install Prometheus, check out the configuration options you have, because there are a lot of them. you can install Prometheus with the default configuration using the helm install command:</p><pre>helm install prometheus prometheus-community/prometheus \<br>--namespace monitoring \<br>--set alertmanager.persistentVolume.storageClass=&quot;default&quot; \<br>--set server.persistentVolume.storageClass=&quot;default&quot;</pre><p>After installing the promotheus and configuring it, follow the below commands</p><ul><li>Run the following command to confirm your Kube-Prometheus stack deployment.</li></ul><pre>kubectl get pods -n monitoring<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*E-9YLw9SvdJRH2M_spoIQw.png" /></figure><ul><li>Accessing the Prometheus Instance and Viewing the Internal State Metrics<br>After successfully deployed Prometheus instances to Kubernetes cluster, the next step is to use them to monitor the cluster. To do this, we must enable traffic to the Prometheus pod to observe your cluster’s internal metrics. This will also enable you to access the Prometheus server from your browser.</li><li>Run the following command to obtain the name of the Prometheus server to which you will be forwarding traffic to</li></ul><pre>kubectl get svc -n monitoring</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDRDI8BPK2j7ZXlmRLxnTg.png" /><figcaption>promotheus server fro which we forward traffic</figcaption></figure><p>Run the below kubectl port-forward command to forward the local port 9090 to your cluster via the Prometheus service</p><pre>kubectl port-forward svc/prometehus-prometheus-server <strong>\</strong><br>-n monitoring 9090</pre><ul><li>Navigate to <a href="http://localhost:9090/">http://localhost:9090</a> if you’re following along with local windows, Linux or mac machine. Navigate to your server’s IP address followed by port 9090 (i.e., <a href="http://your_server_ip:9090/">http://YOUR_SERVER_IP:9090</a>) if you’re using a remote server.</li></ul><h4>Visualising with Grafana</h4><p>Until now you’re done with setting up promotheus to collect the data now we are going to use grafana to visualize the data that we’ve collected</p><ul><li>Install the Grafana chart with the arguments below.</li></ul><blockquote>Please change the admin password for the login.</blockquote><pre>helm install grafana grafana/grafana \<br>--namespace monitoring \<br>--set persistence.storageClassName=&quot;default&quot; \<br>--set persistence.enabled=true \<br>--set adminPassword=&#39;Yourfavpassword&#39; \<br>--set service.<strong>type</strong>=LoadBalancer</pre><ul><li>Get the list of services in monitoring namespace</li></ul><pre>kubectl get svc -n monitoring</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*g0OPVN2AuxsmYRPhkPK-oA.png" /><figcaption>list of services in monitoring namespace</figcaption></figure><ul><li>run the below kubectl port-forward command to forward the local port 3001 to your cluster via the grafana service</li></ul><pre><br>kubectl port-forward svc/grafana -n monitoring 3001:80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z7Q2DLgnROd2AhteKXnvxw.png" /><figcaption>Grafana Login Page</figcaption></figure><ul><li>Login with admin username admin and password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SIeizx_J9E-aYsnCubaz2g.png" /><figcaption>Grafan welcome Page</figcaption></figure><ul><li>Add Prometheus datasource</li></ul><p>If you mouse over the cogwheel on the left-hand side of the Grafana screen, you’ll be prompted with several configuration options. Choose “Data Sources,” followed by “Add data source.”</p><p>Here, you’ll see a long list of data sources that Grafana knows how to talk to automatically, and luckily Prometheus is on that list. Choose “Prometheus” and you’ll be brought to the configuration screen for your new data source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*reCdtA7QejnxCNWxj4D73g.png" /><figcaption>Data source Dashboard</figcaption></figure><blockquote>If you didn’t change the default configuration when installing Prometheus, you’ll only need to give it a name of your choosing, as well as the URL where Prometheus is running. Since both are running in the same cluster, you can connect Grafana to Prometheus using the internal DNS to Kubernetes by providing it the service name that Prometheus is connected to <a href="http://prometehus-prometheus-server:9090/">http://prometehus-prometheus-server:9090</a></blockquote><ul><li>Importing Dashboard</li></ul><p>To import this dashboard, mouse over the “Dashboards” section on the left-hand side of the Grafana screen (the icon is four squares) and choose “Manage.” On the top right of the dashboard management screen, click “Import” and you’ll be prompted for the URL, ID, or JSON for the dashboard that you wish to import.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*NekcVlQtHLXtBysglmi0rg.png" /><figcaption>Import Dashboard</figcaption></figure><ul><li>Under “Import via grafana.com,” enter “10000,” matching the ID of the dashboard that you wish to import.</li><li>Feel free to change the name or the unique identifier, but the one thing you must provide is the data source, which is asked for on the bottom of the configuration screen. Choose your Prometheus data source, click “Import,” and you will be greeted by your newly created, but fully populated, dashboard!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*CEjSWkmlT-ap1Jl8gAFEOg.png" /><figcaption>Grafana dashboard with data</figcaption></figure><p>And that’s a wrap, this is how we use promotheus to monitor kubernetes.If you’ve any queries do comment in the below and don’t forget to follow our publication to never miss out this type of content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2eff767f6bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fournine-cloud/kubernetes-monitoring-how-to-monitor-using-prometheus-f2eff767f6bb">Kubernetes monitoring — How to monitor using prometheus?</a> was originally published in <a href="https://medium.com/fournine-cloud">Fournine Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up 24*7 monitoring dashboards using Grafana]]></title>
            <link>https://medium.com/fournine-cloud/setting-up-24-7-monitoring-dashboards-using-grafana-3bf7231c6aa5?source=rss-51b92d962f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bf7231c6aa5</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[monitoring]]></category>
            <dc:creator><![CDATA[Arun Kumar Peddapalli]]></dc:creator>
            <pubDate>Tue, 13 Sep 2022 07:22:06 GMT</pubDate>
            <atom:updated>2022-09-13T07:28:01.788Z</atom:updated>
            <content:encoded><![CDATA[<p>Here in this blog, you’ll get to know how to install Grafana on Ubuntu and CentOS. Before installing Grafana let’s know some facts about this amazing visualization tool. Here are few things you need to know about Grafana before installing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xod2pux41_u64wZ2Z2W1Fw.png" /><figcaption>Setting up 24*7 monitoring dashboards using Grafana</figcaption></figure><ul><li>Grafana is just a visualization tool. It doesn’t store any kind of data</li><li>You can connect various datasources like Prometheus, InfluxDB, Elacsticsearch and traditional relational database engines.</li><li>You can create complex and informational dashboards using Grafana</li><li>Grafana has a wide range of visualization components like various graphs, heat maps and histograms.</li><li>Best part is you can use Grafana to trigger notifications and email alerts for certain threshold.</li></ul><h3>System Requirements:</h3><ul><li>Ubuntu Server 16.04 or CentOS 7.</li><li>Root privileges</li></ul><p>System check done, Now it’s time to install Grafana on ubuntu.</p><h4>Installing Grafana on ubuntu:</h4><ol><li>First and forward update and install pre-requisite packages</li></ol><pre>sudo apt-get install -y apt-transport-httpssudo apt-get install -y software-properties-common wgetwget -q -O — <a href="https://packages.grafana.com/gpg.key">https://packages.grafana.com/gpg.key</a> | sudo apt-key add</pre><p>2. Add Stable grafana apt repo by using below command</p><pre>echo “deb <a href="https://packages.grafana.com/enterprise/deb">https://packages.grafana.com/enterprise/deb</a> stable main” | sudo tee -a /etc/apt/sources.list.d/grafana.list</pre><p>3. After adding apt repos we need to update and install grafana below are the commands to update repos and install grafana</p><pre>sudo apt-get updatesudo apt-get install grafana-enterprise</pre><blockquote><em>Note: Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS Edition. You can also upgrade to the </em><a href="https://grafana.com/products/enterprise/?utm_source=grafana-install-page"><em>full Enterprise feature set</em></a><em> and has support for </em><a href="https://grafana.com/grafana/plugins/?enterprise=1&amp;utcm_source=grafana-install-page"><em>Enterprise plugins</em></a><em>.</em></blockquote><p>4. Start the grafana service by running below commands</p><pre>sudo systemctl daemon-reloadsudo systemctl start grafana-server</pre><p>Verify grafana is running or not by using below command</p><pre>sudo systemctl status grafana-server</pre><p><strong>Step 5: </strong>Enable grafana to run at boot time by using below command</p><pre>sudo systemctl enable grafana-server.service</pre><p>And We are done installing Grafana on Ubuntu, If you’re using CentOS the below process is for you. If you’re using Ubuntu you’ve already installed Grafana, So head down to connect a datasource(Promotheus) to visualize the data.</p><h4>Steps for Installing Grafana- on centOS</h4><p><strong>Step 1: Create a repo file and add content</strong></p><p>Create a repo file by using vim</p><pre>vim /etc/yum.repos.d/grafana.repo</pre><p>Add the following contents to file:</p><pre>[grafana]</pre><pre>name=grafana</pre><pre>baseurl=https://packages.grafana.com/oss/rpm</pre><pre>repo_gpgcheck=1</pre><pre>enabled=1</pre><pre>gpgcheck=1</pre><pre>gpgkey=https://packages.grafana.com/gpg.key</pre><pre>sslverify=1</pre><pre>sslcacert=/etc/pki/tls/certs/ca-bundle.crt</pre><p><strong>Step 2: Install Grafana</strong></p><p>Enter the following command to install grafana</p><pre>sudo yum install grafana</pre><p><strong>Step 3: Enable Grafana Service</strong></p><p>Check the status of the service.</p><pre>systemctl status grafana-server</pre><p>If service is not active, start it using the following command:</p><pre>systemctl start grafana-server</pre><p>Enable Grafana service on system boot</p><pre>systemctl enable grafana-server.service</pre><ul><li>Access the Grafana Dashboard using <a href="http://ip_address:3000/login">http://IP_ADDRESS:3000/login</a></li><li>The default login <strong>Username: Password</strong> for accessing the Grafana dashboard is <strong>admin: admin</strong></li><li>Change the default admin password after the login.</li></ul><p>We have done installing Grafana on Ubuntu and CentOS. Now it’s time to connect a datasource to visualize. If you haven’t installed prometheus and looking to install here’s our guide to do that.</p><p><a href="https://blog.fourninecloud.com/what-is-prometheus-and-how-to-install-and-configure-it-on-linux-server-9b5f88685451">What is Prometheus and How to install and configure it on Linux server ?</a></p><h3>Create a Prometheus Datasource inside Grafana Dashboard</h3><ol><li>Goto your Grafana Dashboard and click on <em>Gear(Settings Icon)-&gt;Data Sources</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*aTLmg5GY0FZaY2sr" /></figure><p>2. Click on add Data Source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zSFMyGiENp5Gdylr" /></figure><p>Add datasource in grafana</p><p>3.Select the <em>Prometheus</em> as preferred data source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ceBqZlqQmlRYmvDl" /></figure><p>4. Enter the hostname or IP address of the prometheus server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lTzjK5wPRmysR5eP" /></figure><p>5. Save and test data source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vrffG6g9p12UTmZp" /></figure><p>We are done setting up a datasource as promotheus. It’s time to visualize the data using some inbuilt dashboard templates.</p><ul><li>Now after settings the data source we can import pre-existing opensource dashboard from <a href="https://grafana.com/grafana/dashboards/">Grafana Labs</a> using the Dashboard ID.</li></ul><ol><li>Goto <a href="https://grafana.com/grafana/dashboards/">Grafana Dashboard</a> and search for your Dashboard Exapmle kubernetes cluster</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6t7I4hAR6RuQ_CzZ" /></figure><p>dashboard templates</p><p>2. Select appropriate board and copy the id of dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Hk9E6f7Dg3nGHpNL" /></figure><p>copyID for dashboard</p><p>3. Go to you grafana url Click on + button and select import</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/0*2L1rh4TXsIQVFwlU" /></figure><p>Import data to grafana from promotheus</p><p>4. Pass you Dashboard and click on load</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9I9eTUXYs2pBjNUX" /></figure><p>5. Click load and then select the data source as <strong><em>Prometheus</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y1l_M0xip_VKkxPx" /></figure><p>6. Finally Click on Import</p><p>7. You should be able to see the Kubernetes dashboard</p><p>If you have some patience and need grafana labs have many such prebuilt dashboard templates give them a try. If you’re looking for such services for your application. Reach out to <a href="http://fourninecloud.com/">fourninecloud.com</a> . For more such intresting and insightful stories do follow us on medium.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bf7231c6aa5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fournine-cloud/setting-up-24-7-monitoring-dashboards-using-grafana-3bf7231c6aa5">Setting up 24*7 monitoring dashboards using Grafana</a> was originally published in <a href="https://medium.com/fournine-cloud">Fournine Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Kubernetes and what does Kubernetes Architecture look like?]]></title>
            <link>https://medium.com/fournine-cloud/kubernetes-architecture-8285b0ed2cb4?source=rss-51b92d962f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/8285b0ed2cb4</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[Arun Kumar Peddapalli]]></dc:creator>
            <pubDate>Tue, 19 Apr 2022 12:10:03 GMT</pubDate>
            <atom:updated>2024-08-09T05:08:57.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*FAQ31OJuQlZ6SCv18_Ox8w.jpeg" /><figcaption>Kubernetes</figcaption></figure><h3>What is k8s?</h3><p>Kubernetes is a container orchestration Platform offers container runtime, container-centric infrastructure orchestration, load balancing, self-healing mechanisms, and service discovery Kubernetes sometimes shortened to K8s with the 8 standing for the number of letters between the “K” and the “s</p><p>Kubernetes is originally developed at Google and released as open source in 2014. it is a descendant of Borg, a container orchestration platform used internally at Google. And it ‘also</p><h3>What is architecture?</h3><p>Kubernetes cluster is a form of Kubernetes deployment architecture. Kubernetes architecture Contains two parts 1) control plane 2) nodes or compute machines. Each node could be either a physical or virtual machine and is its own Linux environment.</p><p><strong>Control plane components</strong></p><ol><li>KubeAPI server</li><li>Kube scheduler</li><li>Kube controller manager</li><li>etcd</li></ol><p><strong>Kubernetes node components</strong></p><ol><li>Kubelet service</li><li>Kube proxy service.</li><li>container runtime engine</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*Y_uKyhM_lu9JlNIEHMaOtg.png" /><figcaption>Kubernetes Architecture</figcaption></figure><h3><strong>Control plane components</strong></h3><p><strong>KubeAPI server</strong></p><p>The <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/">kube-api server</a> component is the entrance to the Kubernetes control plane for handling internal and external requests like updates, scaling, and other kinds of lifecycle orchestration by providing APIs for various types of applications The API server determines if a request is valid and, if it is, processes it. We can access the API through REST calls, through the kubectl command-line interface, or through other command-line tools like kubeadm</p><p>kube-apiserver is designed to scale horizontally that is, it scales by deploying more instances. We can run multiple instances of kube-apiserver and balance traffic between those instances.</p><p><strong>Kube scheduler</strong></p><p>If an API request has been made to the kube-apiserver to deploy a container into a Kubernetes cluster, it finds a suitable node to run that container on as a Pod.</p><p>Kube scheduler responsible for tracking utilization of working load on cluster nodes and then placing the workload on which resources are available and accepting the workload</p><p><strong>Kube controller manager</strong></p><p><strong>controller-manager</strong> manages certain objects in the Kubernetes cluster, by constantly monitoring the state of the cluster</p><p>Controllers inside the Controller Manager are dedicated to watching and reacting to changes of different types of objects.</p><p>Node controller: Responsible for watching and responding when nodes go down.</p><p>Job controller: Watches for Job objects then creates Pods to run those tasks to completion.</p><p>Endpoints controller: Populates the Endpoints object (that is, joins Services &amp; Pods).</p><p>Service Account &amp; Token controllers: Create default accounts and API access tokens for new namespaces</p><p><strong>For example:</strong> the <em>ReplicaSet</em> controller makes sure that there is the correct number of <em>Pods</em> running for a given application. If an application is needs to have 2 Pods, but it’s having only 1, then the controller will schedule a new Pod, to increase the count to 2.</p><p><strong>Etcd</strong></p><p><strong>etcd</strong> is the database of the cluster. It stores the entire configuration and state of the cluster as key-value pair. The Master node queries <strong>etcd</strong> to retrieve parameters for the state of the nodes, pods, and containers. It also stores user and application configuration like <strong>ConfigMaps</strong> and <strong>Secrets</strong>.</p><p>The kube-apiserver is the only component connected to the etcd Since <strong>etcd</strong> is the “single source of truth” of the state of the Kubernetes cluster, it’s protected and deployed in such a way that makes it fault-tolerant against crashes</p><h4><strong>Control Plane componentes</strong></h4><p><strong>Kubelet service</strong></p><p>The <strong>kubelet</strong> runs on every node in the cluster It is the principal Kubernetes agent. By installing kubelet, the node’s CPU, RAM, and storage become part of the broader cluster. The <strong>kubelet</strong> creates and destroys containers by interacting with the container runtime that’s running on the Node. It uses the Container Runtime Interface (CRI) API to do this. It watches for tasks sent from the API Server, executes the task, and reports back to the Master.</p><p><strong>Kube proxy service.</strong></p><p>This component is a network proxy that runs on each node and maintains network rules on them. t seamlessly handles network requests between Pods on different nodes, and from Pods to the internet</p><p><strong>container runtime engine</strong></p><p>containerized applications are wrapped in a pod and placed on a node in a Kubernetes cluster. The container runtime pulls images from a container image registry and starts and stops containers. These nodes must have a container runtime like Docker or cri-o to work as intended. You can run the container runtime of your choosing, as long as it supports Kubernetes’s Container Runtime Interface (CRI) API.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8285b0ed2cb4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fournine-cloud/kubernetes-architecture-8285b0ed2cb4">What is Kubernetes and what does Kubernetes Architecture look like?</a> was originally published in <a href="https://medium.com/fournine-cloud">Fournine Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Prometheus and How to install and configure it on Linux server ?]]></title>
            <link>https://medium.com/fournine-cloud/what-is-prometheus-and-how-to-install-and-configure-it-on-linux-server-9b5f88685451?source=rss-51b92d962f91------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b5f88685451</guid>
            <category><![CDATA[how-to-install-prometheus]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[what-is-prometheus]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[alertmanager]]></category>
            <dc:creator><![CDATA[Arun Kumar Peddapalli]]></dc:creator>
            <pubDate>Mon, 12 Jul 2021 07:39:59 GMT</pubDate>
            <atom:updated>2022-08-30T06:53:31.136Z</atom:updated>
            <content:encoded><![CDATA[<h3>Prometheus — How to install and configure it on a Linux server.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XC_UckxyqUMGilhFC2Kuxg.png" /><figcaption>How to setup promotheus on a linux server?</figcaption></figure><h3>What is Prometheus?</h3><p>Prometheus is a popular Opensource system monitoring and alerting tool Originally developed by SoundCloud, then made open source and accepted as the second project in the Cloud Native Computing Foundation (CNCF) in 2016. It is similar in design to Google’s Borgmon monitoring system, and a relatively modest system can handle collecting hundreds of thousands of metrics every second.</p><h3>Prometheus Architecture diagram :</h3><p>Prometheus is a <strong>multi-component system</strong> some of which are optional</p><ul><li>Prometheus Server (Scrapes and stores the time series data)</li><li>Client libraries (Instrumenting application code)</li><li>Push gateway (To support metric collections from short-lived jobs)</li><li>Special purpose exporters (for services like HAProxy, StatsD, Graphite, etc.)</li><li>Alert manager (to handle alerts)</li><li>Additional support tools</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eLvhdZLLqbVtaYRc.jpeg" /></figure><p>Prometheus architecture diagram</p><h3>How does it work?</h3><p>Prometheus is meant to be used to collect metrics from an exposed HTTP endpoint. It stores all the collected metrics locally and runs rules over the data to aggregate and record new time series from existing data or generate alerts. API consumers like Grafana can be used to visualize</p><ul><li>In addition to stored time series from the source are generated by queries. These series are identified by metric labels.</li><li>Queries produced by PromQL (Prometheus Query Language) enables users to select and aggregate time-series data in real-time.</li><li>PromQL (Prometheus Query Language) also allows you to set up triggers that will send push notifications to other sources, like Slack, PagerDuty, or Email.</li></ul><h3>Minimum Requirements to Install Prometheus :</h3><ul><li>2 CPU cores</li><li>4 GB of memory</li><li>20 GB of free disk space</li></ul><h3>Installation Process :</h3><ul><li>This guide explains how to install and configure the latest Prometheus on a Linux VM.</li></ul><blockquote><em>Step 1:</em></blockquote><ul><li>Create a <strong>Prometheus</strong> user, required directories, and make <strong>prometheus</strong> user as the owner of those directories.</li></ul><pre>sudo useradd --no-create-home --shell /bin/false prometheus<br>sudo mkdir /etc/prometheus<br>sudo mkdir /var/lib/prometheus<br>sudo chown prometheus:prometheus /etc/prometheus<br>sudo chown prometheus:prometheus /var/lib/prometheus</pre><blockquote><em>Step 2:</em></blockquote><ul><li>Download the source using Curl, untar it and rename the extracted folder to prometheus-files</li></ul><pre>curl -LO <a href="https://github.com/prometheus/prometheus/releases/download/v2.28.1/prometheus-2.28.1.linux-amd64.tar.gz">https://github.com/prometheus/prometheus/releases/download/v2.28.1/prometheus-2.28.1.linux-amd64.tar.gz</a><strong><br></strong>tar -xvf <a href="https://github.com/prometheus/prometheus/releases/download/v2.28.1/prometheus-2.28.1.linux-amd64.tar.gz">prometheus-2.28.1.linux-amd64.tar.gz</a><br>mv prometheus-2.18.1.linux-amd64 prometheus-files</pre><blockquote><em>Step 3:</em></blockquote><ul><li>Copy <strong>prometheus</strong> and <strong><em>promtool</em></strong> binaries from <strong>prometheus-files</strong> folder to <strong>/usr/local/bin</strong> and change the ownership to <strong>prometheus</strong> user.</li></ul><pre>sudo cp prometheus-files/prometheus /usr/local/bin/<br>sudo cp prometheus-files/promtool /usr/local/bin/<br>sudo chown prometheus:prometheus /usr/local/bin/prometheus<br>sudo chown prometheus:prometheus /usr/local/bin/promtool</pre><ul><li>Move the <strong>consoles</strong> and <strong>console_libraries</strong> directories from prometheus-files to<strong> /etc/prometheus</strong> folder and change the ownership to <strong>prometheus</strong> user.</li></ul><pre>sudo cp -r prometheus-files/consoles /etc/prometheus</pre><pre>sudo cp -r prometheus-files/console_libraries /etc/prometheus</pre><pre>sudo chown -R prometheus:prometheus /etc/prometheus/consoles</pre><pre>sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries</pre><p>In the <strong>/etc/prometheus</strong> directory, need to create a configuration file named <strong>prometheus.yml.</strong></p><pre>sudo cat &lt;&lt; EOF &gt; /etc/prometheus/ prometheus.yml<br>global:<br> external_labels:<br>  region: us-central<br>  monitor: infra<br>alerting:<br> alertmanagers:<br> - static_configs:<br>    - targets:<br>     - “localhost:9093”<br>rule_files:<br> - “rules.yml”<br>scrape_configs:<br> - job_name: prometheus<br>   scrape_interval: 5s<br>   static_configs:<br>    - targets:<br>       - “localhost:9090”<br> - job_name: nsq_exporter<br>   scrape_interval: 5s<br>   static_configs:<br>   - targets:<br>     - “&lt;Target_Server_IP&gt;:9127”<br>EOF</pre><blockquote><em>Step 4: Setup Prometheus Systemd Service</em></blockquote><ul><li>Create a <strong>prometheus</strong> service file.</li></ul><pre>sudo cat &lt;&lt; EOF &gt; /etc/systemd/system/prometheus.service<br>[Unit]<br>Description=Prometheus<br>Wants=network-online.target<br>After=network-online.target<br>[Service]<br>User=prometheus<br>Group=prometheus<br>Type=simple<br>ExecStart=/usr/local/bin/prometheus \<br>  --config.file /etc/prometheus/prometheus.yml \<br>  --storage.tsdb.path /monitoring/prometheus/prometheus_data/ \<br>  --web.console.templates=/etc/prometheus/consoles \<br>  --web.console.libraries=/etc/prometheus/console_libraries \<br>  --web.external-url=<a href="https://prom.infra.gcp.shipwire.com/">https://prom.example.com</a> \<br>  --web.listen-address=:9090 \<br>  --web.enable-lifecycle \<br>  --web.enable-admin-api \<br>  --log.level=info<br>[Install]<br>WantedBy=multi-user.target<br>EOF</pre><ul><li><strong>— config.file </strong>the directory containing the Prometheus configuration file<br><strong> — storage.tsdb.path </strong>Where Prometheus writes its database<br><strong> — web.console.templates </strong>Prometheus<strong> </strong>Console templates path<br><strong> — web.console.libraries </strong>Prometheus Console libraries path<br><strong> — web.external-url </strong>Prometheus External URL <br> — <strong>web.listen-addres </strong>Prometheus running port<br><strong> — web.enable-lifecycle </strong>If you use the Prometheus /-/reload HTTP endpoint to automatically reload your Prometheus config when it changes, these endpoints are disabled by default for security reasons in Prometheus 2.0. To enable them, set the — web.enable-lifecycle flag<br><strong> — web.enable-admin-api </strong>controls access to the administrative HTTP API</li><li>Reload the <strong>system</strong> service to register the prometheus service and start the prometheus service</li></ul><pre>sudo systemctl daemon-reload<br>sudo systemctl start prometheus</pre><ul><li>Check the <strong>prometheus</strong> service status using the following command.</li></ul><pre><em>sudo systemctl status prometheus</em></pre><blockquote><strong><em>Alert Manager Integration</em></strong></blockquote><p>AlertManager is used to handle alerts for client applications(like <strong>Prometheus</strong>). It also takes care of alerts deDuplicating, grouping and then routes them to different receivers such as E-mail, Slack, Pager Duty.</p><blockquote><strong><em>Installation</em></strong></blockquote><ul><li>The installation part of AlertManager is not a fancy thing, we just need simply to download the latest binary of Alertmanager from <a href="https://github.com/prometheus/alertmanager/releases">here</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k3ybkjTQB8tILSPk.png" /></figure><blockquote><strong><em>Configuration</em></strong></blockquote><ul><li>Need to configure after the tar file is extracted and the <strong>alertmanager</strong> binary file is placed at the right location. Although Alertmanager extracted directory contains the configuration file as well, it is not of our use. So we will create our own configuration. Let’s start by creating a directory for configuration.</li></ul><pre>mkdir /etc/alertmanager/</pre><ul><li>Then the configuration file will take place.</li></ul><pre>sudo cat &lt;&lt; EOF &gt; /etc/alertmanager/alertmanager.yml<br>route:<br>group_by: [‘alertname’, ‘cluster’, ‘service’]<br>group_wait: 30s<br>group_interval: 2m<br>repeat_interval: 3m<br>receiver: slack_general<br>routes:<br>- match:<br>severity: slack<br>receiver: slack_general<br>receivers:<br>- name: slack_general<br>  slack_configs:<br>  - api_url:‘<a href="https://hooks.slack.com/services/T596DT44S/xxxxxxxxxxxxxxxxxxxxx&#39;">https://hooks.slack.com/services/T596DT44S/xxxxxxxxxxxxxxxxxxxxx&#39;</a><br>channel: ‘#monitoring-alerts’<br>send_resolved: true<br>EOF</pre><ul><li>Once the configuration part is done we just have to create a storage directory where Alertmanager will store its data.</li></ul><pre>mkdir /var/lib/alertmanager</pre><p>Creating Alertmanager Systemd service</p><ul><li>Create an alermanager.service file to start with systemd</li></ul><pre>sudo cat &lt;&lt; EOF &gt; /etc/systemd/system/alertmanager.service<br>[Unit]<br>Description=AlertManager Server Service<br>Wants=network-online.target<br>After=network-online.target[Service]<br>User=root<br>Group=root<br>Type=Simple<br>ExecStart=/usr/local/bin/alertmanager \<br>--config.file /etc/alertmanager/alertmanager.yml<br>[Install]<br>WantedBy=multi-user.target<br>EOF</pre><ul><li>Then reload the daemon and start the alertmanager service.</li></ul><pre>systemctl daemon-reload<br>systemctl start alertmanager<br>systemctl enable alertmanager</pre><blockquote><strong><em>Prometheus Node Exporter Setup</em></strong></blockquote><ul><li>Node exporter is the best way to collect all the Linux server related metrics and statistics for monitoring</li></ul><p><strong>Prerequisites</strong></p><ul><li>Prometheus Node Exporter needs the Prometheus server to be up and running.</li><li>Port 9100 opened in server firewall as Prometheus reads metrics on this port.</li><li><strong>Setup Node Exporter Binary</strong></li></ul><p>Download the latest node exporter package and unpack it</p><pre>cd /tmp</pre><pre>curl -LO <a href="https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz">https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz</a><br></pre><p>Move the node export binary to /usr/local/bin</p><pre>sudo mv node_exporter-0.18.1.linux-amd64/node_exporter /usr/local/bin</pre><ul><li><strong><em>Create a Node Exporter systemd Service</em></strong></li></ul><pre>sudo useradd -rs /bin/false node_exporter<br>sudo cat &lt;&lt; EOF &gt; /etc/systemd/system/node_exporter.service<br>[Unit]<br>Description=Node Exporter<br>After=network.target<br>[Service]<br>User=node_exporter<br>Group=node_exporter<br>Type=simple<br>ExecStart=/usr/local/bin/node_exporter<br>[Install]<br>WantedBy=multi-user.target<br>EOF</pre><ul><li>Reload the system daemon and start the node exporter service.</li></ul><pre>sudo systemctl daemon-reload<br>sudo systemctl start node_exporter<br>sudo systemctl enable node_exporter</pre><p>Now, the node exporter would be exporting <strong>metrics on port 9100.</strong></p><p>You can see all the server metrics by visiting your server URL on /metrics as shown below.</p><blockquote><a href="http://localhost:9100/metrics"><strong><em>http://localhost:9100/metrics</em></strong></a></blockquote><h3>Configure the Server as Target on Prometheus Server</h3><ul><li>Now that we have the node exporter up and running on the server, we have to add this server as a target on the Prometheus server configuration.</li></ul><p>Note: This configuration should be done on the Prometheus server.</p><blockquote><strong><em>Step 1:</em></strong></blockquote><ul><li>Login to the Prometheus server and open the <strong>prometheus.yml </strong>file.</li></ul><p><strong><em>sudo vi /etc/prometheus/prometheus.yml</em></strong></p><blockquote><strong><em>Step 2:</em></strong></blockquote><ul><li>Under the scrape config section add the node exporter target as shown below. Change 1.0.0.0.2 with your server IP where you have setup node exporter.</li><li>Job name can be your server hostname or IP for identification purposes.</li></ul><pre>- job_name: ‘node_exporter_metrics’<br>   scrape_interval: 5s<br>   static_configs:<br>    - targets: [‘TARGET_SERVER_IP:9100’]</pre><ul><li>Restart the <strong>prometheus</strong> service for the configuration changes to take place.</li></ul><pre>sudo systemctl restart prometheus</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b5f88685451" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fournine-cloud/what-is-prometheus-and-how-to-install-and-configure-it-on-linux-server-9b5f88685451">What is Prometheus and How to install and configure it on Linux server ?</a> was originally published in <a href="https://medium.com/fournine-cloud">Fournine Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>