<?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: Adya Prasad</title>
    <description>The latest articles on DEV Community by Adya Prasad (@adyaprasad).</description>
    <link>https://dev.to/adyaprasad</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%2F1504942%2F2334a54d-e1e2-4ef4-af77-e7e567593581.jpg</url>
      <title>DEV Community: Adya Prasad</title>
      <link>https://dev.to/adyaprasad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adyaprasad"/>
    <language>en</language>
    <item>
      <title>How to Build and Deploy Ingress Microservices in Kubernetes</title>
      <dc:creator>Adya Prasad</dc:creator>
      <pubDate>Sun, 15 Sep 2024 08:12:04 +0000</pubDate>
      <link>https://dev.to/adyaprasad/how-to-build-and-deploy-microservices-in-kubernetes-with-ingress-2007</link>
      <guid>https://dev.to/adyaprasad/how-to-build-and-deploy-microservices-in-kubernetes-with-ingress-2007</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;In the era of evolving technology, building problem-solving applications that can run consistently and scale effortlessly is becoming compulsory. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Microservices&lt;/strong&gt; is a common approach used to design scalable software systems (applications) where an application is composed of many small, loosely coupled, and independently deployable services. Each microservice focuses on a specific functionality and communicates via APIs or messaging systems with other services.&lt;/p&gt;

&lt;p&gt;This approach promotes modularity, scalability, and flexibility, making developing, maintaining, and scaling complex applications easier. And when you want to expose these services in production (outside world), you will use ingress.&lt;/p&gt;

&lt;p&gt;But deploying and managing these services can be tricky so we use &lt;em&gt;Kubernetes&lt;/em&gt;, which is a powerful container orchestration platform, as the go-to solution for scaling, managing, and deploying microservices.&lt;br&gt;
In this post, I will guide you on how to build and deploy Microservices in Kubernetes with a beginner’s friendly guide. I am also providing some Debug steps, in case you get any errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Key Definitions:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Microservices&lt;/strong&gt;: Microservices are an architectural approach to software development where software is composed of small independent services that communicate over well-defined APIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kubernetes&lt;/strong&gt;: Kubernetes is an open-source container orchestration platform that manages workloads and services. Also automate the deployment, scaling, portability, extensibility and management of applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pods&lt;/strong&gt;: The smallest deployable unit in Kubernetes, representing a single instance of a running process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ingress&lt;/strong&gt;: Ingress is an API object and collection of defined routing rules that expose (bring into the open) applications and manage external access by providing HTTP and HTTPS routes to services within a Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build and Deploy&lt;/strong&gt;: &lt;em&gt;Build&lt;/em&gt; is the process of creating and configuring the application source code, it includes gathering all components (like libraries, code and dependencies).
&lt;em&gt;Deploy&lt;/em&gt; (Deployment) is a process of making those build applications and running them on a server and accessible for users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;YAML file&lt;/strong&gt;: YAML or YML is a human-readable data serialization format used for configurations. It’s widely used in tools like Kubernetes and Docker for defining the configuration, workflow, and setting of an application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dockerfile&lt;/strong&gt;: Dockerfile is a text file that contains a series of instructions to containerise an application. It is like a blueprint that defines how your application should package respective services. Each microservices have its own Dockerfile.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ul&gt;
&lt;li&gt;Docker Desktop must be installed and set up on your local system.&lt;/li&gt;
&lt;li&gt;Your system must have proper installed and setup of Kubernetes with Minikube (via Docker Desktop)Docker installed on your local system&lt;/li&gt;
&lt;li&gt;Basic knowledge of YML files, Dockerfile, application files, and HTTPS routes.&lt;/li&gt;
&lt;li&gt;A text editor of your choice&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Start Building and Deploying Microservices in Kubernetes
&lt;/h2&gt;

&lt;p&gt;To kick off, we first focus on building our microservices. This involves writing the code for each service and pulling a Docker Image from &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt; that packages these services. Once our microservices are neatly packaged, we move on to the deployment phase and run it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What application you will learn to build?&lt;/strong&gt;&lt;br&gt;
In this guide, you will learn to build a Python &lt;em&gt;‘CRUD Task Management Services App’&lt;/em&gt; that provides you with a tangible example of a service that performs CRUD operations (Create, Read, Update, Delete) and demonstrates how to handle task management in a scalable way.&lt;/p&gt;

