Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • See all Red Hat products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Red Hat OpenShift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • See all technologies
    • Programming languages & frameworks

      • Java
      • Python
      • JavaScript
    • System design & architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer experience

      • Productivity
      • Tools
      • GitOps
    • Automated data processing

      • AI/ML
      • Data science
      • Apache Kafka on Kubernetes
    • Platform engineering

      • DevOps
      • DevSecOps
      • Red Hat Ansible Automation Platform for applications and services
    • Secure development & architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & cloud native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • See all learning resources

    E-books

    • GitOps cookbook
    • Podman in action
    • Kubernetes operators
    • The path to GitOps
    • See all e-books

    Cheat sheets

    • Linux commands
    • Bash commands
    • Git
    • systemd commands
    • See all cheat sheets

    Documentation

    • Product documentation
    • API catalog
    • Legacy documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore the Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Deploying Microservices on OpenShift using Kubernetes

August 16, 2016
Christopher Tozzi
Related topics:
KubernetesContainersMicroservices
Related products:
Red Hat OpenShift Container Platform

    You’ve heard of microservices. You’ve heard of OpenShift. You’ve heard of Kubernetes. Actually, you may already have considerable experience with each of these three concepts and tools.

    But do you know how to combine all of them in order to deploy microservices effectively? If not, this article is for you. Below, I’ll explain how microservices, OpenShift and Kubernetes fit together, and provide an overview of how you can leverage the orchestration tools provided by OpenShift and Kubernetes in order to build and deploy microservices at scale.

    What are microservices?

    First things first: Let’s define what "microservice" means for our purposes.

    Different people use this term to refer to different things. Some, especially in the media, seem to treat microservices as merely a synonym for containers. But that’s a simplistic interpretation.

    Or, if you’re old school, you may think of the monolithic kernel vs. microkernel debate (which was made famous by the Torvalds-Tanenbaum flame war of 1992) when you hear someone mention microservices. Microkernels are a similar concept, but they’re not what microservices are all about today.

    Personally, I think Martin Fowler’s definition of microservices sums them up best. In his telling, a microservice is a type of service that has five main features:

    • Each instance of the service is independently deployable.
    • Each part of the service is scalable.
    • The service is composed of modular parts.
    • Each part of the service can be implemented in different ways (using different programming languages, for instance), but all parts are compatible with one another.
    • Each service can be managed by a different team.

    These characteristics distinguish microservices from monolithic architectures. Within the latter, multiple software functions are fused into a single process, which is neither modular, nor scalable, nor able to be deployed easily across multiple hosts.

    How does OpenShift handle services?

    To understand how microservices fit into OpenShift, you have to understand the basics of the OpenShift architecture, and how OpenShift manages the apps running on it.

    In essence, an OpenShift cluster is composed of the following parts, which all interact with one another in various ways:

    • Nodes: These are the physical or virtual servers that host OpenShift. You can (and should, if you want scalability and high reliability) have multiple nodes in your OpenShift cluster.
    • Pods: Just like on Kubernetes, OpenShift pods are groups of containers (or a single container, in some cases) that work together. Each pod has a unique internal IP address, and can access multiple ports on that address.
    • Containers: These are the things that run inside pods. You can have multiple containers of different types inside a single pod; for example, you could have a web server container running alongside a data container to store information for the web server. Each container can be assigned to a different port on its pod’s IP address.
    • Services: These are what you get when you put multiple pods together to deliver a single app, such as a web server complete with both logic and data functions.
    • Routes: Each OpenShift service receives an internal IP address and port number. If you want to expose a service to the external network or the public Internet, you use routes. Routes translate between the internal and external networking configuration of your service. Routes are kind of like good old NAT servers, if you want to think of them that way.

    These are the essentials that you need to understand about the OpenShift architecture to get started with microservices. For the longer version of all of the above, check out the OpenShift documentation.

    How Kubernetes makes microservices easy on OpenShift

    OK, so where does Kubernetes come in?

    The short answer is quietly. By that I mean that Kubernetes does most of its work in the background, without requiring much effort on the part of administrators. That’s the beauty of using Kubernetes to manage your OpenShift microservices.

    More specifically, Kubernetes automatically performs several key functions, which ensure that your microservices run smoothly. Those functions include:

      • Load balancing. Kubernetes automatically decides, based on policies that you define ahead of time, which of your OpenShift nodes need pods placed upon them.
      • High availability. Kubernetes automatically detects when a node fails and reassigns the pods from the failed node. The result is automatic failover, which provides high availability for your apps, even when parts of your infrastructure are hit with problems like the network going down or a loss of power.

     

    • Scaling. By automating the placement of pods according to policies set by a replication controller, Kubernetes also ensures that your services remain scalable as demand fluctuates.

    On the scaling note, it’s also worth bearing in mind that Kubernetes lets you scale different parts of your services independently. For example, if you have a container-based web server running on OpenShift and you need to increase the instances of the web server itself, but don’t require more of the data containers running alongside it, Kubernetes can scale up just the web server part of the service.

    To put it another way, the scalability of your OpenShift cluster is granular. That reduces complexity and optimizes resource usage.

    Conclusion

    By now, the advantages of pairing microservices with a Kubernetes-powered OpenShift cluster should be clear. You get an infrastructure that is agile from top to bottom. You also maximize resource efficiency, and minimize the amount of administrative effort required to keep things running.

    About Christopher Tozzi

    Chris Tozzi has worked as a journalist and Linux systems administrator. He has particular interests in open source, agile infrastructure and networking. He is Senior Editor of content and a DevOps Analyst at Fixate IO.

    Last updated: March 16, 2018

    Recent Posts

    • Run Ruby applications in FIPS mode on Red Hat Enterprise Linux

    • Use NetApp to run SAP on OpenShift Virtualization with a dual boot on bare metal

    • How does cgroups v2 impact Java and Node.js in OpenShift 4?

    • How to enable NVIDIA GPU acceleration in OpenShift Local

    • Trusted execution clusters operator: Design and flow overview

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue