<?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"><channel><title><![CDATA[DevOpsDiary – DevOps & Cloud Native Guides, Tutorials & Insights]]></title><description><![CDATA[DevOpsDiary offers practical DevOps and Cloud Native content including beginner to intermediate guides, hands-on tutorials, and real use-cases to help engineers build skills and solve real problems.]]></description><link>https://devopsdiary.in</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1672586479737/CCuuVZak6.png</url><title>DevOpsDiary – DevOps &amp; Cloud Native Guides, Tutorials &amp; Insights</title><link>https://devopsdiary.in</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 14:07:22 GMT</lastBuildDate><atom:link href="https://devopsdiary.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Stop Using Jenkins for Continuous Deployment]]></title><description><![CDATA[Jenkins has been the go-to tool for Continuous Integration (CI) since its inception, a pioneer that made automation a standard practice in software development. It has completely revolutionised the way world thinks of Continuous Integration (CI) and ...]]></description><link>https://devopsdiary.in/stop-using-jenkins-for-continuous-deployment</link><guid isPermaLink="true">https://devopsdiary.in/stop-using-jenkins-for-continuous-deployment</guid><category><![CDATA[Jenkins]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[ci-cd]]></category><category><![CDATA[deployment]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Mon, 26 Jan 2026 12:30:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769341404411/11e62143-2b7a-43de-86b8-1b91996f7fbe.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Jenkins has been the go-to tool for Continuous Integration (CI) since its inception, a pioneer that made automation a standard practice in software development. It has completely revolutionised the way world thinks of Continuous Integration (CI) and Continuous Deployment (CD) i.e., CI/CD and gave the way a new way of building packages/ artifacts. However, as the technology landscape shifts towards cloud-native ecosystems like Kubernetes, Jenkins begins to show its age, particularly when used for Continuous Deployment (CD).</p>
<p>Jenkins has been part of almost every DevOps journey. For many teams, it was the first real step toward automation and faster software delivery.</p>
<p>And to be clear upfront:</p>
<blockquote>
<p><strong>Jenkins is still a very good tool for Continuous Integration.</strong></p>
</blockquote>
<p>The problem starts when Jenkins is stretched beyond CI and used as a <strong>Continuous Deployment engine</strong>, especially in Kubernetes-based environments.</p>
<p>This blog explains <strong>why Jenkins CI/CD pipelines struggles with modern Kubernetes deployments</strong>, not from opinion, but from how the tool actually works and what Kubernetes expects.</p>
<h2 id="heading-what-jenkins-does-exceptionally-well">What Jenkins Does Exceptionally Well</h2>
<p>Jenkins shines when it comes to:</p>
<ul>
<li><p>Running builds</p>
</li>
<li><p>Executing tests</p>
</li>
<li><p>Creating artifacts</p>
</li>
<li><p>Building container images</p>
</li>
<li><p>Integrating with almost any tool via plugins</p>
</li>
</ul>
<p>For CI workflows, Jenkins is mature, battle-tested, and reliable.</p>
<p>If your goal is:</p>
<ul>
<li><p>Compile code</p>
</li>
<li><p>Run tests</p>
</li>
<li><p>Push images to a registry</p>
</li>
</ul>
<p>Jenkins does that job well. Though it has some fundamental issues with the plugin ecosystem from security point of view, but if are using your own scripts for building images or running tests, it does the job pretty well.</p>
<h2 id="heading-how-jenkins-is-commonly-used-for-kubernetes-deployment">How Jenkins Is Commonly Used for Kubernetes Deployment</h2>
<p>In most real-world setups, deploying an application to Kubernetes with Jenkins looks like this:</p>
<ul>
<li><p>A Jenkinsfile with multiple stages</p>
</li>
<li><p>Shell scripts invoking <code>kubectl</code></p>
</li>
<li><p>Helm commands embedded in pipelines</p>
</li>
<li><p>Environment-based conditionals</p>
</li>
<li><p>Credentials injected at runtime</p>
</li>
<li><p>Manual approval steps implemented in Jenkins UI</p>
</li>
</ul>
<p>Over time, deployment logic moves into:</p>
<ul>
<li><p>Groovy scripts,</p>
</li>
<li><p>Bash files,</p>
</li>
<li><p>Pipeline parameters also known as parameterised builds,</p>
</li>
<li><p>Jenkins job configuration</p>
</li>
</ul>
<p>This approach works initially for basic setups. But it introduces a deeper problem. As you start scaling, expanding footprints on Kubernetes and cloud-native environments, Jenkins alone wouldn’t be sufficient and you end up stitching different tools, scripts, forcefully making it work somehow.</p>
<h2 id="heading-deployment-logic-starts-living-inside-jenkins">Deployment Logic Starts Living Inside Jenkins</h2>
<p>Once Jenkins is responsible for deployment, ask a few simple questions:</p>
<ul>
<li><p>Where is the desired state of the application defined?</p>
</li>
<li><p>How do you know what version <em>should</em> be running right now?</p>
</li>
<li><p>How do you detect configuration drift?</p>
</li>
<li><p>How do you roll back safely if Jenkins is down?</p>
</li>
<li><p>How do you audit <em>why</em> a deployment happened?</p>
</li>
<li><p>How do you do advanced deployment strategies like Canary/ Blue Green?</p>
</li>
</ul>
<p>In most Jenkins-based setups:</p>
<ul>
<li><p>The answer lives inside pipeline code, i.e, Groovy scripts</p>
</li>
<li><p>Or worse, inside someone’s head</p>
</li>
</ul>
<p>At that point, Jenkins is no longer just a CI tool. It becomes the <strong>source of truth for deployments</strong> with lousy visibility on cluster and workload status.</p>
<p>That’s where things start to break.</p>
<h2 id="heading-jenkins-is-imperative-kubernetes-is-declarative">Jenkins Is Imperative. Kubernetes Is Declarative.</h2>
<p>Jenkins works by executing steps in sequence and all of that sequence is nothing but your custom scripts, plugins and commands:</p>
<blockquote>
<p>Do this → then this → then this</p>
</blockquote>
<p>Kubernetes works by continuously reconciling state:</p>
<blockquote>
<p>This is how things should look, make it so</p>
</blockquote>
<p>This mismatch creates several issues:</p>
<ul>
<li><p>Jenkins <em>pushes</em> changes, Kubernetes expects reconciliation</p>
</li>
<li><p>Rollbacks require custom scripting</p>
</li>
<li><p>Failed deployments don’t self-heal</p>
</li>
<li><p>Drift detection doesn’t exist unless you build it yourself</p>
</li>
</ul>
<p>This is why GitOps tools like <a target="_blank" href="https://devtron.ai/what-is-argocd">Argo CD</a> and <a target="_blank" href="https://devtron.ai/blog/what-is-fluxcd/">Flux CD</a> exist. They align with how Kubernetes actually works. For cloud-native and Kubernetes environments, Kubernetes-native platforms excels and does the job without worrying about custom scripting or manually juggling with plugins, scripts, or custom hacks to make things work.</p>
<p>Jenkins does not.</p>
<h2 id="heading-jenkins-pipelines-become-increasingly-complex">Jenkins Pipelines Become Increasingly Complex</h2>
<p>As applications grow, Jenkins pipelines start accumulating responsibilities:</p>
<ul>
<li><p>Environment management</p>
</li>
<li><p>Cluster-specific logic</p>
</li>
<li><p>Secret handling</p>
</li>
<li><p>Approval workflows</p>
</li>
<li><p>Rollback rules</p>
</li>
<li><p>Notification logic</p>
</li>
</ul>
<p>This leads to:</p>
<ul>
<li><p>Long Jenkinsfiles</p>
</li>
<li><p>Copy-pasted pipelines</p>
</li>
<li><p>Hard-to-debug failures</p>
</li>
<li><p>High onboarding cost for new engineers</p>
</li>
</ul>
<p>At scale, teams aren’t managing deployments anymore. They’re managing pipeline complexity. Teams should spend time on writing good quality code, making the infra more resilient, developer-friendly so that there shouldn’t be any dependency on DevOps teams just for troubleshooting issues of getting the logs. Rather, teams are busy on making the pipeline work and managing Jenkins.</p>
<h2 id="heading-scaling-jenkins-in-kubernetes-is-not-trivial">Scaling Jenkins in Kubernetes Is Not Trivial</h2>
<p>Running Jenkins on Kubernetes introduces its own challenges:</p>
<ul>
<li><p>Agent provisioning complexity</p>
</li>
<li><p>Resource contention with production workloads</p>
</li>
<li><p>Plugin compatibility issues</p>
</li>
<li><p>Unpredictable pipeline failures</p>
</li>
<li><p>Heavy operational overhead</p>
</li>
</ul>
<p>Kubernetes scales applications naturally. Jenkins requires significant effort to scale reliably in the same environment.</p>
<p>This often results in:</p>
<ul>
<li><p>Over-provisioned clusters</p>
</li>
<li><p>Reserved capacity for CI/CD</p>
</li>
<li><p>Slower feedback loops</p>
</li>
</ul>
<p>This not only impact the delivery timelines but also cost the teams in different ways. For example, hiring more engineers just to manage the configs and files, dealing with delayed time-to-market, and much more.</p>
<h2 id="heading-security-and-access-control-become-pipeline-concerns">Security and Access Control Become Pipeline Concerns</h2>
<p>When Jenkins handles deployments:</p>
<ul>
<li><p>Kubernetes credentials are stored in Jenkins</p>
</li>
<li><p>Access control lives outside the cluster</p>
</li>
<li><p>Secrets are injected dynamically</p>
</li>
<li><p>Audit trails depend on pipeline logs and that too shallow audit trails</p>
</li>
</ul>
<p>This creates risks:</p>
<ul>
<li><p>Over-privileged credentials</p>
</li>
<li><p>Limited visibility into who deployed what</p>
</li>
<li><p>Hard-to-enforce environment boundaries</p>
</li>
</ul>
<p>In Kubernetes-native CD tools, these concerns are handled at the platform level.<br />In Jenkins, they are handled at the script level.</p>
<p>That difference matters.</p>
<h2 id="heading-jenkins-has-no-native-concept-of-application-lifecycle">Jenkins Has No Native Concept of Application Lifecycle</h2>
<p>Jenkins understands jobs and builds. Anything that is beyond that, Jenkins simply doesn’t care about it.</p>
<p>Modern applications require:</p>
<ul>
<li><p>Environment promotion</p>
</li>
<li><p>Rollback strategies</p>
</li>
<li><p>Deployment history</p>
</li>
<li><p>Health-based deployments</p>
</li>
<li><p>Multi-cluster visibility</p>
</li>
</ul>
<p>To support this in Jenkins, teams invent:</p>
<ul>
<li><p>Naming conventions</p>
</li>
<li><p>Folder structures</p>
</li>
<li><p>Parameterized jobs</p>
</li>
<li><p>Manual governance processes</p>
</li>
</ul>
<p>This works until it becomes brittle.</p>
<h2 id="heading-jenkins-is-still-great-at-ci-just-not-cd">Jenkins Is Still Great at CI; Just Not CD</h2>
<p>None of this means Jenkins should be abandoned entirely. Jenkins still plays a crucial role when it comes to deployments on VM machines, or for monolith applications. But when it comes to Kubernetes deployments, Jenkins simply is not the right choice.</p>
<p>A more sustainable approach looks like this:</p>
<p>Jenkins for CI:</p>
<ul>
<li><p>Builds</p>
</li>
<li><p>Tests</p>
</li>
<li><p>Image creation</p>
</li>
</ul>
<p>Kubernetes-native tools for CD</p>
<ul>
<li><p>Declarative deployments</p>
</li>
<li><p>GitOps workflows</p>
</li>
<li><p>Drift detection</p>
</li>
<li><p>Rollbacks</p>
</li>
<li><p>Environment management</p>
</li>
</ul>
<p>This separation reduces complexity and aligns tools with what they do best.</p>
<h2 id="heading-why-teams-are-looking-for-jenkins-alternatives">Why Teams Are Looking for Jenkins Alternatives</h2>
<p>Teams searching for Jenkins alternatives are usually not unhappy with CI.</p>
<p>They are struggling with:</p>
<ul>
<li><p>Kubernetes deployments</p>
</li>
<li><p>Operational overhead</p>
</li>
<li><p>Pipeline sprawl</p>
</li>
<li><p>Security concerns</p>
</li>
<li><p>Scaling delivery safely</p>
</li>
<li><p>Audit trails</p>
</li>
<li><p>Day-2 operations on Kubernetes</p>
</li>
<li><p>Poor visibility of workloads</p>
</li>
</ul>
<p>Platforms like <a target="_blank" href="https://devtron.ai/">Devtron</a> exist because these problems are common, not theoretical. They move deployment concerns out of pipelines and into platforms designed for Kubernetes.</p>
<p>For teams that already have significant investment in Jenkins, migration is often the hardest part. This is where structured migration approaches become useful.</p>
<blockquote>
<p>Devtron, for instance, is running a <a target="_blank" href="https://devtron.ai/jenkins-migration">Jenkins migration</a> program aimed at helping teams move legacy Jenkins pipelines toward Kubernetes-native CI/CD setups without breaking existing delivery workflows. The focus is on modernization and operability, not a rip-and-replace exercise. It offers:</p>
<ul>
<li><p>Guided Onboarding &amp; Setup</p>
</li>
<li><p>Free Devtron Enterprise for 6 months</p>
</li>
<li><p>Support 24x7 Always On</p>
</li>
</ul>
</blockquote>
<h2 id="heading-final-takeaway">Final Takeaway</h2>
<p>Jenkins helped define the Continuous Integration (CI) but Kubernetes changed how applications are deployed. Using Jenkins as a Continuous Deployment (CD) tool in Kubernetes often leads to:</p>
<ul>
<li><p>Hidden complexity</p>
</li>
<li><p>Fragile pipelines</p>
</li>
<li><p>Operational drag</p>
</li>
</ul>
<p>The question is no longer:</p>
<p>“<strong>Can Jenkins deploy to Kubernetes?</strong>”</p>
<p>It’s:</p>
<p>“<strong>Should it?</strong>”</p>
]]></content:encoded></item><item><title><![CDATA[From Cluster UI to Operational Plane: Lessons from the Kubernetes Dashboard Deprecation]]></title><description><![CDATA[The official Kubernetes Dashboard has been deprecated.
With the Kubernetes Dashboard officially deprecated, many teams are reassessing how they manage visibility and operations in Kubernetes environments and for many teams, this didn’t change much da...]]></description><link>https://devopsdiary.in/lessons-from-the-kubernetes-dashboard-deprecation</link><guid isPermaLink="true">https://devopsdiary.in/lessons-from-the-kubernetes-dashboard-deprecation</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[cloud native]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Thu, 08 Jan 2026 17:43:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/zwsHjakE_iI/upload/3ad71fdafafe83eef2ad3bb3d3e12d03.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The official Kubernetes Dashboard has been deprecated.</p>
<p>With the <a target="_blank" href="https://github.com/kubernetes/dashboard/commit/0ba796d9b85f7070dbd4a5c88354fc79f88763bb">Kubernetes Dashboard officially deprecated</a>, many teams are reassessing how they manage visibility and operations in Kubernetes environments and for many teams, this didn’t change much day-to-day. The dashboard had already faded into the background of real production workflows. But the decision itself is still worth paying attention to; not because a UI is going away, but because of what that decision reflects about how Kubernetes is operated today.</p>
<p>The original Kubernetes Dashboard was built at a time when clusters were smaller, teams were centralized, and direct interaction with cluster resources was common. A simple web interface for inspecting and modifying resources made sense.</p>
<p>That context no longer exists.</p>
<p>Kubernetes today is multi-cluster by default, driven by GitOps, guarded by strict access controls, and operated by platform teams serving dozens or hundreds of developers. In that world, a generic, cluster-scoped UI isn’t just limited, it’s misaligned.</p>
<p>The deprecation of the Kubernetes Dashboard is less a removal of functionality and more an acknowledgment: <strong>Kubernetes operations have moved up the abstraction stack.</strong></p>
<p>And that shift from <em>cluster UI</em> to <em>operational plane</em> is the real lesson here.</p>
<p>For more details about the Kubernetes Dashboard, please <a target="_blank" href="https://devtron.ai/what-is-kubernetes-dashboard">check out this article</a>.</p>
<h2 id="heading-the-deprecation-is-a-symptom-not-the-story">The Deprecation Is a Symptom, Not the Story</h2>
<p>If you’ve been running Kubernetes in production for a while, this move probably felt inevitable.</p>
<p>Many teams stopped relying on the official dashboard years ago. Not because it was “bad,” but because it was built for a very different phase of Kubernetes adoption.</p>
<p>The dashboard wasn’t deprecated because it failed. It was deprecated because the operating model outgrew it.</p>
<p>That distinction matters.</p>
<h2 id="heading-what-the-kubernetes-dashboard-was-originally-built-for">What the Kubernetes Dashboard Was Originally Built For</h2>
<p>The original Kubernetes Dashboard made perfect sense at the time.</p>
<p>It was designed for:</p>
<ul>
<li><p>A single cluster</p>
</li>
<li><p>A small group of operators</p>
</li>
<li><p>Direct, imperative actions (similar to <code>kubectl</code>)</p>
</li>
<li><p>Basic visibility into pods, services, and deployments</p>
</li>
<li><p>Minimal assumptions around RBAC and organizational boundaries</p>
</li>
</ul>
<p>In early Kubernetes adoption, this was enough. Clusters were smaller in size, teams were centralized, production workflows were simpler (although the dashboard was just an UI), it was easier to set it up and have a graphical visibility into workloads.</p>
<p>The dashboard answered one basic question well:<br /><strong>“What’s running in my cluster right now?”</strong></p>
<h2 id="heading-how-kubernetes-is-actually-operated-today">How Kubernetes Is Actually Operated Today</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767892026146/214da394-e597-4a6c-ba59-dd2528546506.gif" alt /></p>
<p>Fast forward to today, and that question is no longer sufficient.</p>
<p>Modern Kubernetes environments look very different:</p>
<ul>
<li><p>Multiple clusters across regions and environments</p>
</li>
<li><p>GitOps-first workflows, where Git is the source of truth</p>
</li>
<li><p>Helm everywhere, managing application lifecycles</p>
</li>
<li><p>Strict RBAC, often tied to SSO and org structure</p>
</li>
<li><p>Platform teams enabling developers, not operating clusters manually</p>
</li>
<li><p>Deployment state and observability matter more than raw resources</p>
</li>
</ul>
<p>In most real-world setups:</p>
<ul>
<li><p>You don’t “edit” live resources inside the cluster</p>
</li>
<li><p>You don’t want everyone to see everything</p>
</li>
<li><p>You care more about applications than individual pods</p>
</li>
<li><p>You need context across clusters, not inside just one</p>
</li>
</ul>
<p>A generic, cluster-scoped UI starts to feel out of place.</p>
<h2 id="heading-why-a-generic-cluster-ui-no-longer-works">Why a Generic Cluster UI No Longer Works</h2>
<p>This is where the original dashboard begins to break down, not functionally, but conceptually.</p>
<p>A few realities many teams ran into:</p>
<ul>
<li><p><strong>Resource-centric views don’t match how teams think</strong><br />  Developers reason in terms of applications and releases, not ReplicaSets and Services.</p>
</li>
<li><p><strong>Single-cluster visibility doesn’t scale</strong><br />  Troubleshooting modern systems requires aggregation and comparison across environments.</p>
</li>
<li><p><strong>RBAC becomes painful fast</strong><br />  “Just give dashboard access” stops working once security and compliance are involved.</p>
</li>
<li><p><strong>Drift between Git and cluster is invisible</strong><br />  The dashboard shows <em>what is</em>, not <em>what should be</em>.</p>
</li>
</ul>
<p>At that point, the dashboard becomes either read-only and underused or powerful but risky. Neither is a sustainable operational model.</p>
<h2 id="heading-what-a-kubernetes-dashboard-needs-to-be-today">What a Kubernetes Dashboard Needs to Be Today</h2>
<p><img src="https://blog.accessdevelopment.com/hs-fs/hubfs/keep%20it%20simple.jpg?width=596&amp;name=keep%20it%20simple.jpg" alt /></p>
<p>This naturally leads to a better question:</p>
<p><strong>What should a Kubernetes dashboard actually do in 2026?</strong></p>
<p>Based on how Kubernetes is used in practice, a modern dashboard should:</p>
<ul>
<li><p>Be application-aware, not just resource-aware</p>
</li>
<li><p>Work across clusters, not inside one</p>
</li>
<li><p>Be RBAC-first, not RBAC-as-an-afterthought</p>
</li>
<li><p>Understand deployments, rollbacks, and failures</p>
</li>
<li><p>Complement GitOps and automation, not bypass them</p>
</li>
</ul>
<p>At this level, the dashboard stops being a UI for cluster inspection and becomes a thin operational layer providing context, guardrails, and visibility without encouraging ad-hoc changes.</p>
<p>This is less about UI design and more about operational philosophy.</p>
<h2 id="heading-from-dashboards-to-operational-planes">From Dashboards to Operational Planes</h2>
<p>This shift explains why many teams moved away from the official dashboard long before it was deprecated.</p>
<p>They weren’t necessarily looking for “a better dashboard.” They were looking for a way to operate Kubernetes that aligned with their scale, security posture, and delivery workflows.</p>
<p>This is where Kubernetes management platforms like <a target="_blank" href="https://devtron.ai/"><strong>Devtron</strong></a> come into the picture; not as replacements for <code>kubectl</code>, and not as generic UIs, but as <strong>operational planes</strong> that sit above the cluster and becomes the orchestration layer for managing applications on Kubernetes.</p>
<p>These platforms focus on:</p>
<ul>
<li><p>Application-centric visibility</p>
</li>
<li><p>Deployment and Helm awareness</p>
</li>
<li><p>Multi-cluster context</p>
</li>
<li><p>Guardrails instead of unrestricted access</p>
</li>
<li><p>K8s-native CI/CD</p>
</li>
<li><p>Integration with GitOps (ArgoCD, FluxCD)</p>
</li>
<li><p>Security and policies preventing unintentional production downtime</p>
</li>
<li><p>Enables automation instead of writing custom scripting</p>
</li>
</ul>
<p>It represent a different generation of tooling, built for how Kubernetes is actually run today.</p>
<blockquote>
<p>Devtron is a Kubernetes Management Platform, born in Kubernetes and provides the best conventional way of operating your workloads on K8s</p>
</blockquote>
<h2 id="heading-conclusion">Conclusion</h2>
<p>The deprecation of the Kubernetes Dashboard isn’t a gap that needs to be “filled” by another UI.</p>
<p>It’s a reminder that Kubernetes is no longer operated at the level of individual resources and ad-hoc actions. As clusters, teams, and delivery pipelines scale, the center of gravity shifts from cluster inspection to <a target="_blank" href="https://devtron.ai/platform/application-management"><strong>application lifecycle management</strong></a>, from visibility to <a target="_blank" href="https://devtron.ai/platform/security-compliance"><strong>security</strong> &amp; <strong>governance</strong></a>, and from manual operations to <strong>guardrailed automation</strong>.</p>
<p>This is where Kubernetes management platforms like <strong>Devtron</strong> naturally fits in; not as dashboards in the traditional sense, but as operational planes that reflect the reality of modern Kubernetes operations.</p>
<p>The dashboard didn’t disappear.<br />It evolved; just not in the place many originally expected.</p>
]]></content:encoded></item><item><title><![CDATA[Getting Started with External Secrets Operator]]></title><description><![CDATA[Kubernetes has one of the most simple and flexible methods for storing and retrieving sensitive data in form of secrets. Kubernetes allows creating and storing of secrets such as database passwords, tokens, etc within Kubernetes namespaces. These sec...]]></description><link>https://devopsdiary.in/getting-started-with-external-secrets-operator</link><guid isPermaLink="true">https://devopsdiary.in/getting-started-with-external-secrets-operator</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[secretmanager]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Fri, 10 Feb 2023 18:21:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1676017907140/92e3cd58-d45d-4a22-9408-d2da8c4caba4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Kubernetes has one of the most simple and flexible methods for storing and retrieving sensitive data in form of secrets. Kubernetes allows creating and storing of secrets such as <code>database passwords</code>, <code>tokens</code>, etc within Kubernetes namespaces. These secrets can be retrieved in form of environment variables or from the files mounted at a certain location within the pod and then can be used in the applications. Even though the native process is seamless and easy, it has certain disadvantages.</p>
<ol>
<li><p><strong>Base64 Encodings:</strong> The default secrets encodings are base64 encoding which doesn't ensure the security of secrets stored within Kubernetes.</p>
</li>
<li><p><strong>Missing Single Source of Truth:</strong> There is no single source of truth for managing all your Kubernetes secrets in one place. It is not recommended to store secrets in static YAML files in a git repository.</p>
</li>
<li><p><strong>Lack of Vault Integrations:</strong> Kubernetes secrets don't come with any mechanisms to integrate with cloud vaults such as AWS secret manager, Azure Key Vault, etc to offer enterprise-grade protection.</p>
</li>
</ol>
<h1 id="heading-thus-kes-was-born">Thus, KES was Born!</h1>
<p>To address the above challenges, Kubernetes External Secret (KES) was born. It was created by Godaddy for their internal usages and later on open-sourced for the community. It comes with the default integration of multiple cloud-based secret stores and solves the all issues discussed above.</p>
<p>However, the GoDaddy team have stopped maintaining the project and is <a target="_blank" href="https://github.com/external-secrets/kubernetes-external-secrets">publicly archived on July 26, 2022</a>.</p>
<h1 id="heading-introducing-external-secrets-operator">Introducing External Secrets Operator</h1>
<p>External Secrets Operator (ESO) is a Kubernetes operator that helps you integrate with third-party external secrets like Hashicorp Vault, AWS Secrets Manager, Azure Key Vault, IBM Cloud Secrets Manager and many more within your Kubernetes secrets. The main objective of ESO is to synchronize secrets from external APIs into Kubernetes. It is a collection of custom API resources - <code>SecretStore</code>, <code>ExternalSecrets</code>, and <code>ClusterSecretStore</code> that helps you maintain the lifecycle of secrets from third-party vaults.</p>
<h2 id="heading-architecture">Architecture</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676007916908/99284933-2b66-4ac7-8ded-a6c006c23339.png" alt="External Secrets Operator - Architecture" class="image--center mx-auto" /></p>
<p>ESO controller is installed in a Kubernetes cluster and is a cluster-specific object. To communicate with other secret managers, the API resource - <code>SecretStore</code> / <code>ClusterSecretStore</code> is deployed within the namespace/ cluster and is responsible for the authentication with external APIs. There are different ways you can authenticate using such as generic secret (using access key &amp; secret key), IAM roles, ServiceAccount, etc that can be <a target="_blank" href="https://external-secrets.io/v0.7.2/provider/aws-secrets-manager/#secrets-manager">seen here in the documentation</a>.</p>
<p>Once authentication is done, it will create an API resource called <code>ExternalSecret</code> that is responsible for interacting with your secrets stored in vaults and then creating a secret out of the box in respective namespaces.</p>
<p>This is a high-level architecture on how ESO works. Now, let's try some hands-on.</p>
<h2 id="heading-getting-started-with-eso">Getting Started with ESO</h2>
<p>ESO installation is pretty straightforward. We need to install the ESO controller and then we are ready to get our external secrets into Kubernetes. For controller installation, we will use the helm. It is the Kubernetes package manager. For more information about helm, feel free to read the below blog.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://devopsdiary.in/all-about-helm-the-k8s-package-manager">https://devopsdiary.in/all-about-helm-the-k8s-package-manager</a></div>
<p> </p>
<p>Execute the following commands to install ESO Controller</p>
<pre><code class="lang-bash">helm repo add external-secrets https://charts.external-secrets.io

