How many microservices per kubernetes pod?

How many microservices should I have per Kubernetes Pod? This is the question I had when I first encountered Kubernetes when trying to decide how to deploy my Microservice architecture based application.

When reading through Kubernetes documentation or watching videos about kubernetes, you are told a pod holds one or more containers. So your first question if you are doing microservices probably is. How many microservices do I put per pod if each microservice goes into a container? I mean it sort of seems like you could put all of your microservices in containers then put those in a pod.  You could do this, but it is not the correct way.

I kept digging and digging until I found a definitive answer. This video helped. It does a great job of explaining what a Pod is in Kubernetes and how it relates to microservices.

So as you can see each microservice goes into a container and each container becomes a pod. Therefore the answer is you should place one microservice per pod. However, as noted if your microservice container relies on something else then you also place that inside the pod, but do not place more than one microservice in a pod. If you are wondering more about when you would use more than one container in a pod this article gives examples.

Another question you may have is how many pods can you have per node? That is totally up to who you are using as your host, if you are using cloud services then many will list the limit. Here is a link I found about Amazon cloud instance limits.

Links

Here is a link to the documentation shown in the video about PODS.

Here is a link the the Kubernetes API documentation shown in the video.

Here is a link to more Kubernetes resources.

Kubernetes resources

Kubernetes resource list

Kubernetes and Microservices go hand in hand. Basically you don’t want to do one without the other. Kubernetes is a container orchestration software. When you build a system based on the Microservice architecture you need a way to package and run those microservices on the cloud.

The traditional way of preparing a machine by running scripts which download software and prepare a server environment to run your applications are over. It is far easier to roll your Microservices up into a container with all of it’s requirements and then deploy the container.

However, once you get all of your microservices into containers you need a way for them to find each other and work together as a team to form a larger application. This is where Kubernetes comes in. With Kubernetes you use YAML files to describe your system and how you would like your system to be maintained. Once you describe your system Kubernetes works hard to keep it in the way you describe it.

Kubernetes monitors your Microservice containers. When one crashes Kubernetes fires up another. When traffic is too much for a single Microservice node Kubernetes fires up another identical node and load balances the requests, when traffic reduces Kubernetes reduces the identical node count. Kubernetes is a dream come true for Microservice based applications.

Kubernetes is highly complex and takes a lot of time to master. That is why I suggest using Openshift. Openshift interacts with the Kubernetes api for you which makes everything much easier. You should still have a basic understanding of Kubernetes since Openshift is built on top of Kubernetes. OpenShift is one of the final links in the modern DevOps pipleline. Here is a link to more resources and information about OpenShift.

Articles

Here is a link to the main Kubernetes website.

Here is a link to a glossary of  Kubernetes terms

What is Kubernetes a beginners guide.

Here is a link to a page explaining Kubernetes Terminology. There are so many new terms this article makes it easy to find the meaning of Pods, Nodes, Clusters etc.

Here is the documentation overview link.

Here is a link to the kubernetes tutorials page.

Here is a link to the list of kubernetes api programming language clients for interacting with the Kubernetes API directly in your applications code.

Here is a link to the Kubetcl  online free book about kubernetes.

Kubernetes clusters and node size suggestions. This article will help you decide how large your node instances should be and how many nodes you should include in your cluster.

Kubernetes cluster autoscaler link on github.

List of Amazon cloud instance kubernetes POD limit per instance.

Kubernetes bootcamp website. This cool website walks you through the basics of Kubernetes.

Videos

Kubernetes Architecture Simplified | K8s Explained in 10 Minutes


Organizing Kubernetes with Namespaces (Kubernetes Best Practices)


Kubernetes: One Cluster or Many?


Microservices, Kubernetes, and Application Modernization Done Right


Deploying Microservices in Kubernetes – Webinar by Certified Kubernetes Administrator Janakiram MSV

This video contains useful information about Kubernetes, Microservices and Launching a Microservice based application with Kubernetes. The beginning of this video starts out explaining how the traditional Monolithic architecture worked. It then moves onto how Microservice architectures work and continues by providing a comparison of the two. At ~22:45 the video starts to talk about deploying with Kubernetes

