Kubernates Intro

 

Today, Kubernetes is one of the most popular technologies used to deploy web services; in this article, I will briefly introduce how to build a deployment for a Java web service with Kubernetes.

Prerequisites

  • Spring WebFlux: This library is used to manage reactive projects in Java.
  • Clean Architecture: The project follows Martin Fowler's advice in the book "Clean Architecture."
  • Docker: This technology packages the essential components to deploy apps (you need to install it).
  • Minikube: This tool enables a local environment to work with Kubernetes  (you need to install it).
  • Kubectl is a client that works with the Kubernetes cluster  (you need to install it). 

 

Object in Kubernetes 

Kubernetes (K8s) is an open-source platform to automate application implementation, scaling, and management of containers. Kubernetes's objects are components that are deployed to manage different features; the following elements are the basics of this technology:

  • Pod: It is the primary component of Kubernetes. It wraps a docker container.
  • Deployment: It is the controller that manages the pod deployment.  
  • Services: This component allows the connection between pods.
  • Namespace: It allows organizing the deployment by folders(names)
  • Volume: Persistence layer to save information in Kubernetes.

 

The Project

It is an authorization app to sign Up and Sign In; the most relevant part is the file "deployment-auth.yaml" The leading labels in this archive are:

  • Kind: the type of manifest, for instance, Deployment or Service.
  • Template: the labels to match with the service.
  • Containers: Docker container to be deployed.

 


Deploy app.

To deploy the app, get into the deployment folder and execute the command  "kubectl apply -f deployment-auth.yaml" in the console: 



You can show the pod deployment in the cluster with the command "kubectl get pods": 

 



Conclusion.

This app uses reactive programming to do a sign-up option; the plot idea is to show how to add a single deployment/service object in Kubernetes to fulfill an essential requirement to deploy it. In the following post, I'll show more complex scenarios; this is the git repository for the project.


Comments

Popular posts from this blog

FILE SERVER

Kubernates configMaps and Volumes