&lt;p&gt;I chose this topic because it is easy to set up and run locally for testing and development. You can choose the other app idea; the steps will be the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building Microservices
&lt;/h2&gt;

&lt;p&gt;We will use &lt;em&gt;two primary YAML files&lt;/em&gt; to deploy our microservices: &lt;code&gt;task-manager-app-service.yml&lt;/code&gt; and &lt;code&gt;ingress-route.yml&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  task-manager-app-service.yml
&lt;/h3&gt;

&lt;p&gt;The task-manager-app-service.yml file defines both a Deployment and a Service in Kubernetes. These two resources work together to ensure the application is deployed in the cluster and accessible.&lt;/p&gt;

&lt;p&gt;The Deployment ensures that a specified number of Pods (containers) are running your application. It uses the Docker image you built and pushed to Docker Hub.&lt;/p&gt;

&lt;p&gt;The Service creates a stable endpoint (crud-task-manager-service) to access the Pods. It uses the label (app: crud-task-manager) to identify which Pods it should route traffic to, and forwards requests to port 9001 on the Pods.&lt;/p&gt;

&lt;p&gt;Here is the code of &lt;code&gt;task-manager-app-service.yml&lt;/code&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;apps/v1&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;Deployment&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;crud-task-manager-deployment&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crud-task-manager&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;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crud-task-manager&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&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;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crud-task-manager&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;containers&lt;/span&gt;&lt;span class="pi"&gt;:&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;crud-task-manager&lt;/span&gt;
          &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myusername/crud-task-manager-service:latest&lt;/span&gt;
          &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;9001&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&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;Service&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;crud-task-manager-service&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;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;82&lt;/span&gt;
      &lt;span class="na"&gt;targetPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;9001&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crud-task-manager&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Here is the breakdown:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;apiVersion&lt;/strong&gt; : Specifies the Kubernetes API version to use for the Deployment resource (apps/v1).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;kind&lt;/strong&gt; : Defines the type of resource, which is a Deployment in this case.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;metadata&lt;/strong&gt; : Contains the name (crud-task-manager-deployment) and labels (app: crud-task-manager). Labels are key-value pairs used to identify and select objects in the cluster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;spec&lt;/strong&gt; : Describes the desired state of the Deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;replicas&lt;/strong&gt; : Indicates the number of identical Pods to run&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;image&lt;/strong&gt; : Specifies the Docker image to use (adyaprasad/crud-task-manager-service:latest). In the file, I set to pull images from the docker hub that I built for this microservice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ports&lt;/strong&gt; : Defines the port mapping the Service will be accessible set to port 82 (you can change if you want)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;targetPort&lt;/strong&gt; : The port on which the application inside the Pod is listening (9001)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ingress-route.yml
&lt;/h3&gt;

&lt;p&gt;The ingress-route.yml file defines an Ingress resource in Kubernetes. An Ingress is a set of rules that allows external HTTP and HTTPS traffic to access services within the Kubernetes cluster. It acts as a "gateway" to your services, allowing for custom routing based on the request's URL or hostname.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Ingress?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The primary purpose of using an Ingress is to provide flexible routing. Instead of exposing every Service on a different port (which can get complicated), an Ingress lets you use hostnames and paths to direct traffic to the correct Service.&lt;br&gt;
It also allows you to set up features like SSL/TLS termination and load balancing.&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;networking.k8s.io/v1&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;Ingress&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;task-manager-ingress&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;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;taskmanager.local&lt;/span&gt;
      &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&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;/&lt;/span&gt;
            &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
            &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;service&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;crud-task-manager-service&lt;/span&gt;
                &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;82&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Here is the breakdown:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;apiVersion&lt;/strong&gt; : This specifies the Kubernetes API version used to create the resource (networking.k8s.io/v1). This API version must be supported by the cluster to define an Ingress resource.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;kind&lt;/strong&gt; : Defines the resource type as an Ingress. The Ingress resource helps route incoming HTTP/HTTPS requests to the appropriate Service within the cluster.&lt;/li&gt;