helm install external-secrets \
   external-secrets/external-secrets \
   -n external-secrets \
   --create-namespace
</code></pre>
<p>Once the controller is deployed, you can see all three pods up and running in <code>external-secrets</code> namespace as shown in the below image.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676010835223/492731eb-655f-4889-8575-58866445f55d.png" alt class="image--center mx-auto" /></p>
<p>Yayy!! The controller is up and running. It is all you need to get started with External Secrets. Now let's take the example of AWS Secrets Manager and fetch secrets from AWS and create Kubernetes secrets.</p>
<h2 id="heading-aws-secret-manager-with-eso">AWS Secret Manager with ESO</h2>
<p>Execute the following steps to create a secret in AWS Secret Manager and get it into Kubernetes using ESO.</p>
<p><strong>Step-1:</strong> Create a secret using GUI named <code>user-creds</code> with two key-value pairs, <code>username</code> &amp; <code>password</code>. Once created, you can see the dashboard something like this -</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676012672398/639e698c-f4c0-4557-b16d-1e9fbfd9a0b3.png" alt class="image--center mx-auto" /></p>
<p><strong>Step-2:</strong> Let's now create a generic secret with an <code>access key</code> and <code>secret access key</code> that would be used by <code>SecretStore</code> for authentication. Execute the below command to create a secret.</p>
<p>[Note: Make sure KeyId &amp; SecretKey generated should have access to the secrets manager]</p>
<pre><code class="lang-bash"><span class="hljs-built_in">echo</span> -n <span class="hljs-string">'KEYID'</span> &gt; ./access-key
<span class="hljs-built_in">echo</span> -n <span class="hljs-string">'SECRETKEY'</span> &gt; ./secret-access-key
kubectl create secret generic awssm-secret --from-file=./access-key --from-file=./secret-access-key -n external-secrets
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676013299099/4c236db7-df7a-4ec8-9a82-9d00c84a5f22.png" alt class="image--center mx-auto" /></p>
<p><strong>Step-3:</strong> Create <code>SecretStore</code> uses the generic secret for authentication. Execute the following manifest to create <code>SecretStore</code> named <code>cncf-thane-demo</code></p>
<pre><code class="lang-bash">cat &lt;&lt;EOF | kubectl apply -f - 
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
  name: cncf-thane-demo
  namespace: external-secrets
