<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Unnati Mishra</title>
    <description>The latest articles on Forem by Unnati Mishra (@unnatimishra).</description>
    <link>https://forem.com/unnatimishra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1650732%2Fb862db69-f169-43aa-859a-34d7718adb85.jpeg</url>
      <title>Forem: Unnati Mishra</title>
      <link>https://forem.com/unnatimishra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/unnatimishra"/>
    <language>en</language>
    <item>
      <title>GitOps: ArgoCD vs FluxCD</title>
      <dc:creator>Unnati Mishra</dc:creator>
      <pubDate>Fri, 02 Aug 2024 10:12:24 +0000</pubDate>
      <link>https://forem.com/cloudraft/gitops-argocd-vs-fluxcd-20a4</link>
      <guid>https://forem.com/cloudraft/gitops-argocd-vs-fluxcd-20a4</guid>
      <description>&lt;h2&gt;
  
  
  Getting Started with GitOps
&lt;/h2&gt;

&lt;p&gt;In the fast-paced world of software development, organizations are constantly seeking ways to streamline processes and improve efficiency through automation. The shift from waterfall models to hyper-agile methodologies, coupled with the adoption of microservices architecture, has led to much faster software releases. GitOps has emerged as a powerful approach to enable this rapid deployment cycle, implementing a &lt;a href="https://kubernetes.io/docs/concepts/architecture/controller/" rel="noopener noreferrer"&gt;control-loop&lt;/a&gt; pattern often seen in Kubernetes.&lt;/p&gt;

&lt;p&gt;GitOps offers a more consistent and reliable way to handle infrastructure and deployment. In this blog, we'll explore what GitOps is, why it's gaining popularity among DevOps teams, and take a closer look at popular GitOps tools like Argo CD and Flux CD.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is GitOps?
&lt;/h2&gt;

&lt;p&gt;GitOps, a combination of 'Git' and 'Operations', is an approach to continuous deployment for cloud-native applications. It uses Git as the single source of truth for declarative infrastructure and applications. This means storing and managing all configuration files that describe how our application should be deployed and run in Git repositories.&lt;/p&gt;

&lt;p&gt;The core principle of GitOps is treating everything - from application code to infrastructure - as code that can be version-controlled and managed using Git. When changes are needed, instead of manually executing commands or scripts, we make changes to our Git repository. A controller then detects these changes and applies them to our infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of GitOps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consistency and Reliability&lt;/strong&gt;: With GitOps, the entire system configuration is stored in version control, providing a clear, auditable record of what should be deployed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster Recovery and Easier Rollbacks&lt;/strong&gt;: In case of issues, rolling back to a previous state is as simple as reverting to a previous commit in the Git history.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;: Git's central point of control allows for strict access controls and enforced code reviews before changes are applied.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved Developer Experience&lt;/strong&gt;: Developers can use familiar Git workflows to manage infrastructure, bridging the gap between development and operations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Visibility and Traceability&lt;/strong&gt;: All changes are recorded in Git, providing a clear record of who changed what and when.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Increased Automation&lt;/strong&gt;: Pushing changes to Git can automatically trigger deployments, reducing manual work and speeding up processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Environment Consistency&lt;/strong&gt;: GitOps makes it easier to maintain consistency between different environments (development, staging, production).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Increased Productivity&lt;/strong&gt;: DORA's research suggests teams can ship 30-100 times more changes per day, increasing overall development output by 2-3 times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Availability&lt;/strong&gt;: With all configuration data in Git, organizations can easily deploy the same Kubernetes platform across different environments, leading to better availability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Argo CD vs Flux CD
&lt;/h2&gt;

