Microservices - Iowa State University

Preview:

Citation preview

MicroservicesBy Nicholas Pecka

Who am I?My name is Nicholas Pecka and I work for Red Hat

I’m part of the AMQ Streams team that focuses on providing reliable services for the community as well as the company

I assist in the development of a project called Strimzi that aims to streamline the deployment of Apache Kafka on Kubernetes

So let’s start with a question, does anyone know the term Microservices?

Microservices are…Packaged applications with minimal components

Great for DevOps and CI/CDAllows for greater control of resources

Unlike VM’s once a container is not in use the resources can be reclaimedAn answer for transitioning from traditional IT VM infrastructure

So how can one use Microservices?

Well… To understand that we need to know a little about our friend docker

What is Docker?The main method for deploying Microservices

A great way to deploy and test locally Associated with the concept of containers/containerization

Available for most if not all platforms

Great! So we have docker and can deploy any Microservice we want! Well be that as it may (and assuming you have proper

resources) let’s still look at some pro’s and con’s

Docker Pros / consGreat for developers to quickly spin up apps to test withSmall footprint so low attack surface and small storage

Scalability… Ya… goes out the window as more containers are deployedWith how rapidly updates come out, documentation cannot keep up with the frequency

So… Scalability… How do we solve for this issue?

Solving for scalability with DockerDrum roll please… du du du dahhh —> ORCHESTRATION TOOLS

These tools allow for management across many docker containersExamples of these tools

Docker SwarmKubernetes

Openshift … Red Hat :D !!!

Let’s look at one of these tools in particular

Kubernetes! Kubernetes! kuuuubernetessss!

One of the most well known orchestration tool for MicroservicesMany variants evolved from K8s including Openshift!

Solves scalability by introducing the concept of “Pods”Pods are a concept in K8s that bundle a multiple containers into a single entity for simple container management

But wait! There’s more!K8s allows containers to self-heal taking off some of the management overhead (No more having to manually go in and reboot

containers 1 by 1)!Monitoring goodness! K8s provides ability for monitoring with configurations for Prometheus and Grafana

SECURITY!!! K8s enables a more secure environment by defining new DNS zones, establishing namespaces, RBAC and more!

Ok… Microservices… Yay… So what’s your point?

So as stated prior, I work on the AMQ Streams team and Microservices are very important for

our workflow. Especially with our involvement/utilization with Openshift

To get a bit more granular, the tool we work on is Kafka. Kafka is important for

numerous organizations

So quick question… does anyone know what“Kafka” is?

Well first you need to know what a Pub/Sub model is

A Pub/Sub is…Publisher/Subscriber model

This model can ingest multiple data feeds and output 1 to many data feeds to 1 or many consumers

Kafka is…Pub/Sub developed by LinkedIn and then licensed by Apache

This means that it can take in messages from multiple producers and be ingested by multiple consumers

Different from a Queue in that when a message is consumed it is not lost until the retention period has expired

Our team would be most proactive in dealing with customers who want to streamline their

approach to using Kafka in their org whether that be traditional or the Microservice path

What is Kafka used for you ask?

An example would be something like an event streaming platform (ex. A SIEM for instance).

POP QUIZAnyone know what a SIEM is?

SIEM stands for Security Information and Event Management

Gartner Magic Quadrant

So now you all have a bit of an understanding of what Microservices and generally the AMQ Streams team goal is…

How about a demonstration!

DemonstrationDeploy Kafka using Strimzi on Minikube

Deploying Minikube (Windows)Install Minikube

https://minikube.sigs.k8s.io/docs/start/Install VirtualBox - (make sure to restart comp after install)

https://www.virtualbox.org/wiki/DownloadsInstall choco - (run command in powershell as admin)

Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1’))

Install Kubectl – (run command in powershell as admin)choco install kubernetes-cli

In cmd or powershell as admin run “minikube start”

Access Front-end applications on Minikube

By default you won’t be able to access any front facing apps in minikubeTo fix this, open a new cmd/powershell as admin and run “minikube tunnel”

This will open an external IP for applications using a loadbalancerTraverse to the external IP:Port found from “kubectl get svc”

Also to access a dashboard input “minikube dashboard”

Thank younpecka@iastate.edu

https://www.linkedin.com/in/npecka