spec:
  provider:
    aws:
      service: SecretsManager
      region: us-east-1
      auth:
        secretRef:
          accessKeyIDSecretRef:
            name: awssm-secret
            key: access-key
          secretAccessKeySecretRef:
            name: awssm-secret
            key: secret-access-key
EOF
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676014614755/4af8be48-664f-4ce1-85d8-7ad7e6f9923b.png" alt class="image--center mx-auto" /></p>
<p><strong>Step-4:</strong> Now create a <code>ExternalSecret</code> would fetch the secrets from the AWS secrets manager and bring them to Kubernetes. Execute the following manifest to create <code>ExternalSecret</code> named <code>cncf-thane-demo</code> and provide the necessary details to fetch secrets.</p>
<pre><code class="lang-bash">cat &lt;&lt;EOF | kubectl apply -f - 
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: cncf-thane-demo
  namespace: external-secrets
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: cncf-thane-demo
    kind: SecretStore
  target:
    name: eso-secret
    creationPolicy: Owner
  data:
  - secretKey: credentials
    remoteRef:
      key: user-creds
      property: username
EOF
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676015822604/02b47c51-4be7-4ee1-9f84-b589eea2905d.png" alt class="image--center mx-auto" /></p>
<p>After <code>ExternalSecrets</code> being deployed, you can check the secret it created. In our case, it has created a secret named <code>eso-secret</code> that we have specified in <code>ExternalSecret</code> manifest. Let's now check if we get the value of the username key that we have added in the secrets manager.</p>
<pre><code class="lang-bash">kubectl get secrets eso-secret -nexternal-secrets -o jsonpath=<span class="hljs-string">'{.data.credentials}'</span> | base64 -d
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676016670424/f6d0235c-f3e7-446c-9843-925375f33966.png" alt class="image--center mx-auto" /></p>
<p>Hurray!! We have successfully fetched the value from AWS Secret Manager and imported it into Kubernetes secrets using ESO. We can also use ESO to get multiple secrets or even the plan text secrets into Kubernetes in a similar fashion.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>In this blog post, we have seen the need for an External Secrets Operator, KES and how to get started with ESO to fetch secrets from AWS Secrets Manager. Feel free to connect with me on <a target="_blank" href="https://twitter.com/abhinavd26">Twitter</a> and <a target="_blank" href="https://www.linkedin.com/in/abhinavd26/">LinkedIn</a> and ask your questions if you have any.</p>
]]></content:encoded></item><item><title><![CDATA[Empowering Developers with Kubernetes Deployments]]></title><description><![CDATA[Kubernetes has been one of the most adopted technologies in the last couple of years. According to the 2021 Cloud Native Survey conducted by “The Cloud Native Computing Foundation” where they received around 3,829 responses overall, around 96% of the...]]></description><link>https://devopsdiary.in/empowering-developers-with-kubernetes-deployments</link><guid isPermaLink="true">https://devopsdiary.in/empowering-developers-with-kubernetes-deployments</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Devops]]></category><category><![CDATA[devtron]]></category><category><![CDATA[Developer Tools]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Sat, 17 Dec 2022 16:48:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671294883109/CjcngNTpE.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Kubernetes has been one of the most adopted technologies in the last couple of years. According to the <a target="_blank" href="https://www.cncf.io/reports/cncf-annual-survey-2021/">2021 Cloud Native Survey</a> conducted by “<strong>The Cloud Native Computing Foundation</strong>” where they received around 3,829 responses overall, around 96% of the organization is using/evaluating Kubernetes. According to SlashData reports, 5.6 million developers are using Kubernetes worldwide, representing 31% of all backend developers.</p>
<p>But, Is Kubernetes a forte of Developers? The answer is No! Developers are not meant to learn Kubernetes concepts, commands, etc and deploy their applications over Kubernetes. Enforcing developers to do what they are not meant to be doing may result in -</p>
<ul>
<li><p>Delayed delivery of applications</p>
</li>
<li><p>Decreased productivity</p>
</li>
<li><p>Unnecessary Stress &amp; Burnouts</p>
</li>
</ul>
<p>Now the question arises, how to empower developers with Kubernetes deployments?</p>
<h2 id="heading-can-developers-deploy-on-kubernetes">Can Developers Deploy on Kubernetes?</h2>
<p>Yes, Developers can deploy on Kubernetes!</p>
<p>Developers require an abstraction over the infrastructure layer, which should be a unified platform where they can deploy their code in different environments without being proficient in the domain. The platform should have the following features to empower Developers with deployments -</p>
<ul>
<li><p>Unified Dashboard for all the operations</p>
</li>
<li><p>Debugging &amp; Observability capabilities</p>
</li>
<li><p>Handy enough to operate with no/bare-min knowledge in k8s</p>
</li>
<li><p>Capability to build images from multiple branches, tags, PR, etc</p>
</li>
<li><p>Easy to integrate and run test cases, check code quality, etc</p>
</li>
<li><p>Deploy on multiple environments without writing/learning k8s manifests</p>
</li>
<li><p>Quick CI/CD setup</p>
</li>
</ul>
<p>These are some of the features that a platform should have to empower its Developers. With these abstractions, a developer only needs to know about the branches on which he/she is working, and the rest of the thing will be handled by the platform itself.</p>
<p>Now another question arises, why exactly do we need such a platform when you already have Kubernetes CLI and dashboards?</p>
<h2 id="heading-why-a-unified-platform">Why a Unified Platform?</h2>
<p>When it comes to deploying your application quickly to a production or dev environment, then Kubernetes makes it really complex to handle that.</p>
<p>E.g. say you're a developer, and you are working on an application, for testing this out you may need a lot of things to be set in prior.</p>
<p>Here are some of the things you'll need -</p>
<ul>
<li><p>A Dockerfile to containerize your application</p>
</li>
<li><p>You need to push that container image to a registry</p>
</li>
<li><p>You will create a pod or deployment manifest for Kubernetes</p>
</li>
<li><p>You will apply those manifest in your cluster with kubectl</p>
</li>
<li><p>You will expose those deployments application with the help of a service</p>
</li>
<li><p>Sometimes if you're working with manifests then it may grow in complexity when you start including probes like startup, readiness, and liveness probes.</p>
</li>
</ul>
<p>This all sounds easy to perform, but in between if any one of the steps gets broken then the whole cycle will be messed up. You need everything in between to work properly, and then only you will be able to see your application on a given port. In fact, before going ahead with these steps, you should be proficient in Kubernetes concepts, container registries and cloud concepts which is again not a forte of developers. These are certain things that a developer doesn’t know and learning all these things will take a lot of time which will affect the entire software development process. Now how do we streamline the process? Which platform you can use to improve productivity?</p>
<p>The answer is <a target="_blank" href="http://github.com/devtron-labs/devtron">Devtron</a>! It is a CI/CD platform for Kubernetes that helps you build, test, deploy and debug your applications across the software development lifecycle.</p>
<h3 id="heading-simplifying-kubernetes-deployments-with-devtron">Simplifying Kubernetes Deployments with Devtron</h3>
<p>Generally, Developers write their code on their favourite editor, and they will automate the testing covering the edge cases. For testing across the organization one needs to set up automated testing so that whenever a new commit is pushed, the automated testing gets triggered.</p>
<p>Devtron greatly simplifies automated testing for developers. They can easily configure it while creating a build pipeline using the pre-build stage, during the build stage and post-build stage. Devtron comes with some default plugins such as <strong>k6</strong> for load testing, <strong>Sonarqube</strong> for code-quality checks, etc. For more details about the plugins, please refer to the <a target="_blank" href="https://docs.devtron.ai/usage/applications/creating-application/deployment-template">documentation</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675339386897/998faa67-1d50-4556-8ad9-37e82104a42b.png" alt="CI-Build Stage" /></p>
<p>With Devtron, developers can easily deploy on the top of the Kubernetes cluster with the help of an intuitive Devtron dashboard. It allows you to easily build, test, deploy and debug your applications through the Devtron interface itself. Apart from these, it also provides you with a lot of flexibility to easily integrate any of your existing stacks like Kibana for logs, with applications deployed through Devtron.</p>
<p>The main benefit here is that you don't have to worry about Kubernetes manifests.</p>
<p>Most of the time, a developer who writes code and works on a feature doesn't want/doesn't know how to write a Kubernetes manifest. Devtron simplifies deployments with ready-to-deploy templates that can be easily configured by the developer just by tweaking some values as per the need and are ready to go. To know more about the Deployment Template, feel free to check out the <a target="_blank" href="https://docs.devtron.ai/usage/applications/creating-application/deployment-template">documentation</a>.</p>
<blockquote>
<p><strong>Pro-tip:</strong> You don’t have to be an expert with yamls and k8s configs as Devtron provides you with the README of the template where you can learn about all the parameters and how to use it.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675339490656/a09cc61a-407f-4a45-b88e-1ff759e7a0b4.png" alt="Deployment Template" class="image--center mx-auto" /></p>
<h2 id="heading-what-about-debugging-andamp-logging">What about Debugging &amp; Logging?</h2>
<p>One of the most important features that a platform can offer is the ability to debug and check out the logs in real-time. With Devtron, it becomes really easy to check out the logs of micro-services deployed or helm charts deployed. It comes with a default log analyzer which helps you to check out the combined logs of all containers in a particular micro-service.</p>
<p>Devtron also empowers you to easily debug your applications with the features such as - <strong>exec into containers</strong>, <strong>check out events, logs of per pods, application metrics, etc.</strong> Here’s a quick sneak-peak into the debugging capabilities of Devtron.</p>
<h3 id="heading-observability">Observability</h3>
<p>It enables you to easily check out the CPU usage, Memory usage, Throughput and Latency of the micro-services. For more detailed information on the k8s workloads, just hover over the resource and you would be able to see the options for Manifest, Events, Logs and Terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675340820966/bcc98f29-1d50-46e6-9ecd-d37c9a374d6c.png" alt="App Details Metrics" class="image--center mx-auto" /></p>
<p>To expand the details, just click on any of the options available and you will be able to see the entire manifest of the pod, or events if any, logs of the pod and also Devtron enable you to easily get into the container and debug the applications for any issues.</p>
<h3 id="heading-kubernetes-manifest"><strong>Kubernetes Manifest</strong></h3>
<p>Devtron provides you with the easiest possible way to check the manifests of all Kubernetes workloads deployed in that particular microservice.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675340952391/a35179ef-4e0a-4563-b481-10b42191090c.png" alt="Kubernetes Manifest from Devtron" class="image--center mx-auto" /></p>
<h3 id="heading-exec-into-container"><strong>Exec into Container</strong></h3>
<p>The tool also allows users to exec into pods if required for debugging and all that from the intuitive user interface. Users don't have to provide cluster terminal access as everything can be managed by Devtron.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675341104141/313a0950-3a1b-4e07-ab10-1b57e2335aaa.png" alt="Exec into Pods" class="image--center mx-auto" /></p>
<p>So these are some of the functionalities of Devtron that can help you empower your Developers with Kubernetes Deployments. There are a lot more features that Devtron offers to manage the entire software development lifecycle, helping out Developers and DevOps accelerate their journey of k8s and improve their productivity.</p>
<p>Check out the blog <a target="_blank" href="https://devtron.ai/blog/how-to-deploy-mern-stack-over-kubernetes/">for more insights on how to deploy applications with Devtron</a>. Feel free to connect with me on <a target="_blank" href="https://twitter.com/abhinavd26">Twitter</a> and <a target="_blank" href="https://www.linkedin.com/in/abhinavd26/">LinkedIn</a> if you have any questions.</p>
]]></content:encoded></item><item><title><![CDATA[Deploying a custom Mongodb operator using Helm Charts]]></title><description><![CDATA[Building a Helm chart and managing it, are two different aspects of packaging an application for Kubernetes. Helm is efficient enough to package a complex K8s application and deploy it. When it comes down to app management, there are certain challeng...]]></description><link>https://devopsdiary.in/deploying-a-custom-mongodb-operator-using-helm-charts</link><guid isPermaLink="true">https://devopsdiary.in/deploying-a-custom-mongodb-operator-using-helm-charts</guid><category><![CDATA[Helm]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[devtron]]></category><category><![CDATA[MongoDB]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Tue, 28 Jun 2022 11:00:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671353917442/OT_wuaamt.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Building a Helm chart and managing it, are two different aspects of packaging an application for Kubernetes. Helm is efficient enough to package a complex K8s application and deploy it. When it comes down to app management, there are certain challenges with Helm. In this short blog, we will see how easy it is to deploy and manage a custom mongodb chart using Devtron.</p>
<p>So, let’s get started</p>
<p>If you are not aware of Helm, please have a read of my previous blog for detailed understanding of Helm charts.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://devopsdiary.hashnode.dev/all-about-helm-the-k8s-package-manager">https://devopsdiary.hashnode.dev/all-about-helm-the-k8s-package-manager</a></div>
<p><strong>[Note: The only prerequisite of getting started with Devtron is to have a Kubernetes cluster]</strong></p>
<h2 id="heading-adding-helm-repository">Adding Helm repository</h2>
<p>Devtron comes with a number of pre-added, commonly used Helm charts that can be seen in the <code>Charts</code> section. But if you want to install your custom chart, let's say MongoDB, it can be easily achieved using Devtron.</p>
<p>To add any custom chart, go to <code>Global Configurations</code> → <code>Chart Repository</code> → <code>Click on Add Repository</code> → <code>Click Save</code>  → <code>Click on Refresh Charts</code></p>
<p><strong>[Note: If you do not see any charts in Charts section, click on Refresh Charts to sync all the charts from added repositories]</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1657915358617/m9q0srvS3.png" alt="add-repository" /></p>
<h2 id="heading-deploying-helm-charts">Deploying Helm charts</h2>
<p>Now that we have added our custom chart repository i.e, <code>percona</code>, let’s deploy it.</p>
<p>To deploy any chart through Devtron, goto <code>Charts</code> → <code>Click on Chart to Deploy</code> → <code>Click Deploy</code>  → <code>Change Values as per required</code> → <code>Click Deploy Chart</code></p>
<p>For instance, I want to deploy Percona's MongoDB operator. Let’s see how we can deploy it with just a few clicks.</p>
<p><strong>Step-1:</strong> Select the chart to deploy i.e, <code>percona/psmdb-operator</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1657915360476/hL3xOjiZz.png" alt="chart-store" /></p>
<p><strong>Step-2:</strong> Click on Deploy to edit default values as per your requirements.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1657915362316/tCeIV9USu.png" alt="edit-default-values" /></p>
<p><strong>Step-3:</strong> Edit the default configuration and click on Deploy Chart. You can also see the description for all the parameters, from the sidebar - README of the particular chart.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1657915364413/zQgexl2OM.png" alt="chart-values-and-readme" /></p>
<p><strong>Step-4:</strong> Congratulations, you have successfully deployed! You can see all the details of your deployed chart such as current status, different workloads, manifests, events, logs, deployment history, etc within Devtron dashboard itself.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1657915366474/WNgv_x1im.png" alt="chart-details" /></p>
<p>Reach out to us through the <a target="_blank" href="https://discord.devtron.ai/">Discord</a> channel and refer to <a target="_blank" href="https://docs.devtron.ai/hyperion/hyperion">Devtron</a> documentation, to find all the features of Devtron.</p>
]]></content:encoded></item><item><title><![CDATA[Decrease your Organization's Carbon footprints using Kubernetes]]></title><description><![CDATA[If you are running micro-services these days there is a high probability that you're running it on a cloud provider like AWS, GCP, MS Azure etc. The services of these cloud providers are powered by data centres, which typically comprise tens to thous...]]></description><link>https://devopsdiary.in/decrease-your-organizations-carbon-footprints-using-kubernetes</link><guid isPermaLink="true">https://devopsdiary.in/decrease-your-organizations-carbon-footprints-using-kubernetes</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Carbon]]></category><category><![CDATA[Developer]]></category><category><![CDATA[devtron]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Fri, 29 Apr 2022 20:29:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671297854598/kvPTKDEyk.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you are running micro-services these days there is a high probability that you're running it on a cloud provider like AWS, GCP, MS Azure etc. The services of these cloud providers are powered by data centres, which typically comprise tens to thousands of interconnected servers and consume a substantial amount of electrical energy. It is estimated that data centres will use anywhere between 3% and 13% of global electricity by the year 2030 and henceforth will be responsible for a similar share of carbon emissions. This post will step through an example with a case study of how to use Kubernetes to minimize the amount of carbon in the atmosphere that your Organization's infrastructure is responsible for.</p>
<h2 id="heading-carbon-footprint">Carbon Footprint</h2>
<p>What exactly is Carbon Footprint? It is the total amount of greenhouse gases (carbon dioxide, methane, etc) released into the atmosphere due to human interventions. Sounds familiar, isn’t it? We all have read about the different ways greenhouse gases get released into the atmosphere and the need to prevent it.</p>
<p>But why are we talking about it in a technical blog? And how can Kubernetes help to reduce your organization's Carbon footprint?</p>
<p>In the era of technology, everything is hosted on cloud servers, which are backed by massive data centers. In other words, we can say data centers are the brain of the internet. Right from the servers to storage blocks, everything is present in these Data Center.</p>
<p>All the machines in the data centers requires energy to operate, i.e, electricity. Irrespective of the source of generation, renewable or nonrenewable. According to a survey conducted by <a target="_blank" href="https://www.agci.org/">Aspen Global Change Institute</a>, data centers account for being one of the direct contributors of climate change due to the release of greenhouse gases. According to an article by <a target="_blank" href="https://energyinnovation.org/2020/03/17/how-much-energy-do-data-centers-really-use/">Energy Innovation</a>, a large data center may contain around tens of thousands of hardware and can use around 100 megawatts (MW) of electricity.</p>
<p>But again, how does using another technology i.e, Kubernetes can contribute to this? Before answering the above question let’s learn how to calculate the carbon footprint of a server that we usually create with a public cloud provider like aws. In AWS, we create Instances of different sizes, computation power, storage capacity, etc as per our needs. Let’s calculate the carbon footprint emitted by initializing an instance of type - m5.2xlarge in region - ap-south-1 which runs for 24 hours.</p>
<p>We can calculate the Carbon Footprint, by using the <a target="_blank" href="https://engineering.teads.com/sustainability/carbon-footprint-estimator-for-aws-instances/?estimation=true&amp;instance_id=2310&amp;region_id=2238&amp;compute_hours=24#calculator">Carbon Footprint Estimator for AWS instances</a>. As you can see in the below image, after giving the values, we can easily estimate the carbon footprint for the respective instance which is 1,245.7 gCO₂eq.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1651263786373/dwQlmnccY.png" alt="carbon-footprint" /></p>
<h2 id="heading-factors-considered-while-calculating">Factors Considered while Calculating</h2>
<p>There are primarily two factors which contribute to carbon emissions in the Compute Resource carbon footprint analysis, which are discussed as below -</p>
<ul>
<li><p><strong>Carbon emissions related to running the instance, including the data center PUE</strong> Carbon emissions from electricity consumed is the major source of carbon footprint in the Tech Industry. The <a target="_blank" href="https://docs.google.com/spreadsheets/d/1DqYgQnEDLQVQm5acMAhLgHLD8xXCG9BIrk-_Nv6jF3k/edit#gid=504755275">AWS EC2 Carbon Footprint Dataset</a> available is used for the calculation of Carbon emissions on the basis of how much wattage is used on various CPU consumption levels.</p>
</li>
<li><p><strong>Carbon emissions related to manufacturing the underlying hardware</strong> Carbon emissions from manufacturing of hardware components is another major contributor when it comes to carbon footprint calculations within the scope of this study.</p>
</li>
</ul>
<h2 id="heading-how-kubernetes-can-help">How Kubernetes can help?</h2>
<p>Kubernetes is one of the most adopted technologies. As per the survey by <a target="_blank" href="https://www.purestorage.com/content/dam/pdf/en/analyst-reports/ar-portworx-pure-storage-2021-kubernetes-adoption-survey.pdf">Portworx</a>, 68% of the companies have increased the usages of Kubernetes and IT automation and the adoption metrics is still increasing. For any application to be deployed over kubernetes, we need to create a kubernetes cluster which comprises any number of master and worker nodes. These are nothing but instances/servers which are being initialized where all the applications will be deployed. The number of nodes keep on increasing as the load increases which eventually will contribute more and more to the Carbon footprint. But with the help of Kubernetes Autoscaling, we can lower down the count of nodes i.e, reduce the number of instances created as per the requirements.</p>
<p>Let’s try to understand it with a use-case.</p>
<p>A logistic company uses Kubernetes in their production to deploy all their micro-services. A single micro-service requires around 60 replicas which initializes around 20 instances of type - m5.2xlarge in region ap-south-1. If we calculate the Carbon Footprint of a single micro-service in 24 hours, it would be around <strong>24,914 gCO₂eq</strong>. This is the amount of carbon footprint emitted just by a single micro-service for 24hrs, and there are thousands of micro-services in a well-versed organization which runs 24*7. Now if you are wondering how this can be reduced. Well you are at the right place.</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4cmwwn6mhub5s5ojsua1.png" alt="throughput-metrics-based-autoscaling" /></p>
<p>The maximum traffic that a logistic company's First mile / Last mile app experiences is during the day-time, when the deliveries happen. Generally, from morning around 8:00 AM, there’s a steep increase in the traffic and it experiences its peak in afternoon hours. That's when it would have the most number of pod replicas and nodes/instances. Then post 8:00 PM the traffic decreases spontaneously. During the off hours, when the traffic decreases, the count of replicas also drops to 6 from an average of 60 for each micro-service, which requires only 2 nodes/instances. The micro-service uses throughput metrics based horizontal pod auto scaling using Keda. Now if we talk about the carbon emissions by 1 micro service after deploying it on Kubernetes paired with horizontal pod auto-scaling, it would drop to around -</p>
<p><strong>51.9 gCO₂eq x 2 (nodes) x 12 (hrs 8pm to 8am non-peak hours) + 51.9 gCO₂eq x 20 (nodes) x 12 (hrs 8am to 8pm peak traffic hours) = 13,701.6 gCO₂eq</strong></p>
<p><strong>51.9 gCO₂eq x 20 (nodes) x 24 (hrs no autoscaling) = 24,912 gCO₂eq</strong></p>
<p>That's a whooping <strong>11,211 gCO₂eq (45% reduction)</strong> in carbon emissions [1], and this is just by 1 micro-service in 24hrs. Which translates to <strong>4092 KgCo2eq</strong> per year! For the reference of how much this is, a Boeing 747-400 releases about <strong>90 KgCo2eq</strong> per hour of flight when it covers around 1000 Kms [2].</p>
<p>Now think of how much your organization is capable to reduce per year by migrating 1000s of micro-services on Kubernetes paired with efficient autoscaling.</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pcnu2ilgoiuvwlfc9gbm.gif" alt="wao-meme" /></p>
<h2 id="heading-migrating-to-kubernetes">Migrating to Kubernetes?</h2>
<p>Kubernetes is the best container orchestration technology out there in the cloud native market but the learning curve for adopting Kubernetes is still a challenge for the organizations looking to migrate to Kubernetes. There are a many Kubernetes specific tools out there in marketplace like ArgoCD, Flux for deployments, Prometheus and Grafana for monitoring, Argo workflows for creating parallel jobs etc. Kubernetes space has so many options but they need to be configured separately, which again has it's own complexities.</p>
<p>That's where <a target="_blank" href="https://github.com/devtron-labs/devtron">Devtron</a> helps you, Devtron stack configures and integrates all these tools that you would have to otherwise configure separately and let's you manage everything from one stunning dashboard. Devtron is an open source software delivery workflow for Kubernetes. Devtron is trusted by thousands of users and giants like <a target="_blank" href="https://www.delhivery.com/">Delhivery</a>, <a target="_blank" href="https://www.bharatpe.com">Bharatpe</a>, <a target="_blank" href="https://www.livspace.com/in">Livspace</a>, <a target="_blank" href="https://www.moglix.com/">Moglix</a> etc and has a broad range of community all across the globe. And the best thing is, it gives you a no-code Kubernetes deployment experience which means there's no need to write Kubernetes yamls at all.</p>
<p>Devtron is also running an initiative <a target="_blank" href="https://devtron.ai/support.html">#AdoptK8sWithDevtron</a> where they are offering expert assistance and help to first 100 organizations to migrate their micro-services to Kubernetes.</p>
<p>[1] When compared to micro-services which are not configured to scale efficiently.</p>
<p>[2] Ref: https://catsr.vse.gmu.edu/SYST460/LectureNotes_AviationEmissions.pdf</p>
]]></content:encoded></item><item><title><![CDATA[All About k3s - Lightweight Kubernetes]]></title><description><![CDATA[Kubernetes is an open source container-orchestration tool which is widely used in the industry for automating application deployments, auto-scaling and management. Creating a Kubernetes(k8s) cluster is quite a tedious task. But its not anymore if usi...]]></description><link>https://devopsdiary.in/all-about-k3s-lightweight-kubernetes</link><guid isPermaLink="true">https://devopsdiary.in/all-about-k3s-lightweight-kubernetes</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[k8s]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[technology]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Sat, 26 Mar 2022 14:35:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1648295898753/G98dTA8fg.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Kubernetes is an open source container-orchestration tool which is widely used in the industry for automating application deployments, auto-scaling and management. Creating a Kubernetes(k8s) cluster is quite a tedious task. But its not anymore if using <a target="_blank" href="https://k3s.io/">k3s - Lightweight Kubernetes</a>. Just within few commands your cluster is up and running. Let's dig a little deeper.</p>
<h2 id="heading-k3s-andamp-its-history">K3s &amp; its History</h2>
<p>K3s is an opensource, lightweight distribution of Kubernetes which is packaged all in a binary less than 100mb. It was initially launched as component of <a target="_blank" href="https://rio.io/">Rio</a>, an experimental project launched by Rancher Labs, but due to its efficiency and high demand, they launched it as a separate open source project. K3s was officially launched on 26 Feb, 2019. It has been seen a great success of k3s in Edge, IoT, CI, Development, ARM and Embedding K8s. It can be installed as single node as well as multi-node cluster and is fully conformant production-ready Kubernetes distribution.</p>
<h2 id="heading-k3s-architecture">K3s Architecture</h2>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3gnhrr47wz37wpjsy6c.png" alt="architecture" /></p>
<p>The above image shows the basic architecture of k3s. You can observe that in case of k3s we have two major components, <code>k3s server</code> and <code>k3s agent</code> as like of <code>master node</code> and <code>worker node</code> in k8s. In both <code>server</code> and <code>agent</code>, all other components combined together run as a single process which makes it really lite-weighted unlike in k8s where each component runs as a individual process. In fact in case of single node cluster, both the <code>server</code> and <code>agent</code> can run as a single process in a single node which helps to spin up the cluster within 90s. Most of the components are similar to that used in k8s and their functionalities are also pretty much similar as that of in k8s except <code>SQLite</code>, <code>Tunnel Proxy</code> and <code>Flannel</code> which are introduced in k3s. For detailed understanding of the individual components please have a look at <a target="_blank" href="https://kubernetes.io/docs/concepts/overview/components/">k8s documentation</a>. Talking about <code>SQLite</code>, it is a replacement of <code>etcd</code> which is used in k8s, and removing dependency from <code>etcd</code> allowed running single node cluster with <code>SQLite</code> but its only in case of single node. K3s uses external databases in case of HA k3s cluster. Coming to <code>Tunnel Proxy</code>, basically <code>kube-proxy</code> uses a number of ports for connecting with <code>api-server</code>, but in case of k3s, it connects to <code>api-server</code> with the help of <code>tunnel proxy</code>. Behind the scene, <code>tunnel proxy</code>creates a uni-directional connection to reach out <code>api-server</code> but once the connection is established, bi-directional communication is enabled and this makes a more secure connection by using single port for communication. For cluster networking, <code>Flannel</code> can be seen in the picture which is used as Container Network Interface(CNI) in k3s. So this is a general insight of k3s architecture. For more detailed information please refer to <a target="_blank" href="https://rancher.com/docs/k3s/latest/en/architecture/">documentation</a>.</p>
<h2 id="heading-cluster-setup-using-k3s">Cluster Setup using k3s</h2>
<p>Setting up a Kubernetes(k8s) cluster is quite a hectic task but not in the case of k3s. We can easily set up the k3s single node or multi node clusters just within few commands. In this blog, we will discover both the methods starting with single node setup.</p>
<h3 id="heading-single-node-cluster">Single Node Cluster</h3>
<p>Creating a single node k3s cluster or setting up k3s server is just a piece of cake. We just need deploy a single command and it will create k3s server for you. Please execute the following command -</p>
<pre><code class="lang-plaintext">curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644
</code></pre>
<p>In the above command, we have used an extra flag i.e, <code>--write-kubeconfig-mode</code>. Basically by default the KUBCECONFIG file which is located at <code>/etc/rancher/k3s/k3s.yaml</code> have only read permissions for root user. So we need to make it readable for other users as well (the recommended method). That's all, we have successfully setup our k3s single node cluster.</p>
<h3 id="heading-multi-node-cluster">Multi Node Cluster</h3>
<p>Setting up multi node cluster is also very simple in k3s. We can have as many no. of worker nodes for our master in just few commands. Please follow the steps to configure your High Availability(HA) production grade k3s cluster. Step-1. Firstly we need to set up the server as we did in case of single node cluster by using the same command -</p>
<pre><code class="lang-plaintext">curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644
</code></pre>
<p>Step-2. After that, from the below command, we need to find the node-token, which will be further used by the k3s-agent to add as many worker nodes you want for your cluster.</p>
<pre><code class="lang-plaintext">sudo cat /var/lib/rancher/k3s/server/node-token
</code></pre>
<p>Step-3. The next command is used to create a k3s-agent for the master node which we set up from the above command and we will use the Server IP and node-token extracted from the master node. Please replace <code>my-server</code> and <code>node-token</code> from the master node IP and token which we generated from the above command. Please execute the following command in a separate instance/system to make it worker node for the master created.</p>
<pre><code class="lang-plaintext">curl -sfL https://get.k3s.io | K3S_URL=https://my-server:6443 K3S_TOKEN=node-token sh -
</code></pre>
<p>Bingo! We have successfully set up the HA production grade k3s cluster. Now we are ready to begin with our deployments on k3s cluster.</p>
<p>Now, after we understood different ways of setting up the cluster, let's see the advantages of using k3s and does it really used by the industry?</p>
<h2 id="heading-benefits-of-k3s">Benefits of k3s</h2>
<ul>
<li><p>Quick Installation,</p>
</li>
<li><p>Less Resources Required,</p>
</li>
<li><p>Easy to setup cluster,</p>
</li>
<li><p>Smaller in size,</p>
</li>
<li><p>Very easy to add/remove nodes, etc. These are some of the advantages of having k3s clusters. Now the question arises, Is it really used in the Industry?</p>
</li>
</ul>
<h2 id="heading-companies-using-k3s">Companies using k3s</h2>
<p>Due to its easy configurations and flexible nature as it can support something with as small as <code>Raspberry Pi</code> or something as large as an <code>AWS a1.4xlarge 32GiB server</code>, it is highly adopted by organizations in their production. Some of the companies using k3s are -</p>
<ul>
<li><p><a target="_blank" href="https://www.civo.com/">Civo</a> - The cloud native service provider</p>
</li>
<li><p><a target="_blank" href="https://www.qubitro.com/">Qubitro</a> - IoT platform to design and develop IoT projects.</p>
</li>
<li><p><a target="_blank" href="https://loyaltyharbour.com/">LoyaltyHarbour</a> - Provide support for eCommerce stores.</p>
</li>
<li><p><a target="_blank" href="https://www.twave.io/">TWave</a> - Condition Monitoring Systems</p>
</li>
<li><p><a target="_blank" href="https://github.com/lunarops">Lunar Ops, Inc</a> - DevOps as a Service company based in Bronx, NY</p>
</li>
</ul>
<p>So, these are few of the companies using k3s in their production.</p>
<p>I hope the blog was worth of your precious minutes you invested. Feel free to like, share and comment down your thoughts about the blog.</p>
]]></content:encoded></item><item><title><![CDATA[All About Helm, The K8s Package Manager]]></title><description><![CDATA[Helm is one of the most powerful and community adopted Kubernetes Package manager used in industry. It is used to install and manage all the Kubernetes application. In laymen language, think of it as npm or pip for Kubernetes. Helm deploys all the k8...]]></description><link>https://devopsdiary.in/all-about-helm-the-k8s-package-manager</link><guid isPermaLink="true">https://devopsdiary.in/all-about-helm-the-k8s-package-manager</guid><category><![CDATA[Kubernetes]]></category><category><![CDATA[Devops]]></category><category><![CDATA[k8s]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Thu, 24 Mar 2022 19:47:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1648150493123/pwrVmSRKQ.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="https://helm.sh">Helm</a> is one of the most powerful and community adopted Kubernetes Package manager used in industry. It is used to install and manage all the Kubernetes application. In laymen language, think of it as <code>npm</code> or <code>pip</code> for Kubernetes. Helm deploys all the k8s applications in a packaging format called helm charts. It is used to install, upgrade, delete even the most complex Kubernetes applications. Now let's try to understand why do we even need helm charts at the first place?</p>
<h2 id="heading-need-of-helm-charts">Need of Helm Charts</h2>
<p>Kubernetes provides a command line utility called, <code>kubectl</code> which is efficient enough to deploy, inspect, update, delete, your Kubernetes resources. All the k8s resources are defined in YAML files and can be deployed, update, etc by using <code>kubectl</code>. But then why the hell we need helm charts? Let's try to understand this with an example.</p>
<p>For instance you have a Kubernetes application which have different resources say, deployment, service, service account, role, role-binding, configmap, secret and ingress. Now we need to deploy all these resources in our cluster. Either we can use <code>kubectl apply -f Yamls</code> command to deploy all resources present in <code>Yamls</code> directory, or we can use helm charts. If we are using yamls, then for any new resource, we need to create a new yaml file and then deploy it. In this case, eventually we will have to write multiple yaml files, each for different resource. But this is not the case with helm charts.</p>
<p>Helm charts packages all the different resources of your k8s application in an organized way. It contains a directory called <code>templates</code> where all the different resources are defined which needs to be deployed. The environment variables and deployment-specific parameters are extracted out and put in a separate file called <code>Values.yaml</code> which can be configured every-time you deploy the chart. The advantage of doing so is that you can deploy it to different clusters and even in different environments say, development, staging or production environment without creating the whole chart again.</p>
<p>So, this one of the major advantage of using helm. If you still have doubts, don't worry. We will create a chart from scratch and deploy it on a k8s cluster.</p>
<h2 id="heading-getting-started">Getting Started</h2>
<p>Installing and creating helm charts are quite straight-forward. You can always refer to their <a target="_blank" href="https://helm.sh/docs/intro/install/">installation-docs</a> for installation as they provide a rich documentation to install helm in different distributions. For this example, we will be using script to install helm. Please execute the below commands -</p>
<ul>
<li>First we need to download the script in our machine<pre><code class="lang-bash">curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
</code></pre>
</li>
<li>Now we need to give execute permission to the shell script<pre><code class="lang-bash">chmod 700 get_helm.sh
</code></pre>
</li>
<li>Finally need to execute it which will install helm in your system<pre><code class="lang-bash">./get_helm.sh
</code></pre>
Great. We are done with installing helm in our system. To verify the installation please run - <code>helm version --short</code>
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfhlsb57bfnmb023bgxz.jpg" alt="helm-version" />
If you could see the version, the installation is successful.</li>
</ul>
<h3 id="heading-create-your-first-helm-chart">Create Your First Helm Chart</h3>
<p>As we have successfully installed helm in our system, its time to create our own helm chart and deployed a Kubernetes application. We will be creating a chart for a simple go application which can be cloned from <a target="_blank" href="https://github.com/devtron-labs/demo-go-app.git">here</a>. 
<strong>[Note: In this blog, I will not be demonstrating how to wrap the application in an image using Dockerfile. Rather I will use an image which I created before and can be accessed from <a target="_blank" href="https://hub.docker.com/r/alex43/go-demo-app/tags">here</a>]</strong>
Now let's begin with the hands-on part and create our first helm chart. Please follow the steps below -</p>
<p><strong>Step-1:</strong> Helm is efficient enough to provide you with the basic template to begin with. To create the template, execute -</p>
<pre><code class="lang-bash">helm create demo-go-app
</code></pre>
<p>It will create a helm chart named <code>demo-go-app</code> which contains the basic configuration files &amp; directories in the helm syntactical order as you can see in the below image.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22cc3tq5j09q02ary00u.jpg" alt="helm-create" />
Let's understand the files &amp; directories created by-default</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Key</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>Chart.yaml</td><td>The file contains the information of your chart</td></tr>
<tr>
<td>chart</td><td>Its an empty directory which may contain any dependent charts if you have</td></tr>
<tr>
<td>templates</td><td>The directory contains all the yaml files needs to be deployed</td></tr>
<tr>
<td>tests</td><td>It contains files used for testing</td></tr>
<tr>
<td>values.yaml</td><td>This file contains the values which needs to be given while installation</td></tr>
</tbody>
</table>
</div><p><strong>Step-2:</strong> Now you can add/remove the files which you don't need for your application. In our case let's delete chart dir, tests dir, ingress.yaml and hpa.yaml as we don't need these for our demo.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cb9gk60yy7cb3f13l5sf.jpg" alt="rm-command" /></p>
<p><strong>Step-3:</strong> Now we need to provide the image where our application has been wrapped and needs to be deployed. In our case as I already mentioned above, we already have our application wrapped in an image and pushed in <a target="_blank" href="https://hub.docker.com/r/alex43/go-demo-app/tags">public container registry</a>, so I will be using it. 
Feel free to use it if you don't have your own image. One of the benefits of helm charts as we discussed, we just need to make changes in our <code>values.yaml</code>, which contains the parameters extracted from all the resources which we want to deploy. In the files, we just have to add our own image details and we are done with the bare min config to deploy our application. In the default <code>value.yaml</code> file, there are a lot different parameters which can be tweaked as per our requirements. As you can see an extract of few parameters from values.yaml, where I have just manipulated the image details and added <code>fullnameOverride</code>, rest everything goes default.</p>
<pre><code class="lang-bash">replicaCount: 1

