<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ReplicaSet-Controller]]></title><description><![CDATA[ReplicaSet-Controller]]></description><link>https://replicasetk8s.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 08:54:56 GMT</lastBuildDate><atom:link href="https://replicasetk8s.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Deploying Scalable HTTPD Applications on Kubernetes using ReplicaSet and LoadBalancer with Apple & Chinnu]]></title><description><![CDATA[🧱 Deploying Scalable HTTPD Applications Using ReplicaSet and LoadBalancer in Kubernetes
👋 Introduction
In this blog, we explore how to deploy and expose a scalable HTTPD application using Kubernetes ReplicaSet with multiple label selectors. We'll w...]]></description><link>https://replicasetk8s.hashnode.dev/deploying-scalable-httpd-applications-on-kubernetes-using-replicaset-and-loadbalancer-with-apple-and-chinnu</link><guid isPermaLink="true">https://replicasetk8s.hashnode.dev/deploying-scalable-httpd-applications-on-kubernetes-using-replicaset-and-loadbalancer-with-apple-and-chinnu</guid><category><![CDATA[#k8scluster]]></category><category><![CDATA[k8s]]></category><category><![CDATA[k8s commands ]]></category><category><![CDATA[replicaset]]></category><category><![CDATA[Load Balancing]]></category><category><![CDATA[replication]]></category><category><![CDATA[dockerhub]]></category><category><![CDATA[docker images]]></category><dc:creator><![CDATA[BHASHWANTH PALUKURI]]></dc:creator><pubDate>Sun, 25 May 2025 15:12:08 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-deploying-scalable-httpd-applications-using-replicaset-and-loadbalancer-in-kubernetes">🧱 <strong>Deploying Scalable HTTPD Applications Using ReplicaSet and LoadBalancer in Kubernetes</strong></h2>
<h3 id="heading-introduction">👋 Introduction</h3>
<p>In this blog, we explore how to deploy and expose a scalable HTTPD application using Kubernetes <strong>ReplicaSet</strong> with <strong>multiple label selectors</strong>. We'll walk through:</p>
<ul>
<li><p>Creating a ReplicaSet with <code>matchExpressions</code></p>
</li>
<li><p>Deploying an HTTPD-based container</p>
</li>
<li><p>Exposing it via a <strong>LoadBalancer</strong> service</p>
</li>
<li><p>Using custom labels like <strong>apple</strong> and <strong>chinnu</strong></p>
</li>
</ul>
<hr />
<h3 id="heading-file-structure">📁 File Structure</h3>
<pre><code class="lang-plaintext">bashCopyEdit[root@ip-172-31-89-85 ReplicaSet]# tree
.
├── loadbalancer-rc.yml
└── rs.yml

0 directories, 2 files
</code></pre>
<hr />
<h3 id="heading-rsyml-replicaset-manifest">📦 rs.yml (ReplicaSet Manifest)</h3>
<pre><code class="lang-plaintext">yamlCopyEdit---
apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: myrs-1
spec:
  replicas: 5
  selector:
    matchExpressions:
      - key: microsoft
        operator: In
        values:
          - apple
          - palukuri
          - bhashwanth
      - key: google
        operator: In
        values:
          - chinnu
  template:
    metadata:
      labels:
        microsoft: apple
        google: chinnu
    spec:
      containers:
        - name: container-rs-1
          image: httpd
          ports:
            - containerPort: 80
</code></pre>
<hr />
<h3 id="heading-loadbalancer-rcyml-service-manifest">🌐 loadbalancer-rc.yml (Service Manifest)</h3>
<pre><code class="lang-plaintext">yamlCopyEdit---
apiVersion: v1
kind: Service
metadata:
  name: loadbalancer-service-for-rs
spec:
  type: LoadBalancer
  selector:
    microsoft: apple
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30009
</code></pre>
<hr />
<h3 id="heading-steps-to-deploy">🔧 Steps to Deploy</h3>
<ol>
<li><strong>Apply the ReplicaSet</strong></li>
</ol>
<pre><code class="lang-plaintext">bashCopyEditkubectl apply -f rs.yml
</code></pre>
<ol start="2">
<li><strong>Check the Pods</strong></li>
</ol>
<pre><code class="lang-plaintext">bashCopyEditkubectl get pods -l microsoft=apple
</code></pre>
<ol start="3">
<li><strong>Apply the LoadBalancer Service</strong></li>
</ol>
<pre><code class="lang-plaintext">bashCopyEditkubectl apply -f loadbalancer-rc.yml
</code></pre>
<ol start="4">
<li><strong>Expose and Access the App</strong></li>
</ol>
<pre><code class="lang-plaintext">bashCopyEditkubectl get svc loadbalancer-service-for-rs
</code></pre>
<p>Use the <strong>EXTERNAL-IP:80</strong> (or <strong>NodeIP:NodePort</strong>) to access the HTTPD application.</p>
<hr />
<h3 id="heading-output-snapshots">✅ Output Snapshots</h3>
<p>📌 <strong>Pods Running (5 replicas):</strong></p>
<pre><code class="lang-plaintext">bashCopyEditNAME               READY   STATUS    RESTARTS   AGE
myrs-1-abcde       1/1     Running   0          1m
myrs-1-fghij       1/1     Running   0          1m
...
</code></pre>
<p>📌 <strong>Service Exposed:</strong></p>
<pre><code class="lang-plaintext">bashCopyEditNAME                          TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
loadbalancer-service-for-rs   LoadBalancer   10.100.200.10    &lt;pending&gt;     80:30009/TCP   1m
</code></pre>
<p>📌 <strong>Application in Browser:</strong><br />Visit <code>http://&lt;NodeIP&gt;:30009</code> → You'll see the default Apache HTTPD welcome page.</p>
<hr />
<h3 id="heading-conclusion">🎉 Conclusion</h3>
<p>You now have a highly available HTTPD application running in a Kubernetes cluster using a <strong>ReplicaSet with multiple label selectors</strong> and exposed using a <strong>LoadBalancer</strong>. This kind of setup is helpful for grouping pods using complex label logic and scaling deployments easily.</p>
]]></content:encoded></item></channel></rss>