Kubernetes Architecture Made Easy | Coupon: UDEMYJAN20 | Udemy: Kubernetes Made Easy | K8s Tutorial


Kubernetes in 5 minutes

This video quickly gives an overview of kubernetes. It could go higher up on the list, but this is where it is.

Redhat developer resources

My list of resources and information about Redhat software etc.

RedHat OpenShift developer resources. This page has many links to free books, videos, articles etc.

Building containerized applications Lots of useful information and resources here. This covers some of the tools RedHat offers for development with containers such as Buildah, Podman and Skopeo. It has a link for a free Ebook about using PodMan. It also has many links to tutorials.

Ebook Introduction to Enterprise Kubernetes. This covers what RedHat OpenShift does for kubernetes deployments.

RedHat OpenShift for Developers This article quickly explains what OpenShift offers developers it has some great links to more resources.

RedHat OpenShift 4 CodeReady Containers . This page talks about running OpenShift clusters on your local desktop/laptop

Local OpenShift Development Environment on Windows. This shows how to install, run and use OpenShift CodeReady containers on your local machine. This is useful for learning how OpenShift works and testing your projects. This only works on computers with Windows 10

OpenShift CodeReady Container documentation. This is the documentation to CodeReady Containers mentioned above.

 

 

 

OpenShift information and resources

OpenShift information and resources page

OpenShift is a useful developer toolset.

Articles

Building Scala and SBT Applications on OpenShift
Disaster Recovery Strategies for Applications Running on OpenShift

OpenShift vs Kubernetes  This article covers the differences between OpenShift and Regular old Kubernetes.

What is OpenShift?

Once you decide you want to use Kubernetes you need some way to host your apps. Meet OpenShift

 


OpenShift Technical Overview


Building and running micro services on OpenShift: Part I

This video has some useful technical information about how OpenShift works.


Building and running micro services on OpenShift: Part II

This video has some useful technical information about how OpenShift works with Kubernetes to orchestrate your application and help it scale up and down in response to traffic.


Building and running Microservices on OpenShift: Part III

This video further covers some of the basic features of OpenShift from a developers standpoint.


Demo – Deploying from GitLab to OpenShift Container Cluster


OpenShift for Beginners – CI/CD & DevOps – Builds and Build Triggers


Create Your Own Build Pipelines with OpenShift 3.3, Part I


OpenShift 4 CI/CD Pipelines

Container technology resources and information

Containers are quickly and drastically changing the way we build and deploy apps these days. Containers make deployment easier and faster by providing the exact environment that your code needs to operate. However, with this power and ease comes complexity.

First off there are various container technologies, but the most common is Docker.

Articles and links

Link to the Openshift Startup program membership page.

Link to Kubernetes free ebook. What to know before adopting kubernetes .

This is a really good link to a page full of OpenShift resources, videos, articles etc.

Link to Official OpenShift platform youtube page.

Link to OpenShift Demos and Developer info video playlist on youtube. This has some videos about version 3 but they are still useful as an overview of how OpenShift works etc.

What are the New Features of OpenShift 4? This article covers the new features in OpenShift.

OpenShift vs Kubernetes: What are the Differences?  Basically Openshift uses Kubernetes under the hood and offers improved features especially to security. One of the main reasons I never used Docker and Kubernetes was due to running all containers in root mode. That just begs to be hacked and destroyed. So when I realized that is how it worked I moved on. Now someone has done something about the lunacy.

CRI-O container engine runtime for kubernets

Containerization Explained

The Following video explains containerization technology.

This video actually does a Virtual Machine vs Container comparison which is handy information to know. When I first started down the Microservices route I was using Virtual Machines to emulate environments. Now I can just use Docker. The VM ate tons of resources.


Introduction To Docker and Docker Containers

This next video is about Docker and containerization. It covers some of what was in the above video but explains Docker.


Docker Tutorial – What is Docker & Docker Containers, Images, etc?

I really like this video it does a nice job of explaining Docker with diagrams.


