New
Discover how Dropbox streamlined dev environments & cut costs by switching 1000 developers to Coder

Read the success story

Deploying Coder on Red Hat OpenShift Kubernetes Infrastructure

author avatar
Mark Milligan
 on April 29th, 2023

At Coder, we see a range of Kubernetes infrastructure across our enterprise customer base, sometimes with even more than one Kubernetes provider inside the same customer's technology ecosystem. One of these Kubernetes providers is Red Hat and their OpenShift hybrid cloud application platform powered by Kubernetes. Because Coder is self-hosted and not locked to a specific Kubernetes, Git or cloud provider, remote development environments as containers can be quickly and securely provisioned in OpenShift to make developers more productive and deliver more code.

Why Kubernetes?

There are two aspects that enterprises can benefit from running Coder on Kubernetes. The Coder control plane which includes our API, dashboard, development environment provisioner based on Terraform, can elegantly scale out on Kubernetes. With our Coder Enterprise paid offering, one-to-many replicas of the Coder control plane are configured as separate Kubernetes pods to share the workload across users and development environments.

Like the Coder control plane, development environments can also be configured to be Kubernetes pods with one-to-many inner containers. Deploying development environments as pods and containers is very cost efficient since the underlying nodes or VMs of the Kubernetes cluster and their CPU and memory compute are shared across development environments. Conversely, laptops, virtual desktops, or VMs as development environments are dedicated compute that have a direct cost even if the compute resources are unutilized which is common throughout a developer's workday when IDE editor usage requires less compute resources than builds.

Kubernetes also intelligently detects when pods (development environments) are requested and will scale up additional nodes to accommodate the development environment demand. As the workday ends, users shutdown their development environments (or Coder automatically does that based on centralized governance controls) and Kubernetes automatically scales down nodes to save compute cost.

OpenShift history

In 2010, Red Hat acquired Makara and its Cloud Application Platform, a Platform-as-a-Service (PaaS) product based on Linux containers that integrated well with Red Hat technologies like Red Hat Enterprise Linux (RHEL) and JBoss. Makara's co-founder describes the synergies as an enabler of platform and application portability. In v3, OpenShift adopted the Docker open-source project as the container technology and container runtime, followed by Kubernetes as the container orchestration technology. OpenShift evolved away from a Docker dependency to support CRI-O as the container runtime and the Pod Manager tool (podman) as a daemonless container engine for developing, managing, and running OCI Containers.

OpenShift and Coder

Like with cloud Kubernetes providers, OpenShift comes with build-related components to manage the life cycle of Kubernetes resources. The oc CLI is a superset of Kubernetes kubectl CLI. OpenShift includes a container registry and components like BuildConfigs and ImageStreams to build container images. Unlike other Kubernetes providers, OpenShift has many security and application isolation capabilities enabled by default. For example, each Project which is equivalent to a Kubernetes namespace, is assigned a User ID (UID) and Supplemental Group ID (GID) range.

Coder's Helm values.yaml file specifying the OpenShift Project's UID and GID

The Coder control plane and any out-of-the-box workspace pods will fail by design, so the Coder helm chart must have the UID and GID from the Project's range specified and any development environment container images need to be re-built with the Project's UID and GID as well. BuildConfigs and ImageStreams however make image building a snap.

An OpenShift BuildConfig to-build a container image with the Project's UID and GID

In fact, at Coder, we were able to install the Coder control plane including a Postgres database and re-build development environment container images entirely with the browser-based OpenShift Console user interface using the Developer and Administrator views! We have documented the oc CLI steps to deploy Coder as well.

Like Coder, Deployment Flexibility

It's a misnomer to view OpenShift as an on-premises only technology. While it is true that Coder has customers across the US Department of Defense and top 10 banks with Coder deployed with on-premises OpenShift, there is wide infrastructure support including AWS, Azure, IBM Cloud, vShere and more. In fact, Coder initially did a deployment on Red Hat OpenShift Service on AWS (ROSA) before moving to another VM-as-service provider to reduce cloud spend.

Proximity to Developer Resources

One benefit of deploying Coder and building development environments on OpenShift is that in many enterprises, OpenShift is deployed in enclaves and networks that have the resources that developers need to connect to perform their job and build software. Examples include accessing their enterprise's Git provider, databases and services that are essential or integrated in their developer flow. In fact, it is common for enterprises to deploy Coder both in OpenShift and in one-to-many public cloud providers to accommodate all of their developers and enterprises' network isolation requirements.

Access to Infrastructure Support and Services

Enterprises who have invested heavily in OpenShift have substantial internal trained expertise in managing and scaling containerized applications. These same resources can be applied to installing Coder and maintaining a healthy and scalable deployment that development teams can rely on for daily usage. Enterprises also invest heavily in Red Hat Professional Services with contractual commitments that can be applied to Coder deployments.

Better Return on Your OpenShift Investment

Standardizing on OpenShift is a significant investment for enterprises, so achieving a measurable return on investment is critical to justifying the technology selection decision. Because Coder is self-hosted software, we attract the largest companies and institutions with thousands of developers, data engineers, and data scientists depending on Coder to do their jobs. Each Coder user may have multiple development environments as containers on OpenShift, potentially requiring many OpenShift Kubernetes clusters to responsibly and securely scale development needs while accelerating delivery of software projects to meet organizational financial objectives.

Conclusion

Red Hat OpenShift is a first-class Kubernetes infrastructure to deploy Coder and accelerate developer productivity with containerized remote development environments. If your enterprise leverages OpenShift and wants to improve developer productivity and reduce developer infrastructure costs, speak with a technical account executive to see a demonstration or begin a 30-day trial of Coder Enterprise.

Subscribe to our Newsletter

Want to stay up to date on all things Coder? Subscribe to our monthly newsletter and be the first to know when we release new things!