&lt;p&gt;When implementing GitOps for Kubernetes, two popular tools stand out: Argo CD and Flux CD. Both are excellent choices, but they have some differences. Here's a comparison of their features:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Argo CD&lt;/th&gt;
&lt;th&gt;Flux CD&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Kubernetes-native&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UI&lt;/td&gt;
&lt;td&gt;Rich web-based UI&lt;/td&gt;
&lt;td&gt;Capacitor GUI dashboard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-tenancy&lt;/td&gt;
&lt;td&gt;Built-in&lt;/td&gt;
&lt;td&gt;Limited&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Helm support&lt;/td&gt;
&lt;td&gt;Native&lt;/td&gt;
&lt;td&gt;Via Helm Operator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kustomize support&lt;/td&gt;
&lt;td&gt;Native&lt;/td&gt;
&lt;td&gt;Native&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sync Mechanism&lt;/td&gt;
&lt;td&gt;Automatic sync&lt;/td&gt;
&lt;td&gt;Controller-based sync&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rollback capabilities&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Health status&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Relies on Kubernetes status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image Updater&lt;/td&gt;
&lt;td&gt;Add-on&lt;/td&gt;
&lt;td&gt;Built-in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Advanced Deployment Strategies&lt;/td&gt;
&lt;td&gt;Integrated with Argo rollouts&lt;/td&gt;
&lt;td&gt;Supported via Flagger&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Comparison between ArgoCD and FluxCD&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the next section, we will have a look at a quick demo of Argo CD and Flux CD.&lt;/p&gt;

&lt;h2&gt;
  
  
  Argo CD
&lt;/h2&gt;

&lt;p&gt;In this quick demo of Argo CD we will go through the step-by-step process of Argo CD installation on kubernetes cluster. We will use Argo CD to deploy a sample guestbook application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Kubernetes cluster&lt;/p&gt;

&lt;p&gt;Kubectl installed and configured.&lt;/p&gt;

&lt;p&gt;Configuration of the git repository&lt;/p&gt;

&lt;h3&gt;
  
  
  Argo CD Installation
&lt;/h3&gt;

&lt;p&gt;To install Argo CD, we need to have a Kubernetes cluster and kubectl installed and configured. You can check out the guide to install kubectl &lt;a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Create a namespace for Argo CD
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create namespace argocd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Install Argo CD
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-n&lt;/span&gt; argocd &lt;span class="nt"&gt;-f&lt;/span&gt; https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Access the Argo CD api server
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Port-forward the Argo CD server service
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl port-forward svc/argocd-server &lt;span class="nt"&gt;-n&lt;/span&gt; argocd 8080:443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Get the initial password of the admin user to authenticate
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nt"&gt;-n&lt;/span&gt; argocd get secret argocd-initial-admin-secret &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"{.data.password}"&lt;/span&gt; | &lt;span class="nb"&gt;base64&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use this password to log into the Argo CD UI using username admin at the forwarded port on the localhost, in this example, it is &lt;a href="https://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hvao7j5i4hi500xnnfj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hvao7j5i4hi500xnnfj.png" alt="Argo CD UI" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploy a sample application - guestbook
&lt;/h3&gt;

&lt;p&gt;To deploy an app, we need to create an Application object. The spec will have information such as the source of the Kubernetes manifests to deploy the application, destination Kubernetes cluster, namespace, and sync policy. You can also provide more image updater specs via annotations. In this example, we are not using an image updater.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;    &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;argoproj.io/v1alpha1&lt;/span&gt;  
    &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Application&lt;/span&gt;  
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;  
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;guestbook&lt;/span&gt;  
    &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;argocd&lt;/span&gt;  
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;  
    &lt;span class="na"&gt;project&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default&lt;/span&gt;  
    &lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;  
    &lt;span class="na"&gt;repoURL&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/argoproj/argocd-example-apps.git&lt;/span&gt;  
    &lt;span class="na"&gt;targetRevision&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;HEAD&lt;/span&gt;  
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;guestbook&lt;/span&gt;  
    &lt;span class="na"&gt;destination&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;  
    &lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://kubernetes.default.svc&lt;/span&gt;  
    &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;guestbook&lt;/span&gt;  
    &lt;span class="na"&gt;syncPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;  
    &lt;span class="na"&gt;automated&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;  
    &lt;span class="na"&gt;prune&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;  
    &lt;span class="na"&gt;selfHeal&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;  
    &lt;span class="na"&gt;syncOptions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;  
    &lt;span class="pi"&gt;-&lt;/span&gt;  &lt;span class="s"&gt;CreateNamespace=true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Create the application
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; application.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futebr1mfm8wovweajz2o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futebr1mfm8wovweajz2o.png" alt="Argo CD UI" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After applying the Argo CD application, the Argo CD controller will automatically monitor and apply the changes in the cluster. You can monitor this from the UI or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get apps &lt;span class="nt"&gt;-n&lt;/span&gt; argocd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Flux CD
&lt;/h2&gt;