Docker Tutorial for Beginners – A Full DevOps Course on How to Run Applications in Containers

Once you know what Docker is you will want to know how to use it. This is a Two Hour tutorial course on Docker.


Container Orchestration Explained


What is Kubernetes

Once you learn about containers and Docker you then need to know how to orchestrate your applications Docker containers. Kubernetes is an orchestrator for containers.


Kubernetes for Beginners – Docker Introduction in 15 Minutes

This video explains more about containerization, docker, kubernetes and why you would want to use them.


What is OpenShift?

Once you decide you want to use Kubernetes you need some way to host your apps. Meet OpenShift

 


OpenShift Technical Overview


Building and running micro services on OpenShift: Part I

This video has some useful technical information about how OpenShift works.


Building and running micro services on OpenShift: Part II

This video has some useful technical information about how OpenShift works with Kubernetes to orchestrate your application and help it scale up and down in response to traffic.


Building and running Microservices on OpenShift: Part III

This video further covers some of the basic features of OpenShift from a developers standpoint.


Demo – Deploying from GitLab to OpenShift Container Cluster

Random Scala stuff for newbs

Random Scala stuff for newcomers

The Scala ecosystem is huge. All kinds of tools, new tools, special tools, tool tools. Some are familiar to Java people, some are Scala specific. This page is a collection of tools I have encountered and things new people will find helpful. There is also the Scala resources page and many other resources listed in the resources page. This page lists some of the things you will encounter first. You should also check out the Scala Best Practices page. Which has links to articles, pdfs and other information about Scala best practices. Maybe you would enjoy a good Scala/Java joke this is how I chose Scala over Java LOL. You might also check out my page that lists Scala Frameworks and tools 

The IDE-A

You will need an IDE and I suggest IntelliJ IDEA . I used to use Netbeans and tried eclipse, but Intellij seems to work the best and is the most preferred by Scala Devs. I use the free version and have not tried the paid edition yet, but it adds features I may find handy when I really get to writing Scala code. I use Windows. The first time I installed Intellij and started it, it hung up and froze badly. If this happens just restart windows. That is what worked for me and it has worked every since. I think it messed up during install some how.

SBT

First you must install SBT. Forget maven, gradle etc. Everything is SBT. If you don’t want to use SBT you are in a huge world of hurt like the kind of person who wants to swim upstream in rapids during a snow melt flood. So first you must read all about SBT. Everything everywhere refers to SBT so don’t fight it, just learn it.

Link to SBT website.

Link to the Scala website on how to use SBT with Scala.

Link to the SBT section of the Scala Book. I wish this book was around when I started learning Scala.

I like this book and would suggest it. It is from 2016 and right now it is only $1.99 US used, but it won’t be long watch. SBT in Action by Joshua Suereth and Matthwe Farwell

Giter8

You will constantly run into references of Giter8 in Play, Lagom and other frameworks etc. Giter8 makes setting up Scala projects much easier. It is basically a template system that you use through the command line which quickly creates the project structure for you with the basic files and folders needed.
Giter8 documentation 

Conscript

You will need this for Giter8. A wicked web we weave. Conscript makes it easier to install Giter8 and other Scala command line tools. Read the Conscript documentation and information, it is really a nice little tool.

Scala Best Practices

Scala allows so much freedom that you must absolutely use some best practices. This page contains links to best practices that I have found useful. Many of these are repetitive some are not. Some do better at explaining some concepts than others. This is why I like multiple references to the same subject for cross referencing. There are lots of things to avoid in Scala for many reasons. Scala is one of those languages you should know well before using it to build something Enterprise. Following these best practices can help you as you along your way. Because if you are like me you don’t care to get to really know Scala first. LOL

Scala Best Practices – A good place to start.

Even more best practices from Alexandru on github

Here is some good information about picking good names for classes/functions etc and clean coding.

This short article about Scala best practices has some redundant information as above, but it also has some unique information and insights.

This isn’t really an article it is a page with a list of articles related to some best practices.

Here is a decent pdf from Brown university about some Scala best practices.