<?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: jokerwrld999</title>
    <description>The latest articles on Forem by jokerwrld999 (@jokerwrld).</description>
    <link>https://forem.com/jokerwrld</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%2F1140206%2F1c8c1654-b87a-4cfb-a483-ad223d3b2fbe.jpeg</url>
      <title>Forem: jokerwrld999</title>
      <link>https://forem.com/jokerwrld</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jokerwrld"/>
    <language>en</language>
    <item>
      <title>Simplified Deployment: A Deep Dive into Containerization and Helm</title>
      <dc:creator>jokerwrld999</dc:creator>
      <pubDate>Sun, 08 Oct 2023 18:32:50 +0000</pubDate>
      <link>https://forem.com/jokerwrld/simplified-deployment-a-deep-dive-into-containerization-and-helm-oba</link>
      <guid>https://forem.com/jokerwrld/simplified-deployment-a-deep-dive-into-containerization-and-helm-oba</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this post, we embark on a journey through the fundamental concepts of containerization and the practical use of Helm charts. Containerization provides a streamlined approach to packaging, distributing, and deploying software, while Helm simplifies the management of complex applications on Kubernetes.&lt;/p&gt;

&lt;p&gt;Let's navigate through the essence of containerization and Helm charts, understanding how they contribute to modern software development and deployment. Join us as we unravel the mechanics of these essential tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dockerizing the Application
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Project Link:&lt;/strong&gt; &lt;a href="https://github.com/jokerwrld999/devops_assignments.git"&gt;https://github.com/jokerwrld999/devops_assignments.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Package the FastAPI application into a Docker container for portability and easier deployment.&lt;/p&gt;

&lt;p&gt;This Dockerfile uses a multi-stage build process to optimize the Docker image size for the 'hello-world' FastAPI application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;python:slim-bullseye&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;builder&lt;/span&gt;

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; poetry.lock pyproject.toml main.py .env gunicorn.sh ./&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-cache-dir&lt;/span&gt; &lt;span class="nv"&gt;poetry&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;1.5.1 &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; poetry config virtualenvs.in-project &lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; poetry &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-interaction&lt;/span&gt; &lt;span class="nt"&gt;--no-ansi&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="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; poetry shell &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;

&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;alpine:latest&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;base&lt;/span&gt;

&lt;span class="k"&gt;RUN  &lt;/span&gt;apk update &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apk upgrade &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apk add ca-certificates &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; update-ca-certificates &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo &lt;/span&gt;http://dl-cdn.alpinelinux.org/alpine/v3.6/main &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/apk/repositories &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo &lt;/span&gt;http://dl-cdn.alpinelinux.org/alpine/v3.6/community &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/apk/repositories &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apk add &lt;span class="nt"&gt;--update&lt;/span&gt; coreutils &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/cache/apk/&lt;span class="k"&gt;*&lt;/span&gt;   &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apk add &lt;span class="nt"&gt;--update&lt;/span&gt; python3 py3-pip &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apk add &lt;span class="nt"&gt;--no-cache&lt;/span&gt; nss &lt;span class="se"&gt;\
&lt;/span&gt;    &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/cache/apk/&lt;span class="k"&gt;*&lt;/span&gt;

&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; base&lt;/span&gt;

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /web&lt;/span&gt;

&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; ENVIRONMENT=default&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; ENVIRONMENT_FROM_SECRET=secret_default&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-cache-dir&lt;/span&gt; fastapi gunicorn uvicorn

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --from=builder /app ./&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; app ./app&lt;/span&gt;