&lt;p&gt;In this demo of Flux CD we will understand its installation. We will use flux CD to deploy the ‘fleet-infa’ repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Kubernetes Cluster&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitHub Personal Access Token. If you need help generating GitHub token check out this &lt;a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens" rel="noopener noreferrer"&gt;guide&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Objectives
&lt;/h3&gt;

&lt;p&gt;Bootstrap Flux CD on a Kubernetes Cluster.&lt;/p&gt;

&lt;p&gt;Deploy a sample application using Flux.&lt;/p&gt;

&lt;p&gt;Customize the application configuration through Kustomize patches.&lt;/p&gt;

&lt;h4&gt;
  
  
  Install the Flux CLI
&lt;/h4&gt;

&lt;p&gt;The Flux command-line interface (CLI) is used to bootstrap and interact with Flux CD&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://fluxcd.io/install.sh | &lt;span class="nb"&gt;sudo &lt;/span&gt;bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Export Your Credentials
&lt;/h4&gt;

&lt;p&gt;Export your GitHub personal access token and username.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export  &lt;/span&gt;&lt;span class="nv"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your-token&amp;gt;
&lt;span class="nb"&gt;export  &lt;/span&gt;&lt;span class="nv"&gt;GITHUB_USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;your-username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Check Your Kubernetes Cluster
&lt;/h4&gt;

&lt;p&gt;Ensure your cluster is ready for Flux by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flux check &lt;span class="nt"&gt;--pre&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Flux Installation
&lt;/h3&gt;

&lt;p&gt;To bootstrap using a GitHub repository, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    flux bootstrap github &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--owner&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$GITHUB_USER&lt;/span&gt; &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--repository&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fleet-infra &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--branch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;main &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./clusters/my-cluster &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--personal&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Clone the Git Repository
&lt;/h3&gt;

&lt;p&gt;Clone the fleet-infra repository to your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    git clone https://github.com/&lt;span class="nv"&gt;$GITHUB_USER&lt;/span&gt;/fleet-infra  
    &lt;span class="nb"&gt;cd &lt;/span&gt;fleet-infra
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Add podinfo Repository to Flux
&lt;/h3&gt;

&lt;p&gt;Create a git repository manifest pointing to the podinfo repository’s master branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    flux create &lt;span class="nb"&gt;source &lt;/span&gt;git podinfo &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://github.com/stefanprodan/podinfo &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--branch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;master &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--interval&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1m &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--export&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ./clusters/my-cluster/podinfo-source.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commit and push the podinfo-source.yaml file to the fleet-infra repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    git add &lt;span class="nt"&gt;-A&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add podinfo GitRepository"&lt;/span&gt;  
    git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Deploy podinfo Application
&lt;/h3&gt;

&lt;p&gt;Create a Kustomization manifest to deploy the podinfo application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    flux create kustomization podinfo &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--target-namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;default &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;podinfo &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"./kustomize"&lt;/span&gt; &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--prune&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--wait&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--interval&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;30m &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--retry-interval&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2m &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--health-check-timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3m &lt;span class="se"&gt;\ &lt;/span&gt; 
    &lt;span class="nt"&gt;--export&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ./clusters/my-cluster/podinfo-kustomization.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commit and push the podinfo-kustomization.yaml file to the repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nt"&gt;-A&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add podinfo Kustomization"&lt;/span&gt;  
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Watch Flux Sync the Application
&lt;/h3&gt;

&lt;p&gt;Use the flux get command to watch the podinfo app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flux get kustomizations &lt;span class="nt"&gt;--watch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Verify the Deployment
&lt;/h3&gt;