&lt;li&gt;The spec section contains the rules for how incoming traffic should be routed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;host&lt;/strong&gt; : This specifies the domain name for which the Ingress is handling requests (taskmanager.local). In this case, it's a local hostname that will need to be set up in your system's &lt;strong&gt;hosts file&lt;/strong&gt; to point to the Minikube IP for testing. This allows requests sent to taskmanager.local to be processed by this Ingress.&lt;/li&gt;
&lt;li&gt;The rules in the Ingress specify that any HTTP request made to taskmanager.local on the root path (/) will be forwarded to the backend Service on port 82.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a real-world scenario, you might use a fully qualified domain name (e.g., example.com). In this local environment, use the taskmanager.local helps simulate how Ingress handles domain-based routing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps and commands to run these microservices on Kubernetes
&lt;/h3&gt;

&lt;p&gt;i&amp;gt; First, start your Docker Engine (make sure you are logged in)&lt;br&gt;
ii&amp;gt; Then start your Minikube, use this command in your shell&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

minikube start


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

&lt;/div&gt;

&lt;p&gt;iii&amp;gt; Add ingress addon in minikube, with the command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

minikube addons &lt;span class="nb"&gt;enable &lt;/span&gt;ingress


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

&lt;/div&gt;

&lt;p&gt;iv&amp;gt; Use the following command to create the Deployment and Service defined in &lt;code&gt;task-manager-app-service.yml&lt;/code&gt; in the Kubernetes cluster&lt;/p&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; task-manager-app-service.yml


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

&lt;/div&gt;

&lt;p&gt;v&amp;gt; Create and apply the Ingress resource &lt;code&gt;ingress-route.yml&lt;/code&gt; with command&lt;/p&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; ingress-route.yml


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

&lt;/div&gt;

&lt;p&gt;vi&amp;gt; Find your Minikube IP with the command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

minikube IP


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

&lt;/div&gt;

&lt;p&gt;vii&amp;gt; Start hosting and routing your app by updating your host file with command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&amp;lt;MINIKUBE_IP&amp;gt; taskmanager.local


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

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;for example&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

123.456.78.9 taskmanager.local


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

&lt;/div&gt;

&lt;p&gt;viii&amp;gt; Verify the deployment with these commands, you can see name in the output list: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

kubectl get deployments


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

kubectl get services


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

&lt;/div&gt;

&lt;p&gt;ix&amp;gt; Check and verify the setup of ingress:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

kubectl get ingress


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

&lt;/div&gt;

&lt;p&gt;x&amp;gt; Access your Microservice: &lt;a href="http://taskmanager.local" rel="noopener noreferrer"&gt;http://taskmanager.local&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

curl http://taskmanager.local/


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Getting any errors? Here are the Debug steps:
&lt;/h3&gt;

&lt;p&gt;1) First, Ensure that your Docker and Minikube are running, use command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

docker info


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

minikube status


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

&lt;/div&gt;

&lt;p&gt;If Docker and Minikube are not running you will get an error message and address below in Both’s outputs.&lt;/p&gt;

&lt;p&gt;2) Check your internet connection and make sure you are logged in docker hub, use command: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

docker login


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

&lt;/div&gt;

&lt;p&gt;3) Check that you enable the ingress addon in minikube with&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

minikube addons &lt;span class="nb"&gt;enable &lt;/span&gt;ingress


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

&lt;/div&gt;

&lt;p&gt;4) If your port is not working and you encounter Bind for 0.0.0.0:83 failed or port is already allocated, try to find which task is running on that port with the command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

netsat &lt;span class="nt"&gt;-a&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;Find the task and kill it or you can change the ports in your YAML files to unused ones (e.g., 82).&lt;/p&gt;

&lt;p&gt;5) If your localhost URL is not working, try to flush your DNS with command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ipconfig /flushdns


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

&lt;/div&gt;

&lt;p&gt;If you are still getting any errors, please comment. I will try to provide you with solution&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In this &lt;a href="https://dev.to/adyaprasad/how-to-build-and-deploy-microservices-in-kubernetes-with-ingress-2007"&gt;beginner guide&lt;/a&gt;, you learn how to build and deploy microservices in Kubernetes with Ingress for HTTP routing using a docker image from the docker hub repository and building yml files for both services.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Happy Learning and Deploying!&lt;/em&gt;&lt;/p&gt;

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