Microservices and Kubernetes: A Gardening Guide to Software Ecosystems

NGINX | March 30, 2023

Like gardening, software development requires an understanding of how different elements work together to create a beautiful, productive ecosystem. That was the catalyst for our choice of a gardening theme for this year’s Microservices March program. As is the case with any garden, one problematic weed keeps creeping into the conversation: what is the difference between microservices and Kubernetes?

Banner with title of this section -- Microservices: The Plants in Your Garden

Plants are the main elements of a garden’s ecosystem. They are the living organisms that comprise your garden and contribute to its beauty and functionality. Similarly, microservices are the main building blocks of modern software applications. They’re the individual services that perform specific functions and work together to create a larger, more complex application.

Like plants, microservices vary in size, shape, and purpose. Some are small and specialized, tasked with one operation. Others are larger, more generalized in their operations, or comprised of a cluster of the smaller components. For example, a strawberry plant is small and only generates strawberries. This is akin to a microservice that only processes credit card transactions (small and specialized). A more generalized plant like cilantro produces not only the leafy greens used in salsa and guacamole, but also the coriander seed. This kind of plant is akin to a service that handles user authentication (a larger and more general process).

Banner with title of this section -- Containers: The Pots for Your Microservices

Most plants need to be planted in soil so they can draw nutrients and moisture – leave them bareroot and they’ll die. While it’s perfectly acceptable to put them straight into the ground, many gardeners opt for container gardening with pots because it lets them customize the soil, better defend against pests, and move plants around the garden (or even inside for the winter). Similarly, you have multiple options for where to put microservices, with the most common aptly being in a “container”. A containerized microservice includes everything you need to run the app, and it’s easily portable across runtime environments.

Banner with title of this section -- Kubernetes: The Gardening Tools

So we’ve got our microservices (plants) in our containers (pots) but how do we deploy, maintain, and scale them? With tools! Enter Kubernetes. Kubernetes provides many features and add‑ons that make it easier to manage and maintain microservices, and it’s considered the de facto tool for container orchestration. For example, Kubernetes provides automated load balancing, service discovery, and self‑healing capabilities (to take some of the maintenance and monitoring work off the shoulders of your Devs). And when everyone wants your microservices (plants) to produce more? Kubernetes supports automatic scaling and rolling updates to keep your microservice applications running smoothly.

Note: Kubernetes alternatives, such as Docker Swarm and HashiCorp Nomad, offer much the same functionality.

Banner with title of this section -- Microservices Without Kubernetes: The 'Wild Garden' Option

We’ve established the case for using Kubernetes to manage microservices and prevent applications from growing wild and out of control. But Kubernetes and containers are not always necessary. Depending on the complexity of your application, you might instead choose to use a traditional virtual (or even physical) machine platform, which can still be deployed or provisioned using automation tools. These tools don’t provide the same level of automation and scalability as Kubernetes, but you might be okay with that tradeoff for less complicated or non‑critical apps. Another option is to use serverless computing platforms (such as AWS Lambda) that enable you to run your microservices code in response to events without worrying about the underlying infrastructure.

Banner with title of this section -- Not Everything in Kubernetes Is Microservices

Savvy gardeners know that companion planting – for example, marigolds alongside tomatoes – makes better use of resources and contributes to a healthier garden. Similarly, Kubernetes provides a wide range of features and add‑ons that make it good for more than microservices management. Kubernetes can be used for non‑microservices apps (such as machine learning models or monoliths), for instance. We see a lot of customers using Kubernetes to manage microservices and other applications, with some even deploying virtual machines (VMs) inside Kubernetes! This can be a great option for organizations that are transitioning legacy monolithic apps to a microservices‑oriented architecture.

Getting to the Root of the Matter

We hope you take two things away from this post (aside from a hankering to visit your local nursery):

  • Not everything deployed in Kubernetes is a microservice. The features and add‑ons Kubernetes provide make it a useful tool in a variety of ecosystems.
  • Microservices don’t always need to be managed with Kubernetes. Some applications flourish with alternative tools and a “wild garden” approach.

Check out the following resources for more details about the fundamentals of microservices:


Share

About the Author

Jenn Gile
Jenn GileHead of Product Marketing, NGINX

More blogs by Jenn Gile

Related Blog Posts

Automating Certificate Management in a Kubernetes Environment
NGINX | 10/05/2022

Automating Certificate Management in a Kubernetes Environment

Simplify cert management by providing unique, automatically renewed and updated certificates to your endpoints.

Secure Your API Gateway with NGINX App Protect WAF
NGINX | 05/26/2022

Secure Your API Gateway with NGINX App Protect WAF

As monoliths move to microservices, applications are developed faster than ever. Speed is necessary to stay competitive and APIs sit at the front of these rapid modernization efforts. But the popularity of APIs for application modernization has significant implications for app security.

How Do I Choose? API Gateway vs. Ingress Controller vs. Service Mesh
NGINX | 12/09/2021

How Do I Choose? API Gateway vs. Ingress Controller vs. Service Mesh

When you need an API gateway in Kubernetes, how do you choose among API gateway vs. Ingress controller vs. service mesh? We guide you through the decision, with sample scenarios for north-south and east-west API traffic, plus use cases where an API gateway is the right tool.

Deploying NGINX as an API Gateway, Part 2: Protecting Backend Services
NGINX | 01/20/2021

Deploying NGINX as an API Gateway, Part 2: Protecting Backend Services

In the second post in our API gateway series, Liam shows you how to batten down the hatches on your API services. You can use rate limiting, access restrictions, request size limits, and request body validation to frustrate illegitimate or overly burdensome requests.

New Joomla Exploit CVE-2015-8562
NGINX | 12/15/2015

New Joomla Exploit CVE-2015-8562

Read about the new zero day exploit in Joomla and see the NGINX configuration for how to apply a fix in NGINX or NGINX Plus.

Why Do I See “Welcome to nginx!” on My Favorite Website?
NGINX | 01/01/2014

Why Do I See “Welcome to nginx!” on My Favorite Website?

The ‘Welcome to NGINX!’ page is presented when NGINX web server software is installed on a computer but has not finished configuring

Deliver and Secure Every App
F5 application delivery and security solutions are built to ensure that every app and API deployed anywhere is fast, available, and secure. Learn how we can partner to deliver exceptional experiences every time.
Connect With Us
Microservices and Kubernetes: A Gardening Guide to Software Ecosystems | F5