Introduction and Application Architecture

This entry is part 1 of 11 in the series Kubernetes and everything else

Foreword

This series is created from my notes and small projects that I used to introduce clients to Kubernetes. After browsing the web I was puzzled that there are no good beginner-friendly resources online.

To be more accurate:

  • There are great resources for learning Kubernetes concepts and commands (The Interactive Tutorial) and
  • A myriad of resources for Container technologies.

But there is no introduction that demonstrates Kubernetes and the whole context it is in, and to understand Kubernetes the context, or how I will refer to it “the everything else” is the most difficult part. Let’s see what we will build.

 

Fig.1. Sentiment Analysis Web App

Application Demo

Our application has one functionality, it takes one sentence as input and using Text Analysis calculates the emotion of the sentence. See the demo in Figure 1 where the web app does Sentiment Analysis, but not type-checking.😋

From the technical perspective, three parts compose the application where each has a specific functionality (see Fig.2. below):

  • React JS deals with presenting information to the user and making requests to the Spring Web App.
  • Spring Web App forwards requests to the python flask application. (IRL Spring would contain features like authorizing users, registration etc.)
  • Python Flask application that performs the Sentiment Analysis.

The code for all of these applications can be found in this repository. We will be referring to files in this repository in most of the articles.

Who is this series for?

If you are a:

  • Manager/Product Owner: You will understand if your product needs Kubernetes, or not? (Read articles 1, 7 and 11)
  • Dev/DevOps inexperienced with Docker: You will learn Docker technologies and Kubernetes (Read articles 5 to 11)
  • Dev/DevOps experienced with Docker: You will learn Container Orchestration with Kubernetes (Read articles 7 to 11)
  • Dev/DevOps experienced with Kubernetes: You can quickly spin up an environment for testing new features or to introduce others to Kubernetes (Copy and paste commands from articles 8 to 11).
  • Junior Developer: You want to understand the latest technologies and everything else needed to ship software besides the code. (Read all articles)

Resources for the series

You can find the source code shown in the articles in this repository.

Architecture

In the upcoming articles, we will refer to the same Base Architecture. I call it “base” because in future articles we will expand it in order to illustrate more complex Kubernetes features.

Three microservices compose the Base Architecture:

  1. SA-Frontend – nginx web server hosting reactjs static files.
  2. SA-WebApp – spring web application for handling user requests.
  3. SA-Logic – flask python application for sentiment analysis.

    Fig. 2. Data flow in the Sentiment Analysis WebApp

And these microservices don’t live in Isolation, they enable Separation of Concerns but they still interact with each other (see Fig. 2.). This interaction is best illustrated by showing how the data flows between them:

  1. Client application requests index.html (which in turn requests bundled scripts of ReactJS application)
  2. ReactJS makes requests to the Spring WebApp.
  3. Spring WebApp forwards the requests for sentiment analysis to the Python app.
  4. Python App returns the response.
  5. Spring app returns the response to the React App. (Which then represents the information to the user)

So where are we: Purpose of the application [Check], Application Architecture [Check], let’s get started with the implementation.

 

 

Setting up the React Application >>
If you enjoyed the article, please share and comment below!
  • berlin

    Hello, what is the drawing software used in your blog? It looks cool. I also want to use it.

    • Rinor Maloku

      Visio, and stole a little from the style of Microsoft, and a little from the style of Google 😉