<?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: Peter Jaffray</title>
    <description>The latest articles on DEV Community by Peter Jaffray (@r11).</description>
    <link>https://dev.to/r11</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%2F710074%2Fab34bbcc-faac-4484-9a7e-88bb9f0e7866.png</url>
      <title>DEV Community: Peter Jaffray</title>
      <link>https://dev.to/r11</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/r11"/>
    <language>en</language>
    <item>
      <title>Install a Next.js app on a Kubernetes cluster using MetalLB</title>
      <dc:creator>Peter Jaffray</dc:creator>
      <pubDate>Mon, 23 Jan 2023 17:43:55 +0000</pubDate>
      <link>https://dev.to/r11/install-a-nextjs-app-on-a-kubernetes-cluster-using-metallb-19l3</link>
      <guid>https://dev.to/r11/install-a-nextjs-app-on-a-kubernetes-cluster-using-metallb-19l3</guid>
      <description>&lt;p&gt;Install a Next.js app on a Kubernetes cluster using MetalLB following these steps&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a Kubernetes cluster: You will need to have a Kubernetes cluster set up and running in order to deploy your Next.js app. There are various ways to set up a cluster, such as using a cloud provider like Google Kubernetes Engine (GKE) or Amazon Elastic Kubernetes Service (EKS), or by setting up a cluster on your own infrastructure using tools like kubeadm or kops.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install MetalLB: MetalLB is a load balancer that can be used to assign a public IP address to a service in a Kubernetes cluster. To install MetalLB, you will need to run the following command on your cluster:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/main/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/main/manifests/metallb.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a configuration file for MetalLB: You will need to create a configuration file that tells MetalLB which IP range it should use to assign IP addresses to services. You can create a configuration file using YAML.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a deployment and service for your Next.js app: You will need to create a deployment and a service for your Next.js app in order to deploy it to your Kubernetes cluster. You can do this by creating a deployment.yaml and a service.yaml file, then running the following command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Update your service to use a LoadBalancer: In order for your Next.js app to be accessible from the internet, you will need to update your service to use a LoadBalancer. You can do this by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
kubectl patch svc &amp;lt;your-service-name&amp;gt; -p '{"spec": {"type": "LoadBalancer"}}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Wait for MetalLB to assign an IP address: Once your service is updated to use a LoadBalancer, MetalLB will assign a public IP address to it. You can check the status of the IP address by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get svc &amp;lt;your-service-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take your time and read through the references. If you run into difficulty don't hesitate to ask for help in the comments below. &lt;/p&gt;

</description>
      <category>buildpacks</category>
      <category>springboot</category>
      <category>devops</category>
      <category>howto</category>
    </item>
  </channel>
</rss>
