<?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>DEV Community: RD17🧑🏽‍💻</title>
    <description>The latest articles on DEV Community by RD17🧑🏽‍💻 (@rd17).</description>
    <link>https://dev.to/rd17</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%2F1800235%2Fd1f4bfdc-d531-4d46-9390-73531957276c.png</url>
      <title>DEV Community: RD17🧑🏽‍💻</title>
      <link>https://dev.to/rd17</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rd17"/>
    <language>en</language>
    <item>
      <title>How to Set Up Minio Object Storage on Linux with Systemd</title>
      <dc:creator>RD17🧑🏽‍💻</dc:creator>
      <pubDate>Tue, 03 Sep 2024 10:27:44 +0000</pubDate>
      <link>https://dev.to/rd17/how-to-set-up-minio-object-storage-on-linux-with-systemd-ghn</link>
      <guid>https://dev.to/rd17/how-to-set-up-minio-object-storage-on-linux-with-systemd-ghn</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Minio is an open-source object storage server that is compatible with the Amazon S3 API. It is a lightweight, high-performance solution for storing large amounts of unstructured data like images, videos, log files, and backups. This guide will take you through the process of installing Minio on a Linux server and configuring it to run as a systemd service.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A Linux server with root or sudo access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Internet access to download the Minio binary.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Set Up Directories&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The first step is to create the necessary directories for the Minio installation and backup storage.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p /opt/minio/bin
mkdir /backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;/opt/minio/bin&lt;/strong&gt;:- will hold the Minio server binary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;/backup&lt;/strong&gt;:- will be the data partition where Minio stores its objects.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Create a Minio User&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Next, we’ll create a dedicated user for running the Minio service. This user will have no login privileges and will be used solely to manage Minio.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useradd -s /sbin/nologin -d /opt/minio minio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a new user named &lt;strong&gt;minio&lt;/strong&gt; with no shell access and sets &lt;strong&gt;/opt/minio&lt;/strong&gt; as its home directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Install the Minio Server Binary&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We’ll now download the Minio server binary and set it to be executable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://dl.min.io/server/minio/release/linux-amd64/minio -O /opt/minio/bin/minio
chmod +x /opt/minio/bin/minio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command fetches the Linux x64 binary of the Minio server and ensures that it is executable.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Create a Minio Configuration File&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Minio requires a configuration file to define key environment variables, such as the location of the data partition. We’ll create this file under &lt;strong&gt;/opt/minio/&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim /opt/minio/minio.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MINIO_VOLUMES="/backup"
MINIO_OPTS="--console-address :9001"
MINIO_ROOT_USER="root"
MINIO_ROOT_PASSWORD="Minio1234"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration specifies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MINIO_VOLUMES&lt;/strong&gt;:- The directory where Minio will store data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MINIO_OPTS&lt;/strong&gt;:- Custom options, in this case, setting the console to be accessible on port 9001.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MINIO_ROOT_USER and MINIO_ROOT_PASSWORD&lt;/strong&gt;:- Credentials for accessing the Minio server.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Set File Permissions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To ensure that the minio user has the necessary permissions, we’ll change the ownership of the /opt/minio and /backup directories.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chown -R minio:minio /opt/minio
chown -R minio:minio /backup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command recursively sets the ownership of all files and directories under &lt;strong&gt;/opt/minio&lt;/strong&gt; and &lt;strong&gt;/backup&lt;/strong&gt; to the minio user and group.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 6: Configure Minio as a Systemd Service&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Systemd is a system and service manager for Linux. We’ll create a systemd service file for Minio, which will allow us to start, stop, and manage Minio like any other service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create the service file:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim /etc/systemd/system/minio.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Copy the following configuration into the file:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/opt/minio/bin/minio

[Service]
WorkingDirectory=/opt/minio

User=minio
Group=minio

#PermissionsStartOnly=true

EnvironmentFile=-/opt/minio/minio.conf
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /opt/minio/minio.conf\""