&lt;p&gt;Check if podinfo has been deployed on your cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nt"&gt;-n&lt;/span&gt; default get deployments,services
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  GitOps best practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Git Workflows: Separate application repositories from git workflow repositories. Also, avoid using long-lived branches from different environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplify your Kubernetes files: Use tools like Kustomize and Helm to make your Kubernetes files simpler and easier to manage. Use both together to avoid repeating yourself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Handle secrets carefully: Do not use your passwords or secrets directly in your Git files even if they are encrypted. Instead, use tools that can fetch secrets when needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Separate Build and Deployment Processes: Separate your build process from your deployment process. Let your CI system build and test your app and then let GitOps handle the build and put it in a server.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Ephemeral Environments using GitOps
&lt;/h2&gt;

&lt;p&gt;Ephemeral environments, also known as preview environments, are short-lived environments that allow developers to test and preview changes in a production-like environment before merging them into the main branch.&lt;/p&gt;

&lt;p&gt;These environments are typically created automatically when a pull request is opened and destroyed when the pull request is closed.&lt;/p&gt;

&lt;p&gt;In the context of Kubernetes, tools like Argo CD and Flux CD can automate the creation and management of ephemeral environments, making it easier to implement this practice in a GitOps workflow. For more information on how to implement preview environments on Kubernetes with Argo CD, check out this guide by &lt;a href="https://piotrminkowski.com/2023/06/19/preview-environments-on-kubernetes-with-argocd/" rel="noopener noreferrer"&gt;Piotr Minkowski&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;GitOps is a game-changer for managing infrastructure and applications. It boosts consistency, reliability, collaboration, and workflow. Tools like Argo CD and Flux CD exemplify how GitOps streamlines deployment and enhances efficiency. Our comparison shows the strengths and specific use cases of both tools, highlighting how they make GitOps implementation seamless and effective.&lt;/p&gt;

</description>
      <category>gitops</category>
      <category>devops</category>
    </item>
    <item>
      <title>K3s vs Talos Linux</title>
      <dc:creator>Unnati Mishra</dc:creator>
      <pubDate>Mon, 22 Jul 2024 10:40:46 +0000</pubDate>
      <link>https://forem.com/cloudraft/k3s-vs-talos-linux-2dg1</link>
      <guid>https://forem.com/cloudraft/k3s-vs-talos-linux-2dg1</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the world of Kubernetes, choosing the right technology can make a big difference in how smoothly and efficiently our applications run. This is where focused Kubernetes distributions like K3s and Talos Linux stand out.&lt;/p&gt;

&lt;p&gt;From large data centers to smaller devices on the edge, Kubernetes plays an important role in managing applications across various environments. As multiple businesses are using Kubernetes at the edge to run AI nowadays, specialized versions like K3s and Talos have come to tackle various operational challenges.&lt;/p&gt;

&lt;p&gt;K3s is known for being lightweight and easy to install, which makes it great for places with limited resources like edge computing and IoT. Meanwhile, Talos provides a more secure environment and is used for large-scale setups.&lt;/p&gt;

&lt;p&gt;In this blog, we will discuss how K3s and Talos fit into Kubernetes deployments and the differences between the two. This will help you make the perfect choice based on your needs and goals.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is K3s?
&lt;/h2&gt;

&lt;p&gt;K3s was developed by Rancher Labs and donated to the CNCF. K3s is packaged as a single, less than 40 MB, binary that reduces the dependencies and steps needed to install, run, and auto-update a production Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;It is a lightweight yet powerful Kubernetes distribution designed for production workloads across IoT devices or resource-restrained remote locations. The main aim of K3s is to streamline the installation and management of Kubernetes clusters. It is easy to install and highly available.&lt;/p&gt;

&lt;h3&gt;
  
  
  How is K3s different from Kubernetes?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;K3s is lightweight compared to the full distribution of Kubernetes.&lt;/li&gt;
&lt;li&gt;It has fewer dependencies.&lt;/li&gt;
&lt;li&gt;It is easier to deploy and manage.&lt;/li&gt;
&lt;li&gt;It uses fewer resources (i.e. CPU, RAM, etc).&lt;/li&gt;
&lt;li&gt;It has fewer built-in features and extensions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;K3s is ideal for smaller resource-constrained deployments, edge computing, and IoT while Kubernetes is more suited for large, complex deployments that have high resource requirements such as big data, machine learning, and high-performance computing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Talos Linux?
&lt;/h2&gt;

