
Openshift uses Kubernetes to manage Docker containers, allowing for efficient and scalable deployment of applications.
Kubernetes is a container orchestration system that automates the deployment, scaling, and management of containers.
With Openshift, you can easily manage your Docker containers using Kubernetes, without having to worry about the underlying infrastructure.
This integration enables you to focus on developing and deploying your applications, rather than worrying about the container management.
Readers also liked: Difference between Kubernetes and Openshift
Getting Started
Docker containers are the foundation of OpenShift, so it's essential to understand how to create and manage them.
To create a Docker container, you'll need to define a Dockerfile, which is a text file that contains instructions for building your container.
A Dockerfile is used to create a Docker image, which is then used to create a container.
OpenShift uses a Docker image to create a container, which is a lightweight and portable way to deploy applications.
To get started with OpenShift, you'll need to install the Docker client and the OpenShift client, known as oc.
The oc command is used to interact with OpenShift, allowing you to create and manage projects, templates, and other resources.
For another approach, see: Azure Container Client
Docker Desktop
Docker Desktop is a platform that thousands of enterprises trust, with more than 20 million active developers already familiar with it. This means you can leverage its power and eliminate daily friction.
The Docker Desktop platform is designed to empower developers to deliver results quickly, making it an ideal choice for those who need to focus on getting the job done.
Get Started with Red Hat Extension
The Red Hat OpenShift Extension is available on the extensions marketplace, and you can get a free Red Hat OpenShift environment by exploring the Red Hat Developer Sandbox.
To get started, you'll need to sign up for a free account on the Red Hat Developer Sandbox, which will give you an OpenShift environment in the cloud. No setup is required.
The extension is designed to work seamlessly with Docker Desktop, allowing you to leverage the platform that over 20 million active developers already know and trust.
For your interest: Free Openshift
Here are the steps to deploy your containerized app to OpenShift:
- Choose Target OpenShift context.
- Choose the Docker image that you want to deploy to OpenShift.
The Red Hat OpenShift Extension provides several capabilities, including detection of Kubernetes environments, login to clusters, listing of projects, selection of container images, and deployment of container images.
Deploying Containers
You can deploy your Docker containers on OpenShift using the Red Hat OpenShift Extension for Docker Desktop. This extension allows you to deploy your Docker containers on a free Developer Sandbox for Red Hat OpenShift environment or any other OpenShift cluster of your choice.
To get started, you'll need a containerized app, which can be created using Docker's newly introduced `docker init` command. This command automates the creation of Dockerfiles, Compose manifests, and `.dockerignore` files.
You can also use a sample app like the racing-game-app, which is available on GitHub and comes with a Dockerfile and OpenShift manifest.
The Red Hat OpenShift Extension for Docker Desktop allows you to deploy your Docker containers on OpenShift without leaving the Docker Desktop UI. You can sign up for a free Developer Sandbox for Red Hat OpenShift environment and use it to deploy your containers.
Intriguing read: Azure Web App Container
Here are the steps to deploy your Docker containers on OpenShift:
- Clone the sample app from GitHub
- Use the Red Hat OpenShift Extension for Docker Desktop to deploy the app on OpenShift
- Sign up for a free Developer Sandbox for Red Hat OpenShift environment
- Use the `oc` command to deploy your app on OpenShift
You can also deploy your Docker containers on OpenShift using the web console. To do this, you'll need to create a project, upload your Kubernetes resources, and deploy the app.
Here's a step-by-step guide to deploying your Docker containers on OpenShift using the web console:
1. Create a project on the OpenShift web console
2. Upload your Kubernetes resources (deployment.yaml, service.yaml, and route.yaml)
3. Deploy the app using the web console
4. Verify that the app is running by checking the status of the pods and routes
Alternatively, you can deploy your Docker containers on OpenShift using the command line. To do this, you'll need to install the `oc` command, log in to OpenShift, and deploy the app using the `oc new-app` command.
Here's an interesting read: Deploy to Azure Container Apps
Here's a step-by-step guide to deploying your Docker containers on OpenShift using the command line:
1. Install the `oc` command
2. Log in to OpenShift using the `oc login` command
3. Create a new app using the `oc new-app` command
4. Verify that the app is running by checking the status of the pods and routes
A fresh viewpoint: Openshift Command Line
Kubernetes Overview
Kubernetes is often misunderstood as an all-in-one containerization platform, but that's not true.
Kubernetes no longer supports Docker in kubelets, which might have you wondering which platform to use moving forward.
90% of organizations use containers in production, but there's still confusion surrounding Kubernetes, Docker, and OpenShift.
Kubernetes allows you to plan, perform, and manage the deployment of applications in the form of Docker containers, making deployments reproducible and easy to customize.
OpenShift markets itself as a Platform-as-a-Service (PaaS), but it comprises Kubernetes components and works with Docker, so it's not reliant on Docker and Kubernetes.
Kubernetes is an orchestration tool that came to the rescue when companies' deployment landscapes became messy due to the use of Docker containers.
Suggestion: Azure Kubernetes Service
Kubernetes Features
Kubernetes allows to plan, perform, and manage the deployment of applications in the form of Docker containers.
It makes deployments reproducible and easy to customize, which is a huge time-saver for developers and IT teams.
Kubernetes works well with Docker containers, but it's not the only tool in the game.
OpenShift, for example, is a platform that can serve as a Platform (PaaS) and a tool (CaaS), just like Kubernetes.
It also supports automatic and manual scaling of containers, CI/CD, and multi-tenant deployments, making it a powerful tool for container management.
Here are some of the key features of Kubernetes:
- Plan, perform, and manage the deployment of applications in the form of Docker containers
- Makes deployments reproducible and easy to customize
Benefits of
Kubernetes is a powerful tool for managing containerized applications, and it has several benefits that make it a popular choice among developers and IT professionals.
Kubernetes is less complex than some other container management systems, making it easier to learn and manage.
One of the key advantages of Kubernetes is its ability to support high scalability, making it ideal for large-scale environments.
Here are some of the key benefits of using Kubernetes:
- Supports good container scalability, making it ideal for large-scale environments
- Complete ecosystem for container management, including creating and managing images, orchestrating containers, and more
- Highly fault-tolerant
- Built-in app discovery
- Open-source architecture, allowing extensibility
In comparison to Docker, Kubernetes offers better support for large-scale environments and more advanced container management features.
Kubernetes can also be used in conjunction with other tools, such as OpenShift, to further enhance its capabilities.
OpenShift, for example, offers additional benefits such as better out-of-the-box container security and customizability.
Kubernetes Horizontal Pod Autoscaler
The Kubernetes Horizontal Pod Autoscaler is a feature that automatically scales the number of replicas of a deployment based on CPU utilization. It's a game-changer for managing resource-intensive applications.
It works by setting a target CPU utilization percentage, and then adjusting the number of replicas accordingly. This ensures that your application always has the resources it needs to run smoothly.
For example, if your application is using 50% of its allocated CPU, the HPA will create more replicas to bring the CPU utilization down to the target percentage. This helps prevent your application from becoming a bottleneck.
In a Kubernetes environment, the HPA is configured by specifying the target CPU utilization percentage and the minimum and maximum number of replicas. This allows you to fine-tune the scaling behavior to suit your application's needs.
By using the Kubernetes Horizontal Pod Autoscaler, you can ensure that your application is always running with the right amount of resources, without having to manually intervene.
Differences Between
Kubernetes and OpenShift are two popular container orchestration platforms, but they have some key differences. OpenShift is designed as an enterprise-grade platform with additional features like security, productivity, and hybrid cloud capabilities.
One of the main differences is the installation process. Kubernetes uses various tools like kubeadm, kube-spray, and kops, whereas OpenShift uses a dedicated Kubernetes Operator and ConfigMaps within the cluster for installation.
OpenShift supports almost any platform, including cloud and on-premises, and any Linux distribution. Kubernetes, on the other hand, can be deployed almost anywhere but requires Red Hat's Enterprise Linux (RHEL) or Atomic Host, CoreOS, or Fedora.
Worth a look: Openshift Cloud
In terms of security, OpenShift has built-in encryption for application configuration data, platform secrets, and secure-by-default options. Kubernetes, however, requires manual setup for authorization and authentication.
Here's a comparison of the two platforms:
OpenShift also has built-in CI/CD integration with Jenkins, whereas Kubernetes does not have built-in CI/CD integration. However, both platforms support third-party CI/CD tools.
In terms of updates, OpenShift has multiple updates a year, whereas Kubernetes also has multiple updates a year, with support for rolling updates.
Overall, while both platforms share some similarities, OpenShift is designed with enterprise-grade features and security in mind, making it a popular choice for large-scale deployments.
Kubernetes Deployment
Kubernetes is a game-changer for deploying applications in the form of Docker containers, allowing for reproducible and easy-to-customize deployments.
It's a natural progression from the chaos of manually managing Docker containers, which is why Kubernetes resources are a must-have for any serious deployment.
To deploy an app on OpenShift, you'll need two essential items: a Docker image and the Kubernetes resources. The Docker image is where your application code is packaged, while the Kubernetes resources define how the app should be deployed and managed.
Related reading: Run Docker Image from Azure Container Registry
Here's a quick rundown of the steps to deploy an app on OpenShift via the web console:
Alternatively, you can use the oc CLI to deploy an app on OpenShift, which is ideal for automating deployments in a real development project.
Signing into the Cluster
You can sign into the OpenShift cluster using the web console or the command line tool oc. From within your Red Hat OpenShift cluster web console, select the copy login command from the user menu.
To login to OpenShift via oc CLI, follow the instructions to install the oc CLI and then login using the oc login command. The system will ask for your username and password.
You can also use the oc.exe file to login to OpenShift from the Windows terminal. Run the oc.exe file and then use the oc login command to enter your username and password.
To create a new application in the project, you'll need to be logged in to the OpenShift cluster. Make sure you're in the correct OpenShift project before uploading Kubernetes resources.
Here are the steps to sign into the OpenShift cluster:
- Copy the login command from the user menu in the web console.
- Install the oc CLI and login using the oc login command.
- Run the oc.exe file and use the oc login command to enter your username and password.
When To Use
When to use a container platform like Docker is crucial for successful Kubernetes deployment.
Docker makes lightweight container images easy to build, deploy, and manage, especially in small- to medium-sized deployments, and even in large-scale deployments when paired with Kubernetes.
Its rich image registry and compatibility with most environments and tools make it a great choice for building robust CI/CD pipelines.
You can build, ship, deploy, and maintain your containerized applications using declarative YAML files with Docker Swarm, which also scales services to your desired state automatically.
Docker Swarm requires less setup and configuration than OpenShift or Kubernetes, making it a more straightforward choice for some use cases.
It can balance load between containers in a cluster and safeguard access control for your services.
Kubernetes Management
You can use Docker without Kubernetes, but it's not always the most efficient way to manage your containerized applications at scale. Kubernetes is an open-source platform that works with different container runtimes, including containerd, CRI-O, and RunC.
Docker is perfectly capable of building, deploying, and running container images on its own, and the Docker Hub is a great resource for storing and retrieving images. Docker Compose helps package containers into a multi-container app, while Docker Swarm manages and optimizes resource utilization for containers.
Kubernetes is designed to help companies that have outgrown the simplicity of Docker containers and are struggling with messy deployment landscapes. By using Kubernetes, you can plan, perform, and manage the deployment of applications in the form of Docker containers, making deployments more reproducible and easy to customize.
Security
Docker Swarm and Kubernetes both support Role-Based Access Control (RBAC), but Docker Swarm nodes also implement TLS mutual encryption and authentication.
Kubernetes requires manual configuration of authentication safeguards, which can be time-consuming and tedious.
OpenShift provides superior security features by default, including hybrid/multi-cloud capabilities and dedicated customer support.
Free OpenShift is open-source, making it flexible and extensible.
You'll need to create bearer tokens or another method of authentication manually in Kubernetes, which can be a hassle.
The easy-to-use web console for login in OpenShift makes it a more convenient choice for many users.
Cleanup
Cleanup is essential to avoid unnecessary resource usage and potential errors when redeploying your app. Use the web terminal to remove all traces of your deployment with a one-liner command.
This will save you time and effort in the long run. For example, you can use `That will avoid unnecessarily using resources and any errors if you try to redeploy to the same namespace later.` to clean up your deployment.
The Red Hat OpenShift extension makes it easy to deploy from Docker Desktop to an OpenShift cluster with just one click. This is especially helpful for previewing iterative work in a shared cluster.
If this caught your attention, see: Deploy Openshift
Kubernetes Alternatives
Kubernetes is a widely-used platform for managing containerized applications, but it's not the only option. Docker is a popular container runtime that can be used without Kubernetes.
Docker can build, deploy, and run container images without Kubernetes, and it has its own tools like Docker Compose and Docker Swarm for managing containers. Docker Swarm, for example, manages and optimizes resource utilization for containers.
OpenShift is another alternative to Kubernetes. It's an enterprise-grade, open-source container orchestration platform designed by Red Hat. OpenShift offers additional security, productivity, and hybrid cloud features compared to Kubernetes.
Here's a comparison of OpenShift and Kubernetes:
As you can see, OpenShift is a more comprehensive platform that offers additional features and support for enterprise environments. However, Kubernetes is a more lightweight and flexible option that can be used in a wide range of scenarios.
Kubernetes Resources
Kubernetes is a game-changer for deploying and managing Docker containers. It allows companies to plan, perform, and manage the deployment of applications in the form of Docker containers.
Kubernetes makes deployments reproducible and easy to customize. This is a significant improvement over the messy deployment landscape that companies faced when using Docker containers alone.
Kubernetes can manage multiple isolated applications running on the same physical server, just like virtual machines do.
Templates
In Kubernetes, PodTemplates describe how to create pods. They are included in workload resources such as Deployments, DaemonSets, and Jobs.
A PodTemplate is used by the controller to create actual pods for each workload resource. This is a crucial step in deploying and managing applications on a Kubernetes cluster.
Templates in Docker Hub come in two forms: service templates and application templates. Service templates contain metadata and code, while application templates are a group of one or more service templates.
Docker Template, a CLI plugin, offers a top-level template command to create new Docker apps using a library of templates. This makes it easy to get started with building and deploying containerized applications.
On a similar theme: Openshift Service Mesh
Extension Capabilities
The Red Hat OpenShift Extension for Docker Desktop is a game-changer for developers working with OpenShift. It enables you to deploy and test your apps with ease, in just two steps.
To deploy your containerized app to OpenShift, you need to choose the Target OpenShift context and select the Docker image you want to deploy.
The Red Hat OpenShift Extension provides a range of capabilities that make working with OpenShift a breeze. Here are some of the key features:
- Detection of Kubernetes environments: The extension scans your local kube-config file and preselects your current Kubernetes context.
- Login to Clusters: You can connect to a new Kubernetes environment on your local workstation by directly using the connection details.
- Listing of projects (namespace): You can browse and select the project in which you want to deploy your application.
- Selection of container images: You can pick and choose the container image you already have built and pushed to a container registry.
- Deployment of container images: The extension generates resources needed to deploy your container images, and a route gets generated automatically to expose your application outside of the cluster.
- Push to DockerHub and deploy: You can select the container image, push it to Docker Hub, and deploy to OpenShift in a single click.
- Push image to OpenShift registry and deploy: You can select the container image, push it to OpenShift Registry, and deploy to OpenShift in one swift motion.
- Open the Console Dashboard: You can quickly access the OpenShift Console Dashboard from the extension UI.
- Free access to OpenShift Developer Sandbox: You can create a free account on OpenShift Developer Sandbox to get an OpenShift environment in the cloud.
To get started with the Red Hat OpenShift Extension, you can download it from the extensions marketplace. With this extension, you'll have access to a free Red Hat OpenShift environment and can try out the extension in the Red Hat Developer Sandbox.
Additional reading: Openshift Redhat
Frequently Asked Questions
Does OpenShift use Podman or Docker?
OpenShift uses CRI-O, a container engine that includes Podman in single-node use cases, but not Docker. For more information on OpenShift's container engine, see our documentation on CRI-O and Podman integration.
Featured Images: pexels.com