&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["./gunicorn.sh"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Build Process:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Builder Stage&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Utilizes the &lt;code&gt;python:slim-bullseye&lt;/code&gt; image.&lt;/li&gt;
&lt;li&gt;Sets the working directory to &lt;code&gt;/app&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Copies essential files like poetry configuration, application files, and the gunicorn script.&lt;/li&gt;
&lt;li&gt;Installs dependencies via Poetry and creates a virtual environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Base Stage&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Based on the &lt;code&gt;alpine:latest&lt;/code&gt; image, a lightweight Linux distribution.&lt;/li&gt;
&lt;li&gt;Installs necessary packages including Python and pip.&lt;/li&gt;
&lt;li&gt;Sets the working directory to &lt;code&gt;/web&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Defines environment variables for the application.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dependency Installation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installs required Python packages using pip.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Application Setup&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copies files from the builder stage to the final image, including the FastAPI application code.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;CMD Directive&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Specifies the command to start the application using &lt;code&gt;gunicorn.sh&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The resulting Docker image is optimized, effectively reducing the image size while maintaining application functionality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Helm Charts
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://helm.sh/"&gt;Helm&lt;/a&gt; is a widely used package manager for Kubernetes, designed to simplify and automate the deployment, scaling, and management of applications. It provides an efficient way to define, install, and upgrade even complex Kubernetes applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of Helm:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Package Management&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helm packages applications as "charts," making it easy to share and install applications on Kubernetes clusters.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Templating and Parameterization&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helm allows users to use templates to define Kubernetes manifests, enabling parameterization and customization of these manifests during installation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Reusability&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helm charts promote the reuse of predefined configurations and deployment strategies across multiple applications, streamlining the development process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dependency Management&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helm handles dependencies between Kubernetes resources, ensuring the correct order of installation and removal for complex applications.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Rollbacks and Upgrades&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helm supports rollbacks to previous versions and facilitates seamless upgrades of applications to newer versions, improving the overall deployment process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Community Contributions&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helm has a thriving community contributing to a vast collection of prebuilt charts, covering a wide array of applications and services.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With these features, Helm significantly simplifies Kubernetes application management, making it a vital tool in the Kubernetes ecosystem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Helm Chart Folder Structure
&lt;/h3&gt;

&lt;p&gt;The Helm chart folder structure looks like this:&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="o"&gt;[&lt;/span&gt;4.0K]  charts/
├── &lt;span class="o"&gt;[&lt;/span&gt;4.0K]  app/
│   ├── &lt;span class="o"&gt;[&lt;/span&gt;4.0K]  templates/
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt; 647]  certmanager.yaml
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt; 180]  configmap.yaml
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt;1.4K]  deployment.yaml
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt; 296]  _helpers.tpl
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt; 406]  hpa.yaml
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt; 856]  ingress.yaml
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt; 680]  NOTES.txt
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt; 216]  secret.yaml
│   │   └── &lt;span class="o"&gt;[&lt;/span&gt; 332]  service.yaml
│   ├── &lt;span class="o"&gt;[&lt;/span&gt;4.0K]  values/
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt;4.0K]  dev/
│   │   │   ├── &lt;span class="o"&gt;[&lt;/span&gt;1.6K]  secrets.yaml
│   │   │   └── &lt;span class="o"&gt;[&lt;/span&gt;  68]  values.yaml
│   │   ├── &lt;span class="o"&gt;[&lt;/span&gt;4.0K]  prod/
│   │   │   ├── &lt;span class="o"&gt;[&lt;/span&gt;1.6K]  secrets.yaml
│   │   │   └── &lt;span class="o"&gt;[&lt;/span&gt; 167]  values.yaml
│   │   └── &lt;span class="o"&gt;[&lt;/span&gt;4.0K]  stage/
│   │       ├── &lt;span class="o"&gt;[&lt;/span&gt;1.6K]  secrets.yaml
│   │       └── &lt;span class="o"&gt;[&lt;/span&gt; 179]  values.yaml
│   ├── &lt;span class="o"&gt;[&lt;/span&gt; 130]  Chart.yaml
│   └── &lt;span class="o"&gt;[&lt;/span&gt; 306]  values.yaml
├── &lt;span class="o"&gt;[&lt;/span&gt;4.0K]  config/
│   ├── &lt;span class="o"&gt;[&lt;/span&gt; 334]  cleanup.sh&lt;span class="k"&gt;*&lt;/span&gt;
│   └── &lt;span class="o"&gt;[&lt;/span&gt; 353]  pre-install.sh&lt;span class="k"&gt;*&lt;/span&gt;
└── &lt;span class="o"&gt;[&lt;/span&gt; 491]  helmfile.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;code&gt;certmanager.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file defines the configuration for Cert-Manager, a Kubernetes add-on for managing TLS certificates.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;configmap.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file defines a Kubernetes ConfigMap, which holds configuration data for the application.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;deployment.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file defines the Kubernetes Deployment resource, specifying how the application should be deployed and managed.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;_helpers.tpl&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This is a Helm template helper file, containing reusable template snippets.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;hpa.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file defines the Horizontal Pod Autoscaler (HPA) for automatically scaling the application based on resource usage.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;ingress.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file defines the Kubernetes Ingress resource, configuring how external access to the application is managed.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;NOTES.txt&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file contains optional post-installation notes and information for users.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;secret.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file defines a Kubernetes Secret, holding sensitive configuration data.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;service.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file defines the Kubernetes Service resource, managing access to the application.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;values.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file contains default configuration values for the Helm chart.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;secrets.yaml&lt;/code&gt; (in &lt;code&gt;values/dev/&lt;/code&gt;, &lt;code&gt;values/prod/&lt;/code&gt;, &lt;code&gt;values/stage/&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;These files define environment-specific secrets that the application uses.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;Chart.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file contains metadata and information about the Helm chart.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;cleanup.sh&lt;/code&gt; (in &lt;code&gt;config/&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;A shell script for cleanup operations before installation.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;pre-install.sh&lt;/code&gt; (in &lt;code&gt;config/&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;A shell script for pre-installation operations.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;helmfile.yaml&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;This file is used for Helmfile, which is a declarative configuration for deploying Helm charts. It defines the Helm releases and their configurations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Deployment Environment
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Minikube Installation
&lt;/h3&gt;

&lt;p&gt;Minikube is a tool that allows you to run a single-node Kubernetes cluster locally on your computer. It's designed to enable developers to set up and experiment with Kubernetes applications in a local environment before deploying to a larger Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;Installation: &lt;a href="https://minikube.sigs.k8s.io/docs/start/"&gt;https://minikube.sigs.k8s.io/docs/start/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;minikube config &lt;span class="nb"&gt;set &lt;/span&gt;driver docker
minikube start // stop
minikube status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Kubectl Installation
&lt;/h3&gt;

&lt;p&gt;Installation: &lt;a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/"&gt;https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/&lt;/a&gt;&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;-LO&lt;/span&gt; &lt;span class="s2"&gt;"https://dl.k8s.io/&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; https://dl.k8s.io/release/stable.txt&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/bin/linux/amd64/kubectl.sha256"&lt;/span&gt;
&lt;span class="nb"&gt;sudo install&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; root &lt;span class="nt"&gt;-g&lt;/span&gt; root &lt;span class="nt"&gt;-m&lt;/span&gt; 0755 kubectl /usr/local/bin/kubectl

&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.kube/config  // kubectl config view
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;k&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'kubectl'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Helm Installation
&lt;/h3&gt;

&lt;p&gt;Installation: &lt;a href="https://helm.sh/docs/intro/install/"&gt;https://helm.sh/docs/intro/install/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheat Sheet: &lt;a href="https://helm.sh/docs/intro/cheatsheet/"&gt;https://helm.sh/docs/intro/cheatsheet/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Plugins Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm plugin &lt;span class="nb"&gt;install &lt;/span&gt;https://github.com/databus23/helm-diff
helm plugin &lt;span class="nb"&gt;install &lt;/span&gt;https://github.com/aslafy-z/helm-git
helm plugin &lt;span class="nb"&gt;install &lt;/span&gt;https://github.com/jkroepke/helm-secrets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Secrets Encryption
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm secrets encrypt prod/secrets.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Namespace Creation
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Github Registry Login
&lt;/h3&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;CR_PAT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;

kubectl create secret docker-registry ghcr-login-secret &lt;span class="nt"&gt;--docker-server&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://ghcr.io &lt;span class="nt"&gt;--docker-username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;jokerwrld999 &lt;span class="nt"&gt;--docker-password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CR_PAT&lt;/span&gt; &lt;span class="nt"&gt;--docker-email&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;example@gmail.com &lt;span class="nt"&gt;-n&lt;/span&gt; dev
kubectl create secret docker-registry ghcr-login-secret &lt;span class="nt"&gt;--docker-server&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://ghcr.io &lt;span class="nt"&gt;--docker-username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;jokerwrld999 &lt;span class="nt"&gt;--docker-password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CR_PAT&lt;/span&gt; &lt;span class="nt"&gt;--docker-email&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;example@gmail.com &lt;span class="nt"&gt;-n&lt;/span&gt; stage
kubectl create secret docker-registry ghcr-login-secret &lt;span class="nt"&gt;--docker-server&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://ghcr.io &lt;span class="nt"&gt;--docker-username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;jokerwrld999 &lt;span class="nt"&gt;--docker-password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CR_PAT&lt;/span&gt; &lt;span class="nt"&gt;--docker-email&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;example@gmail.com &lt;span class="nt"&gt;-n&lt;/span&gt; prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Helmfile Deployment
&lt;/h2&gt;

&lt;p&gt;Helmfile is a declarative configuration management tool for deploying Helm charts to Kubernetes clusters. It simplifies the process of managing complex Helm deployments by allowing you to define your desired state in a structured YAML file.&lt;/p&gt;

&lt;p&gt;Installation: &lt;a href="https://github.com/helmfile/helmfile/releases"&gt;https://github.com/helmfile/helmfile/releases&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Development Environment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helmfile &lt;span class="nt"&gt;--file&lt;/span&gt; helmfile.yaml &lt;span class="nt"&gt;-e&lt;/span&gt; dev apply &lt;span class="nt"&gt;--interactive&lt;/span&gt;
helmfile &lt;span class="nt"&gt;--file&lt;/span&gt; helmfile.yaml &lt;span class="nt"&gt;-e&lt;/span&gt; dev destroy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Staging Environment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helmfile &lt;span class="nt"&gt;--file&lt;/span&gt; helmfile.yaml &lt;span class="nt"&gt;-e&lt;/span&gt; stage apply &lt;span class="nt"&gt;--interactive&lt;/span&gt;
helmfile &lt;span class="nt"&gt;--file&lt;/span&gt; helmfile.yaml &lt;span class="nt"&gt;-e&lt;/span&gt; stage destroy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Production Environment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helmfile &lt;span class="nt"&gt;--file&lt;/span&gt; helmfile.yaml &lt;span class="nt"&gt;-e&lt;/span&gt; prod apply &lt;span class="nt"&gt;--interactive&lt;/span&gt;
helmfile &lt;span class="nt"&gt;--file&lt;/span&gt; helmfile.yaml &lt;span class="nt"&gt;-e&lt;/span&gt; prod destroy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Debug/Healthcheck
&lt;/h3&gt;

&lt;p&gt;Service_IP/openapi.json&lt;br&gt;
Service_IP/secret&lt;br&gt;
Service_IP/healthcheck&lt;/p&gt;

&lt;h2&gt;
  
  
  Accessing the Application
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Host: dev.jokerwrld.com"&lt;/span&gt; http://&lt;span class="si"&gt;$(&lt;/span&gt;minikube ip&lt;span class="si"&gt;)&lt;/span&gt;/
curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Host: stage.jokerwrld.com"&lt;/span&gt; &lt;span class="nt"&gt;-k&lt;/span&gt; https://&lt;span class="si"&gt;$(&lt;/span&gt;minikube ip&lt;span class="si"&gt;)&lt;/span&gt;/
curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Host: prod.jokerwrld.com"&lt;/span&gt; &lt;span class="nt"&gt;-k&lt;/span&gt; https://&lt;span class="si"&gt;$(&lt;/span&gt;minikube ip&lt;span class="si"&gt;)&lt;/span&gt;/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;We've taken a close look at making our applications work smoothly on Kubernetes. With Docker helping us pack our apps neatly, and Helm helping us manage and deploy them, we've simplified the process. Remember, mastering this art opens up exciting possibilities for seamless deployments and happy users. Keep practicing and enjoy the journey into the world of containers and Helm!&lt;/p&gt;

</description>
      <category>git</category>
      <category>kubernetes</category>
      <category>docker</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