&lt;p&gt;Talos Linux is a modern Linux operating system distribution, written in Golang, that has specifically been built for the purpose of Kubernetes infrastructure. It has been designed to serve as the foundation for Kubernetes clusters.&lt;/p&gt;

&lt;p&gt;In Talos, the cluster is accessed through APIs, which reduces the need for secure shelling (SSH) and therefore reduces the chances of surface attacks. It also helps avoid unexpected issues by creating an immutable layer on top of physical servers. This ensures that all servers are identical and have the same setup. Since it is API-managed, it makes operations automated, straightforward, and scalable.&lt;/p&gt;

&lt;p&gt;You can read more about Talos &lt;a href="https://dev.to/blog/making-kubernetes-simple-with-talos"&gt;here&lt;/a&gt; post.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Differences between K3s and Talos Linux
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Talos Linux&lt;/th&gt;
&lt;th&gt;K3s&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Size&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Small in size&lt;/td&gt;
&lt;td&gt;Medium in size&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Role&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;OS For running the Kubernetes cluster&lt;/td&gt;
&lt;td&gt;Lightweight Kubernetes distribution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Installation and Setup&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Complex setup however can be simplified.&lt;/td&gt;
&lt;td&gt;Simple setup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Architecture&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Minimal, immutable OS; no SSH access or shell; API-driven configuration and management&lt;/td&gt;
&lt;td&gt;Lightweight, single-binary; integrates container runtime, networking, and storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Has a strong focus on security with an immutable file system, no interactive login (SSH), and API-driven interactions&lt;/td&gt;
&lt;td&gt;Follows essential security practices like RBAC, TLS encryption, automatic updates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Resource Requirements&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Requires sufficient resources for effective Kubernetes operation; not for resource-constrained environments&lt;/td&gt;
&lt;td&gt;Low resource requirements; suitable for low-power devices like IoT and edge devices.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scalability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Supports scalable Kubernetes clusters in production environments; handles large-scale deployments&lt;/td&gt;
&lt;td&gt;Supports clustering and high availability; generally used for smaller-scale deployments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Management and Maintenance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Managed through APIs; automated management with minimal manual intervention; less frequent maintenance and patching due to immutable infrastructure&lt;/td&gt;
&lt;td&gt;Simplified management with standard Kubernetes tools and interfaces; easy to update and maintain; suitable for environments requiring ease of management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Community and Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Growing community focused on security and production-grade deployments; strong documentation, community forums, and resources.&lt;/td&gt;
&lt;td&gt;Active community backed by Rancher Labs (part of SUSE); extensive documentation, community support, and commercial support options available through Rancher&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Usage of K3s and Talos Linux
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Used for lightweight and resource-constrained environments.&lt;/li&gt;
&lt;li&gt;It is perfect for edge computing, IoT, development and testing scenarios.&lt;/li&gt;
&lt;li&gt;Helps in easy management and faster deployments.&lt;/li&gt;
&lt;li&gt;Good fit for edge devices due to its security, reliability, and immutable ideology.&lt;/li&gt;
&lt;li&gt;It is an excellent option for deploying Kubernetes on bare metal servers.&lt;/li&gt;
&lt;li&gt;It is highly suitable for enterprise-level Kubernetes clusters.&lt;/li&gt;
&lt;li&gt;It supports cloud platforms and virtualization platforms as well.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The choice between K3s and Talos Linux hinges on their specific use cases and future needs. It can be observed that the demand for lightweight Kubernetes is rising significantly. Industries have started to embrace edge computing, IoT, and other resource-constrained environments, making the ability to efficiently manage applications with minimal infrastructure of extreme importance.&lt;/p&gt;

&lt;p&gt;As the demand for lightweight and efficient Kubernetes solutions grows, K3s is all-set to play a crucial role in helping in seamless and scalable application management in resource-limited environments. Meanwhile, Talos Linux will continue to be a robust choice for enterprises prioritizing security and reliability.&lt;/p&gt;

&lt;p&gt;To conclude, the choice between K3s and Talos Linux should be guided by specific deployment needs, resource availability, and security considerations. Organizations can effectively meet their Kubernetes deployment goals by understanding the strengths of each and choosing accordingly.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
    </item>
  </channel>
</rss>