ExecStart=/opt/minio/bin/minio server $MINIO_OPTS $MINIO_VOLUMES 
StandardOutput=journal
StandardError=inherit
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0
# SIGTERM signal is used to stop Minio
KillSignal=SIGTERM
SendSIGKILL=no
SuccessExitStatus=0
[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration ensures that Minio starts with the correct environment settings and permissions, integrating smoothly with the Linux service management framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 7: Enable and Start the Minio Service&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To make sure Minio starts on boot and runs immediately, enable and start the service using the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl enable minio
systemctl start minio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 8: Verify Minio Service Status&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Finally, confirm that the Minio service is running correctly by checking its status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl status minio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see an output indicating that the service is active and running without issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 9: Secure Minio with SSL/TLS&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Additionally, to secure Minio with SSL/TLS encryption, follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Generate a Self-Signed SSL/TLS Certificate&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use the script below to generate a self-signed certificate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

# Prompt the user for each part of the subject
read -p "Enter Country (e.g., US): " COUNTRY
read -p "Enter State (e.g., California): " STATE
read -p "Enter Locality (e.g., San Francisco): " LOCALITY
read -p "Enter Organization (e.g., MyCompany): " ORGANIZATION
read -p "Enter Organizational Unit (e.g., IT): " ORG_UNIT
read -p "Enter Common Name (e.g., domain.com): " COMMON_NAME

# Construct the subject string
SUBJECT="/C=$COUNTRY/ST=$STATE/L=$LOCALITY/O=$ORGANIZATION/OU=$ORG_UNIT/CN=$COMMON_NAME"

# Prompt the user for the domain names or IPs to include in the SAN (Subject Alternative Name)
read -p "Enter the domain names or IP addresses for the SAN (comma-separated, e.g., domain.com, www.domain.com, 192.168.1.1): " DOMAINS

# Generate CA key and certificate
openssl genrsa -out CAcert.key 4096
openssl req -x509 -new -nodes -key CAcert.key -sha512 -days 3650 -out CAcert.crt -subj "$SUBJECT"

# Generate server key
openssl genrsa -out Server.key 4096

# Generate a CSR using the server key
openssl req -sha512 -new -key Server.key -out Server.csr -subj "$SUBJECT"

# Create v3.ext file with SAN entries
echo "authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names

[alt_names]" &amp;gt; v3.ext

# Convert the comma-separated domains/IPs into the v3.ext format
IFS=',' read -ra ADDR &amp;lt;&amp;lt;&amp;lt; "$DOMAINS"
for i in "${!ADDR[@]}"; do
    # Check if the input is an IP address or domain
    if [[ "${ADDR[$i]}" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
        echo "IP.$(($i + 1))=${ADDR[$i]}" &amp;gt;&amp;gt; v3.ext
    else
        echo "DNS.$(($i + 1))=${ADDR[$i]}" &amp;gt;&amp;gt; v3.ext
    fi
done

# Generate the server certificate using the CSR and CA certificate
openssl x509 -req -sha512 -days 3650 \
    -extfile v3.ext \
    -CA CAcert.crt -CAkey CAcert.key -CAcreateserial \
    -in Server.csr \
    -out Server.crt

# Clean up the serial file and CSR
rm -f Server.csr CAcert.srl

# Notify user of completion
echo "Self-signed SSL certificate and key have been generated:"
echo "CA Certificate: CAcert.crt"
echo "CA Key: CAcert.key"
echo "Server Certificate: Server.crt"
echo "Server Key: Server.key"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rename certificates&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rename the generated certificate files for Minio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv Server.crt public.crt
mv Server.key private.key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create the necessary directories for the certificate and copy ssl certificates in these directories&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create directories for the certificates and copy them into the appropriate locations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p /opt/minio/certs/CAs
mkdir -p /opt/minio/certs/internal-example.net
mkdir -p /opt/minio/certs/s3-example.net
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Copy Certificates&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Copy the certificates to the newly created directories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp CAcert.crt /opt/minio/certs/CAs
cp CAcert.key /opt/minio/certs/CAs
cp public.crt /opt/minio/certs/internal-example.net
cp private.key /opt/minio/certs/internal-example.net
cp public.crt /opt/minio/certs/s3-example.net
cp private.key /opt/minio/certs/s3-example.net
cp public.crt /opt/minio/certs
cp private.key /opt/minio/certs
chmod +x minio:minio /opt/minio/certs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Update Minio Configuration for SSL/TLS&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Edit the Minio configuration file to include the SSL certificate and key paths:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim /opt/minio/minio.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add or update the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MINIO_OPTS="--console-address :9001 --certs-dir /opt/minio/certs"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Restart Minio Service&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Restart the Minio service to apply the new SSL/TLS configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl restart minio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Verify SSL/TLS Configuration&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Access Minio via HTTPS at your domain. You should see that the connection is secured with SSL/TLS.&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%2F24wi2ci34cfs9k0pba8x.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%2F24wi2ci34cfs9k0pba8x.png" alt="Image description" width="800" height="392"&gt;&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%2Fbeegnjnxrc6iazvembug.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%2Fbeegnjnxrc6iazvembug.png" alt="Image description" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;By following these steps, Minio is now configured to securely handle your object storage needs, offering a reliable and scalable solution. If you have any questions or encounter issues, feel free to comment below. Keep exploring Linux and Kubernetes!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>linux</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Deploying and Managing Contour Ingress Controller on Kubernetes</title>
      <dc:creator>RD17🧑🏽‍💻</dc:creator>
      <pubDate>Mon, 02 Sep 2024 08:32:45 +0000</pubDate>
      <link>https://dev.to/rd17/deploying-and-managing-contour-ingress-controller-on-kubernetes-55a8</link>
      <guid>https://dev.to/rd17/deploying-and-managing-contour-ingress-controller-on-kubernetes-55a8</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In the Kubernetes ecosystem, managing external access to services within your cluster is a critical task. While NGINX is a popular choice for Ingress controllers, Contour, an Envoy-based Ingress controller, offers a powerful alternative with its high performance, scalability, and deep integration with the Envoy proxy. In this post, we’ll guide you through deploying Contour as an Ingress controller on your Kubernetes cluster.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Contour?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Contour is a Kubernetes-native Ingress controller that uses Envoy as its data plane. It provides advanced features such as dynamic service discovery, load balancing, and routing for your applications. With Contour, you gain fine-grained control over your traffic management, making it an excellent choice for modern microservices architectures.&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%2Fu5x7xv9owxper29nvl0z.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%2Fu5x7xv9owxper29nvl0z.png" alt="Image description" width="800" height="822"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why Contour?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Contour bridges gaps found in other solutions by offering several key advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dynamic Configuration Updates:&lt;/strong&gt; Contour dynamically updates Ingress configurations with minimal dropped connections, ensuring high availability and seamless transitions during changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-Tenancy Support:&lt;/strong&gt; It safely supports various types of Ingress configurations, making it ideal for multi-team Kubernetes clusters where different teams might have different requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Broad Protocol Support:&lt;/strong&gt; Contour supports multiple Ingress types, including Ingress/v1, HTTPProxy (a custom resource defined by Contour), and the emerging Gateway API, giving you flexibility in managing traffic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Seamless Kubernetes Integration:&lt;/strong&gt; Contour integrates cleanly with the Kubernetes object model, providing a native experience that leverages the full power of Kubernetes for traffic management.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before we begin, ensure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A running Kubernetes cluster. (Minikube, AKS, EKS, GKE, or any other)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;kubectl command-line tool configured to interact with your cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Helm installed on your local machine.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Deploy Contour with Helm&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Contour can be deployed quickly using Helm. First, add the Contour Helm repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, install Contour with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install contour bitnami/contour --namespace contour --create-namespace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Verify the Installation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After the installation is complete, verify that the Nginx Ingress Controller is running:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check Pods&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n contour
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check Services&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc -n contour
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see an output indicating that the contour Ingress Controller pods are running and that a service of type LoadBalancer is available.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Deploy an Nginx Pod&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To demonstrate the functionality of the contour Ingress Controller, we'll deploy a simple Nginx pod and expose it using a service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy an NGINX Pod&lt;/strong&gt;&lt;br&gt;
Deploying a pod is straightforward with the kubectl run command. This command creates a deployment with a single NGINX pod.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl run nginx-pod --image=nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expose the NGINX Pod&lt;/strong&gt;&lt;br&gt;
To access the NGINX pod, you need to expose it. Let’s create a Service of type ClusterIP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl expose pod nginx-pod --port=80 --type=ClusterIP --name=nginx-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Create a Secret for the SSL Certificate&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you plan to use TLS with your Ingress resource, you need to create a Kubernetes Secret to store your SSL certificate and private key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Convert SSL Certificate to Base64&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, convert your SSL certificate (tls.crt) and private key (tls.key) to base64:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat tls.crt | base64
cat tls.key | base64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create the Secret File:&lt;/strong&gt;&lt;br&gt;
Create a file named contour-tls-secret.yaml with the following content, replacing  and  with the actual base64 encoded values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Secret
metadata:
  name: example-tls
  namespace: default
data:
  tls.crt: &amp;lt;base64 encoded cert&amp;gt;
  tls.key: &amp;lt;base64 encoded key&amp;gt;
type: kubernetes.io/tls

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Deploy the Secret:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create -f contour-tls-secret.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Expose Your Application Using Ingress&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create an Ingress resource to expose your application, including TLS configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    kubernetes.io/ingress.class: contour
spec:
  tls:
  - hosts:
    - example.com
    secretName: example-tls-secret
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: example-service
            port:
              number: 80

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f example-ingress.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 6: Use HTTPProxy for Advanced Routing and TLS&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For more complex scenarios, create an HTTPProxy resource with TLS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: simple-httpproxy
  namespace: default
spec:
  virtualhost:
    fqdn: example.com
    tls:
      secretName: example-tls-secret
  routes:
  - conditions:
    - prefix: /
    services:
    - name: example-servic
      port: 80

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f example-httpproxy.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 7: Verifying Ingress and HTTPProxy Resources&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Once you've deployed the Ingress resource or HTTPProxy resource, you can verify their status using the following commands:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check Ingress Resources:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get ingress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check HTTPProxy Resources:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get httpproxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 8: Configure DNS Entry&lt;/p&gt;

&lt;p&gt;After deploying the Contour Ingress resource or the HTTPProxy resource, you need to map your domain name (e.g., example.com) to the external IP address of the Contour Ingress Controller's load balancer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get the Load Balancer IP:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the following command to get the external IP address&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc contour-envoy --namespace contour
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Update DNS Record:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you have the external IP address, update the DNS record for your domain to point to this IP address. This process will vary depending on your DNS provider, but generally, you will need to create an A record for example.com with the external IP address.&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%2F57v6ozw001tdmlsadajj.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%2F57v6ozw001tdmlsadajj.png" alt="Image description" width="800" height="108"&gt;&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%2Fp3vx3hx4j73pdftu8yxj.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%2Fp3vx3hx4j73pdftu8yxj.png" alt="Image description" width="800" height="98"&gt;&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%2Fx43yn8bp6xv1dnoga43t.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%2Fx43yn8bp6xv1dnoga43t.png" alt="Image description" width="800" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;By following these steps, the Contour Ingress Controller is now successfully deployed in your Kubernetes cluster using Helm.&lt;/p&gt;

&lt;p&gt;If you have any questions or encounter issues, feel free to comment below. Keep exploring Kubernetes and happy learning!&lt;/p&gt;

</description>
      <category>contour</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>ingress</category>
    </item>
    <item>
      <title>Deploying Nginx Ingress Controller Using Helm in Kubernetes.</title>
      <dc:creator>RD17🧑🏽‍💻</dc:creator>
      <pubDate>Sun, 28 Jul 2024 16:03:59 +0000</pubDate>
      <link>https://dev.to/rd17/deploying-nginx-ingress-controller-using-helm-in-kubernetes-47mm</link>
      <guid>https://dev.to/rd17/deploying-nginx-ingress-controller-using-helm-in-kubernetes-47mm</guid>
      <description>&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%2Fnqg9f63hrxx6qlzhy5rh.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%2Fnqg9f63hrxx6qlzhy5rh.png" alt="Image description" width="800" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In Kubernetes, an Ingress Controller is essential for managing external access to services within your cluster, typically HTTP and HTTPS. The Nginx Ingress Controller is one of the most popular Ingress Controllers available. This guide will walk you through deploying the Nginx Ingress Controller using Helm, a powerful package manager for Kubernetes.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before we begin, ensure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A running Kubernetes cluster. (Minikube, AKS, EKS, GKE, or any other)&lt;/li&gt;
&lt;li&gt;kubectl command-line tool configured to interact with your cluster.&lt;/li&gt;
&lt;li&gt;Helm installed on your local machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Install Helm&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you haven't installed Helm yet, you can do so using the following commands:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On MacOS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; brew install helm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;On Linux&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;On Windows(From Chocolatey/Scoop/Winget)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;choco install kubernetes-helm
scoop install helm
winget install Helm.Helm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify your Helm installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Add the Nginx Ingress Helm Repository&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Helm uses repositories to distribute charts. We need to add the official Nginx Ingress repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command adds the ingress-nginx repository and updates your Helm repository list to ensure you have the latest charts.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Install the Nginx Ingress Controller&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now, let's install the Nginx Ingress Controller using the Helm chart. We'll name our release k8s-nginx-ingress and install it into a new namespace called ingress-nginx.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm install k8s-nginx-ingress ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Breakdown of the Command:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;helm install:&lt;/strong&gt; Command to install a Helm chart.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;k8s-nginx-ingress:&lt;/strong&gt; Name of the Helm release.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ingress-nginx/ingress-nginx:&lt;/strong&gt; Specifies the chart to install from the ingress-nginx repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;--namespace ingress-nginx:&lt;/strong&gt; Namespace in which to install the Ingress Controller.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;--create-namespace:&lt;/strong&gt; Creates the namespace if it doesn’t already exist.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Verify the Installation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After the installation is complete, verify that the Nginx Ingress Controller is running:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check Pods&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods -n ingress-nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check Services&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc -n ingress-nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see an output indicating that the Nginx Ingress Controller pods are running and that a service of type LoadBalancer (or NodePort in some environments) is available.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Deploy an Nginx Pod&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To demonstrate the functionality of the Nginx Ingress Controller, we'll deploy a simple Nginx pod and expose it using a service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy an NGINX Pod&lt;/strong&gt;&lt;br&gt;
Deploying a pod is straightforward with the kubectl run command. This command creates a deployment with a single NGINX pod.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl run nginx-pod --image=nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expose the NGINX Pod&lt;/strong&gt;&lt;br&gt;
To access the NGINX pod, you need to expose it. Let’s create a Service of type ClusterIP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl expose pod nginx-pod --port=80 --type=ClusterIP --name=nginx-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 6: Create a Secret for the SSL Certificate&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you plan to use TLS with your Ingress resource, you need to create a Kubernetes Secret to store your SSL certificate and private key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Convert SSL Certificate to Base64&lt;/strong&gt;&lt;br&gt;
First, convert your SSL certificate (tls.crt) and private key (tls.key) to base64:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat tls.crt | base64
cat tls.key | base64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create the Secret File&lt;/strong&gt;&lt;br&gt;
Create a file named nginx-tls-secret.yaml with the following content, replacing  and  with the actual base64 encoded values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Secret
metadata:
  name: example-tls
  namespace: default
data:
  tls.crt: &amp;lt;base64 encoded cert&amp;gt;
  tls.key: &amp;lt;base64 encoded key&amp;gt;
type: kubernetes.io/tls

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Deploy the Secret&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create -f nginx-tls-secret.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 7: Create an Ingress Resource&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With the Nginx Ingress Controller and the Nginx pod running, you can now create an Ingress resource to route traffic to the Nginx service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Ingress Resource&lt;/strong&gt;&lt;br&gt;
Create a file named nginx-ingress.yaml with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-example
  namespace: default
spec:
  ingressClassName: nginx
  rules:
    - host: example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service: 
                name: nginx-service
                port:
                  number: 80
  # This section is only required if TLS is to be enabled for the Ingress
  tls:
    - hosts:
      - example.com
      secretName: example-tls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Deploy the Ingress Resource&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl create -f nginx-ingress.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 8: Configure DNS Entry&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After deploying the Nginx Ingress Controller and the Ingress resource, you need to map your domain name (example.com) to the external IP address of the Nginx Ingress Controller's load balancer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get the Load Balancer IP&lt;/strong&gt;&lt;br&gt;
Run the following command to get the external IP address assigned to the Nginx Ingress Controller's load balancer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc -n ingress-nginx
&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%2Fx5fcwxsc1s11mgycpdxb.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%2Fx5fcwxsc1s11mgycpdxb.png" alt="Image description" width="800" height="41"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update DNS Record&lt;/strong&gt;&lt;br&gt;
Once you have the external IP address, update the DNS record for your domain to point to this IP address. This process will vary depending on your DNS provider, but generally, you will need to create an A record for example.com with the external IP address.&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%2Fkxp67wlv1mxk9gdf8bgx.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%2Fkxp67wlv1mxk9gdf8bgx.png" alt="Image description" width="800" height="108"&gt;&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%2Fuq7jeplxgy4wwzumhia0.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%2Fuq7jeplxgy4wwzumhia0.png" alt="Image description" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;By following these steps, the Nginx Ingress Controller is now deployed in the Kubernetes cluster using Helm.&lt;/p&gt;

&lt;p&gt;If you have any questions or encounter issues, feel free to comment below. Keep exploring Kubernetes!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>networking</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Deploying Nginx on Linux (RHEL and Ubuntu)</title>
      <dc:creator>RD17🧑🏽‍💻</dc:creator>
      <pubDate>Thu, 18 Jul 2024 09:59:34 +0000</pubDate>
      <link>https://dev.to/rd17/deploying-nginx-on-linux-rhel-and-ubuntu-5gp6</link>
      <guid>https://dev.to/rd17/deploying-nginx-on-linux-rhel-and-ubuntu-5gp6</guid>
      <description>&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%2Fqvlak30d56sg0igdw1cd.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%2Fqvlak30d56sg0igdw1cd.png" alt="Image description" width="388" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nginx is a popular open-source web server used for serving static content, reverse proxying, load balancing, and more. This guide will walk you through installing and configuring Nginx on both RHEL and Ubuntu Linux distributions.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A running instance of either RHEL or Ubuntu.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Root or sudo privileges.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Update the System&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before installing any new packages, it’s a good practice to update your package index.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;##For RHEL:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo yum update -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;##For Ubuntu:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update -y
sudo apt upgrade -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Install Nginx&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;##For RHEL:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable the EPEL repository:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo yum install epel-release -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install Nginx:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo yum install nginx -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;##For Ubuntu:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install Nginx:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install nginx -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Start and Enable Nginx&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Ensure that Nginx starts on boot and is running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;##For RHEL:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start nginx
sudo systemctl enable nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;##For Ubuntu:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start nginx
sudo systemctl enable nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Configure Firewall&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Allow HTTP and HTTPS traffic through the firewall.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;##For RHEL:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-service=https
sudo firewall-cmd --reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;##For Ubuntu:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow 'Nginx Full'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Verify Nginx Installation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To verify that Nginx is installed and running, open a web browser and navigate to your server's IP address. You should see the default Nginx welcome page.&lt;/p&gt;

&lt;p&gt;Alternatively, you can use the following command to check Nginx’s status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 6: Basic Nginx Configuration&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Nginx configuration files are located in /etc/nginx directory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Main Configuration File:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The main configuration file is located at /etc/nginx/nginx.conf.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Site-Specific Configuration:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For RHEL: /etc/nginx/conf.d/default.conf&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For Ubuntu: /etc/nginx/sites-available/default&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Editing the Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can edit the default configuration file to customize your Nginx setup. For example, to change the root directory of your web server or to set up a reverse proxy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After making changes, you need to restart Nginx to apply the changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Step 7: Creating a Simple Website&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To create a simple HTML page served by Nginx, follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create a directory for your website:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir -p /var/www/html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create an HTML file:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /var/www/html/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Welcome to Nginx&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Hello, World!&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;This is a simple web page served by Nginx on Linux.&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Point Nginx to your website directory:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Edit the site-specific configuration file to set the root directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;##For RHEL:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/conf.d/default.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;##For Ubuntu:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/sites-available/default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the root directive to your new directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    server_name your_domain_or_IP;

    root /var/www/html;
    index index.html index.htm;

    location / {
        try_files $uri $uri/ =404;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Restart Nginx:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, navigate to your server's IP address in a web browser, and you should see your "Hello, World!" page.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You have successfully installed and configured Nginx on both RHEL and Ubuntu servers. From here, you can further customize Nginx to suit your needs, whether it's for serving static content, setting up reverse proxies, or load balancing. Happy hosting!&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>rhel</category>
      <category>nginx</category>
      <category>web</category>
    </item>
  </channel>
</rss>