image:
  repository: alex43/go-demo-app
  pullPolicy: IfNotPresent
  <span class="hljs-comment"># Overrides the image tag whose default is the chart appVersion.</span>
  tag: <span class="hljs-string">"v1.0"</span>

imagePullSecrets: []
nameOverride: <span class="hljs-string">""</span>
fullnameOverride: <span class="hljs-string">"go-app"</span>
</code></pre>
<p>Now you can make these changes and save the file.</p>
<p><strong>Step-4:</strong> Since we are ready with the necessary changes, now we can install our chart. To install the chart in default namesapce we can use the following command.</p>
<pre><code class="lang-bash">helm install go-app demo-go-app/
</code></pre>
<p>If we want to install the chart in specific namespace, we can use the following command. It will create a new namespace and will install the chart in that namespace. If the namespace already exists, we can omit the <code>--create-namespace</code> parameter</p>
<pre><code class="lang-bash">helm install go-app demo-go-app --create-namespace --namespace helm-app
</code></pre>
<p>To verify weather the helm app has been created or not, we can simply use the following command with the namespace where it was installed as you can see in the below image.</p>
<pre><code class="lang-bash">helm list -n helm-app
</code></pre>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py7nfldv6wqdtkupa2bq.jpg" alt="helm-install" /></p>
<p>Now we have successfully installed/deployed our k8s application with helm chart. Now let's play a bit around helm chart. In the <code>values.yaml</code>, let's say, if we want to add some more parameters which we want to configure while installation or upgrading the chart, we can easily do that. From <code>deployment.yaml</code>, for instance we want to make <code>containerPort: 80</code> a generic parameter by passing it in <code>values.yaml</code> file so that it can be changed or updated while installation. To pass any value, we need to grab the values by using the syntax - <code>{{ .Values.&lt;AttributeNameGiven_in_Values.yaml&gt; }}</code></p>
<ul>
<li>Add a parameter in values.yaml file say,<pre><code><span class="hljs-attr">port:</span>
<span class="hljs-attr">containerPort:</span> <span class="hljs-number">80</span>
</code></pre></li>
<li>Now add the following in the <code>containerport</code> parameter in your <code>deployment.yaml</code> so that it can receive the values passed through <code>values.yaml</code><pre><code><span class="hljs-attribute">ports</span>:
- <span class="hljs-attribute">name</span>: http
 <span class="hljs-attribute">containerPort</span>: {{ .Values.port.containerPort }}
 <span class="hljs-attribute">protocol</span>: TCP
