Skip to main content
In this guide, we walk through creating and deploying an ImageStream in OpenShift. ImageStreams are essential in OpenShift as they help manage container images and their tags, streamlining your deployment workflow. First, open the OpenShift console and navigate to the Builds section, then select ImageStreams. You will notice that many deployments already have their own ImageStreams.
The image shows the Red Hat OpenShift Container Platform interface, specifically the "ImageStreams" section, listing image streams like "approved-apache" and "goweb" with their creation times and labels.
Next, by clicking on “Microservice Demo Git,” you can inspect the SockShop application that was previously deployed. This application already has an associated ImageStream.
The image shows a Red Hat OpenShift Container Platform interface displaying project details, including labels and image repository information for a microservices demo.

Creating a New ImageStream for the Carts App

Suppose you want to create a new ImageStream for a specific deployment within SockShop, such as the Carts app. To do this, click on the “Create ImageStream” option. Remove any undesired default content and paste the following configuration:
This YAML configuration sets up an ImageStream for the Carts app using the tag “0.4.8,” which is sourced from the specified Docker image.
ImageStreams help you manage different versions of container images efficiently, ensuring consistency across your deployments.

Inspecting the Deployment Manifest

If you are curious about the underlying container image configuration, you can examine the deployment manifest in an editor such as VS Code. Here is the deployment configuration for the Carts app:

Deploying the Application Using the ImageStream

Once the ImageStream is in place, you can deploy an application based on it. Open your terminal and execute the command below to deploy the Carts app from the “default” project:
At this point, you might receive output similar to the example below, indicating that the deployment already exists:
An error indicating that the deployment already exists means that a previous deployment is conflicting with the new one.

Resolving Deployment Conflicts

To resolve this issue, delete the existing deployment by running:
After confirming the deletion, verify the list of remaining deployments with:
Now, run the deployment command again:
To confirm that the Carts app is now running, execute:
With these steps, the new ImageStream for the Carts app has been successfully deployed. This method allows you to target and deploy individual microservices using ImageStreams in OpenShift, thereby simplifying application management in a containerized environment.

Watch Video