How to Build CI/CD Pipelines for a Microservices Application

Rate this content
Bookmark

Microservices present many advantages for running modern software, but they also bring new challenges for both Deployment and Operational tasks. This session will discuss advantages and challenges of microservices and review the best practices of developing a microservice-based architecture.

We will discuss how container orchestration using Kubernetes or Red Hat OpenShift can help us and bring it all together with an example of Continuous Integration and Continuous Delivery (CI/CD) pipelines on top of OpenShift.

This talk has been presented at DevOps.js Conf 2021, check out the latest edition of this JavaScript Conference.

FAQ

Microservices offer increased agility, allowing faster deployments compared to monolithic architectures. They enable independent scaling and deployment of different services, support diverse technology stacks, and manage conflicting dependencies more effectively.

Containers provide a consistent and isolated environment for microservices, simplifying deployment and scaling by ensuring that the application runs the same way in any environment. This approach addresses the 'it works on my machine' problem by packaging applications with their dependencies.

Microservices can introduce complexities such as managing multiple service interactions and maintaining data consistency across distributed systems. Network issues can cause cascading failures, and the architecture can increase communication overhead and latency.

In microservices architecture, a container acts as the smallest unit of computation, encapsulating a microservice and its dependencies in a lightweight, portable, and executable environment, ensuring consistency across different deployment platforms.

Ideally, each microservice manages its own database to ensure loose coupling and service autonomy. However, in practice, managing separate databases for each service can be challenging, and sometimes shared databases are used, which can complicate the architecture.

To manage multiple API versions, services should clearly version their APIs and maintain backward compatibility for a period. This involves supporting multiple versions simultaneously and gradually phasing out older versions, ensuring smooth transitions and minimal disruption.

Kubernetes provides robust orchestration for microservices, handling automated deployment, scaling, and management of containerized applications. It supports high availability, load balancing, and a vibrant ecosystem, making it a standard choice for deploying microservices.

CI/CD for microservices on Kubernetes can be achieved using cloud-native CI/CD tools like Tekton, which provide pipelines as code and are designed to work natively with Kubernetes, ensuring seamless integration and deployment.

Sasha Rosenbaum
Sasha Rosenbaum
33 min
01 Jul, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk discusses the benefits of microservices and containers for building CI-CD pipelines. It explains how container technology enables portability and scalability. The challenges of microservices include network communication and testing in isolation. The Talk introduces Tacton, a cloud-native CICD pipeline for Kubernetes, and highlights the use of GitOps and Argo CD. It also discusses the importance of maintaining referential integrity between microservices and the evolving role of operators in the DevOps world.

1. Introduction and Background

Short description:

Hi, I'm Sasha Rosenbaum, and today I'm presenting on building CI-CD for microservices applications. I have been in development, operations, dev route, and customer success. I've been involved in DevOps days since 2014. You can find me on Twitter as devineops.

Hi, I'm Sasha Rosenbaum, and today I'm presenting to you on building CI-CD for microservices applications. So first, just a little bit of an introduction about me. I am currently a Team Lead on a managed OpenShift BlackBell team at Red Hat. And in my career, I have been in development, in operations, briefly in dev route, and I spent quite a bit of time in customer success. I still consider myself a developer. But as you can see, I've done a lot of different things along the 15 years that I've been in this industry.

I've been involved in DevOps days since 2014. You can see on the chart as well. And you can find me on Twitter as devineops. I post a lot of cat pictures and some Twitter, some technical hot takes. So please feel free to follow me on Twitter.

2. Microservices and Their Benefits

Short description:

So let's talk about microservices. Once upon a time, there was a monolith, and it was easier to deal with because you had full control. However, there were challenges, such as collaboration between different teams and the need for regression testing. The solution to these challenges became microservices, which involve modularizing different parts of the application and breaking them into separate services. Each microservice is ideally supposed to own its own data. Microservices separate by business logic.

So let's talk about microservices. As I was building this presentation, I was thinking that in addition to how to do things, it's also important to talk about why we're doing things. And especially if we are talking from a developer standpoint, it's important to talk about why we even use microservices, why we use containers, and dive into kind of overview of the entire architecture.

So let's start with this. Once upon a time, there was a monolith, right? And the monolith was pretty, and we actually enjoyed working with a monolith, and everything was relatively okay. And to tell you a little secret that no one likes to talk about anymore, is that monolith was actually easier to deal with, because monolith, you had full control over all the parts of your application, all of your dependencies, and all of your things. And also because distributed systems are hard, and that's just a universal truth.

But monolith also had challenges and these challenges were among many. So many different teams needed to collaborate. So you had to collaborate across different parts of a company. And if the company was large, that often meant that something like a large airline.com became a behemoth, became a huge beast and all the different teams had to be involved in building that huge application. Everyone had to be using the same technology. So if one team really liked Java and another team really likes C-sharp, they had to choose between them. They had to use both, or same with different OS types and things like that. Every change required a regression testing of the entire system, which can be quite time-consuming. Deployment therefore was slow, right? Because teams were often running into merge hell and scaling was difficult. So scaling a huge beast of an application is usually not a picnic. So because we had challenges where there's challenges, there's always solutions. And in this particular case the solution became microservices.

So what's really microservices? We started with an application, and then we started talking about proper patterns of development. So we modularized different parts of application. And then we started talking about breaking these different modules into different services. And as we went, it became a network of services. In proper implementation, each microservice also is supposed to own their own data. In practice, this doesn't always happen, but this is the implementation best practice for each microservice to also own the database. So I often hear questions about service oriented architecture versus microservices. So if you're on the left of this diagram, and you have a data layer, and you have a business logic layer, and you have a web layer, even if these three layers are separate, you're in microservices. Separating by vertical concerns is still not microservices. Microservices separate by business logic. So in this case, for instance, authentication would be a separate microservice.

QnA