</code></pre>Now if you want to check if the Values you added is properly working or not, you can render the chart locally by using the below command. It will render all the templates with values given in <code>values.yaml</code>. This is mostly used to debug and test your custom created helm charts.<pre><code class="lang-bash">helm template --debug demo-go-app/
</code></pre>
The output would look like something in the below image if there isn't any error.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xewd2qplux5ezi4ql4bc.jpg" alt="helm-template-debug" /></li>
</ul>
<p>The advantage of doing so is that, we can override the values while installing or upgrading the chart just by using a parameter called <code>--set</code>. Lets upgrade the chart which we have installed. </p>
<pre><code class="lang-bash">helm upgrade go-app demo-go-app/ --<span class="hljs-built_in">set</span> port.containerPort=8080 -n helm-app
</code></pre>
<p>The command will update the installed chart and will also update the <code>REVISION</code> automatically as you can see in the below image.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lrej5c2y4tevwimb4y77.jpg" alt="helm-upgrade" />
Similarly, we can update any parameter passed in <code>values.yaml</code> file while installation or upgradation. Now if we want to access our deployed application, just copy-paste the commands given in <code>NOTES</code> section after upgrading the chart. It will port-forward the port number <code>8080</code> of your localhost to the container port you have given. In our case we set it to 8080 so the output would look something like the below image.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l31l6nvsget7t8ig0wyz.jpg" alt="port-forward" /></p>
<p>Now if you visit <code>127.0.0.1:8080/</code>, you would be able to see your application. In my case, I have given an endpoint <code>layout.html</code> so I will be able to see my application at the given endpoint as you can see in the image below.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cbygd43b8f9sgkbyvz7u.jpg" alt="deployed-app" /></p>
<p>So this was all about helm, and how you can create your own helm charts and deploy over k8s. Now if you want to delete the chart installed, simply execute the below command. It will delete all the resources it created along with it.</p>
<pre><code class="lang-bash">helm delete go-app -n helm-app
</code></pre>
<p>Since we are familiar with the helm chart concepts, let's talk a bit about its advantages and some of its challenges.</p>
<h3 id="heading-advantages-of-helm-charts">Advantages of Helm Charts</h3>
<ul>
<li>Can package complex applications to deploy over k8s</li>
<li>Easy to get started with per-defined templates</li>
<li>Can use nested helm charts as dependencies</li>
<li>Values can be overridden while installation and you don't have to create helm charts for different environments</li>
<li>Just one click away for deploying all the resources of a k8s application</li>
<li>Helm by-default maintains the database of REVISIONs (version) providing an ease to rollback if something goes wrong</li>
<li>Easy collaborations among team and scalability</li>
</ul>
<h3 id="heading-challenges-with-helm-charts">Challenges with Helm Charts</h3>
<ul>
<li>It can easily package complex applications, but creating a helm chart for complex applications is itself quite complex</li>
<li>Troubleshooting and debugging is quite difficult in helm for complex applications as it uses templates for different resources</li>
<li>It doesn't provide any UI to manage applications deployed through helm. In scenarios where 100s of helm charts are deployed, it would be very difficult to manage helm apps.</li>
</ul>
<h2 id="heading-so-what-next-introducing-hyperion">So What next, Introducing Hyperion</h2>
<p>In the blog, we have talked about helm, its requirements, creating helm charts, its advantages and some of its challenges. To overcome its challenges and sustain the originality of helm, let me take the pleasure to introduce you to a tool called <a target="_blank" href="https://docs.devtron.ai/hyperion/hyperion"><code>Hyperion</code></a>. It is one of its rare kind open source tool where you can easily look for all the helm charts deployed on a cluster through an intuitive dashboard. Hyperion is a lightweight in nature packed with full-fledged debugging features for your Kubernetes workloads. To know more about it, feel free to install &amp; explore Hyperion and let me know your views through comments. I am working on a dedicated blog for Hyperion which will be releasing soon.</p>
<p>{% github devtron-labs/devtron no-readme %}</p>
]]></content:encoded></item><item><title><![CDATA[All About ArgoCD, A Beginner's Guide]]></title><description><![CDATA[ArgoCD, being one of their 1st in the market known for having a declarative GitOps based deployment over Kubernetes is one of the most adopted Continuous Delivery tool. It has been known for its excellent application deployment and management over Ku...]]></description><link>https://devopsdiary.in/all-about-argocd-a-beginners-guide</link><guid isPermaLink="true">https://devopsdiary.in/all-about-argocd-a-beginners-guide</guid><category><![CDATA[Devops]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[ci-cd]]></category><dc:creator><![CDATA[Abhinav Dubey]]></dc:creator><pubDate>Fri, 25 Feb 2022 04:11:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1645762183394/KTH4uwLeV.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>ArgoCD, being one of their 1st in the market known for having a declarative GitOps based deployment over Kubernetes is one of the most adopted Continuous Delivery tool. It has been known for its excellent application deployment and management over Kubernetes and features such as auto healing clusters, user-access management, status check, etc. It is <a target="_blank" href="https://github.com/argoproj/argo-cd">open-sourced on github</a> under Apache 2.0 License.</p>
<h2 id="heading-argocd-existence-why">ArgoCD Existence, Why 🤔?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645726248709/mbfX4CWtC.jpeg" alt="but-why.jpeg" />
There are already hell lots of tools in the market, so why do we need another one? To justify the existence of ArgoCD, let's try to understand the workflow for application deployment before-and-after ArgoCD.</p>
<h2 id="heading-workflow-before-argocd">Workflow Before ArgoCD</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645728199964/n96zssQpx.png" alt="Workflow Without ArgoCD.png" />
Before the existence of ArgoCD, the pipeline seems something like the image above. A common ci-cd tool is used for both the Continuous Integration and Continuous Deployment.</p>
<ul>
<li>once the code is being pushed to version-control let's say Github, the tool triggers the other jobs</li>
<li>it runs the test-cases, build images, push the image to respective container registry</li>
<li>then changes the deployment manifests as per the new image build, and then deploy the new manifest using kubectl commands</li>
</ul>
<p>All these jobs/tasks are being performed by a ci-cd tool. This is how traditional ci-cd workflow works before the existence of ArgoCD. However there are some challenges in this workflow.</p>
<ul>
<li>We need to install and configure tools like kubectl, helm, etc in the ci-cd tools</li>
<li>We will have to provide access to k8s cluster and cloud providers if using managed services like eks to the respective ci-cd tool</li>
<li>It may lead to security loopholes as credentials are provided to external tools</li>
<li>There's no visibility of deployment metrics, your ci-cd tools doesn't know the status of deployed application once they apply the manifests</li>
</ul>
<h2 id="heading-workflow-after-argocd">Workflow After ArgoCD</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645728327507/-C2Je0FuI.png" alt="Workflow with ArgoCD.png" />
After the ArgoCD was launched in the market, the complete workflow has been changed. As you can see in the image, the Continuous Integration and Continuous Deployment has been separated now. ArgoCD uses declarative GitOps based deployment which states that the best practices is to have two different git repositories, one for application source code and another for deployment manifest files. </p>
<ul>
<li>once the code has been pushed to version, the CI pipeline trigger the job</li>
<li>starts to run test cases, build images, push images to respective container registry and then update the manifest according and push manifests to its respective git repository</li>
<li>once the updated manifests is pushed to its respective repository be it Github, Gitlab, etc as shown in the image, ArgoCD installed within the cluster automatically checks for the updates and apply within the cluster.</li>
</ul>
<p>This is how, the respective ci-cd tool is limited to CI and ArgoCD handles the CD part and thus separating both the operations. There are many different advantages of using this workflow, some of them are -</p>
<ul>
<li>it uses git as a single source of truth, thus incorporating GitOps principles for the deployment</li>
<li>since ArgoCD is installed within the cluster and is the only one that makes changes within the cluster, it doesn't require any extra credentials unlike the case of a ci-cd tool</li>
<li>ArgoCD provides a dashboard to manage all the deployed applications hence enables you to get the status of application being deployed or not which we doesn't get in case of previous workflow</li>
<li>easy rollback, as the cluster is synced with a separate git repository so we just need to revert the changes in git and the cluster will be automatically synced with the git repository</li>
<li>disaster recovery, as in case of any disaster you just need to point the git repository to the newly created cluster and it will have all the configurations of the previous cluster</li>
</ul>
<p>So, these are some of the major advantages of the Workflow after ArgoCD. Now let's dive into ArgoCD and do some practical stuffs.</p>
<h2 id="heading-argocd-getting-started">ArgoCD Getting Started</h2>
<p>As we have seen some background concepts of ArgoCD and its need, let dive into some hands-on part. There are two different ways to install and setup ArgoCD in you cluster, </p>
<ol>
<li>Install using script</li>
<li>Install using helm chart</li>
</ol>
<p>Let's look into each of these.</p>
<p><strong>[Note: kubectl command must be installed and kubeconfig file should be at the default location(~/.kube/config) before installing argocd]</strong></p>
<h3 id="heading-installation-by-script">Installation by script</h3>
<p>Just with few commands you can have your ArgoCD installed in your cluster and ready to deploy an application over it. Please execute the below commands for installation - 
Create a namespace <code>argocd</code> where all ArgoCD resources will be installed</p>
<pre><code class="lang-bash">kubectl create namespace argocd
</code></pre>
<p>Install all resources in the created namespace</p>
<pre><code class="lang-bash">kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
</code></pre>
<p>After installation, you need to access the dashboard. There are different methods given in their <a target="_blank" href="https://argo-cd.readthedocs.io/en/stable/getting_started/#3-access-the-argo-cd-api-server">documentation</a> for accessing the dashboard. We will be using port-forward as we are installing in our local machine. Please execute the command below -</p>
<pre><code class="lang-bash">kubectl port-forward svc/argocd-server -n argocd 8080:443
</code></pre>
<p>Now your ArgoCD dashboard can be accessed in 127.0.0.1:8080 as you can see in the image below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645728985248/-K6QVfmQJ.jpg" alt="argo.jpg" /></p>
<pre><code class="lang-bash">kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath=<span class="hljs-string">"{.data.password}"</span> | base64 -d; <span class="hljs-built_in">echo</span>
</code></pre>
<p>Congratulation 🥳 You have successfully logged into the argocd dashboard.
Now, this was one of the method. It can also be installed using helm chart. Let's see how.</p>
<h3 id="heading-installation-by-helm">Installation by helm</h3>
<p>Recently argo-project has launched their official helm-chart support for ArgoCD, which enables us to install it with helm as well. Please execute the following command to install ArgoCD with helm -</p>
<p>Add the helm repository in your system</p>
<pre><code class="lang-bash">helm repo add argo https://argoproj.github.io/argo-helm
</code></pre>
<p>Now install the ArgoCD helm chart</p>
<pre><code class="lang-bash">helm install my-release argo/argo-cd
</code></pre>
<p>The advantage of installing with helm chart is that, you can easily provide the configuration as you want during the installation. For details of the parameters support by ArgoCD helm chart, please have a look at this detailed <a target="_blank" href="https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd#general-parameters">README</a></p>
<p>After installation, to access the dashboard and credentials, you can follow the same commands as we did earlier. </p>
<p><strong>[Note: Make sure to remove namespace i.e, -n argocd if you have not provided any namespace during the installation from commands to access dashboard &amp; credentials. To provide the namespace, append this with helm install command --create-namespace --namespace argocd]</strong></p>
<p>This is how easily you can install ArgoCD with the two different methods. For detailed documentation of getting started with ArgoCD, please have a <a target="_blank" href="https://argo-cd.readthedocs.io/en/stable/getting_started/#getting-started">look at this</a>. Now, let's deploy a simple application and configure it to manage by ArgoCD.</p>
<h2 id="heading-application-deployment">Application Deployment</h2>
<p>For any application to be deployed and managed by ArgoCD, we need to create a config file say, application.yaml which will have all the configurations required by ArgoCD containing the repository URL to sync with, Path where all manifests are being stored which needs to be deployed, namespace, and other configs. Here's a <a target="_blank" href="https://github.com/Abhinav-26/ArgoCD-Config-Test">demo project</a> which we will deploy in our cluster having all yamls and application.yaml file with bare minimum configs.</p>
<p>Let's deploy our application. Please follow along with the following steps.</p>
<ul>
<li>First, we need to store all the config files, including the application.yaml in a separate gitHub (gitlab, bitbucket, etc) repository as you <a target="_blank" href="https://github.com/Abhinav-26/ArgoCD-Config-Test">can see here</a></li>
<li>Then we just need to deploy the application.yaml which consists config required by ArgoCD in the cluster by using the following command -<pre><code class="lang-bash">kubectl apply -f application.yaml
</code></pre>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645761553762/OH_YqJkWM.png" alt="terminal-kubectl.png" /></li>
</ul>
<p>Now only just by applying the ArgoCD application config file, all other k8s yamls will automatically gets deployed and synced with the cluster. In the below image you can see that, the application, <code>go-app-argo-config</code> is responsible for creating all other resources.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645761675274/cP89mM0H3.png" alt="argocd-ui.png" /></p>
<p>If we want to update the deployment, service or add any other k8s manifests (yamls), we simply need to makes the changes and push in the github repository synced with it and rest will be taken care ArgoCD.
So, this was all about ArgoCD which you need to kick-start and play around it. If you have any doubts or suggestions, please feel free to comment it down, I would be happy enough to answer all your queries.
For more details about ArgoCD please feel free to check out their <a target="_blank" href="https://github.com/argoproj/argo-cd/">Github Repository</a></p>
<h2 id="heading-what-i-am-working-on">What I am Working on</h2>
<p>As you have seen in the blog, ArgoCD is specifically used for deployment and for other operations you still need other tools. <a target="_blank" href="https://github.com/devtron-labs/devtron">Devtron</a> is an ecosystem of open source tools for Kubernetes. Devtron also uses ArgoCD for GitOps driven deployment along with other industry recognized open source tools like Prometheus and Grafana (for Monitoring), Clair (for image scanning), Casbin (for rbac auth implementation) and many more open source and enterprise level tools all integrated seamlessly in one package.</p>
<p>Currently I am working on another blog, where I will be explaining how Devtron leverages ArgoCD and other tools to provides a seamless experience of the complete Software Delivery lifecycle on Kubernetes.</p>
]]></content:encoded></item></channel></rss>