This article explains how to deploy the Sock Shop application on Kubernetes and OpenShift using the command line interface.
If you’re not already familiar with the Sock Shop app, you’ll find it to be a robust microservices demonstration application. It deploys various deployments, services, databases, and more, simulating a real-world, multi-service architecture. This makes it an excellent choice for testing configurations in Kubernetes and OpenShift.
This procedure deploys several microservices that together form the full Sock Shop application. Once deployment completes, you should see a functional user interface displaying various components of the system.
The Sock Shop app is widely used in Kubernetes demonstrations, making it a standard reference for multi-service architectures.
For this lesson, we will deploy the Sock Shop microservices demo on OpenShift. Unlike the original Sock Shop manifests—which required full access to the Kubernetes API—the modified version for OpenShift is designed to run without needing cluster admin privileges.
$ oc get routeNAME HOST/PORT PATH SERVICES PORT TERMINATIONfront-end front-end.sock-shop.apps.xxxxxxxxxxxxxx.com web
If you haven’t already cloned the repository that contains the manifest, do so now. Then, navigate to the directory and deploy the application using:
Copy
Ask AI
oc apply -f .\complete-demo.yaml
This YAML file defines several deployments and services that collectively bring the application online. Once successfully applied, refresh your OpenShift console. In the Workloads > Deployments section, you should see all key services—such as carts, carts-db, catalog, front-end, orders, orders-db, and others—deployed. In the Pods section, all required pods for the Sock Shop app will be listed.
To confirm the successful deployment, navigate to the Routes section in the OpenShift console and locate the route for the new front-end service. Opening this route in your browser should display the application interface, demonstrating that the deployment has been successful.
Using the CLI can significantly streamline the deployment process compared to the UI, especially if you are already familiar with commands like kubectl apply -f or oc apply -f.For instance, running the deployment command again with the CLI will reapply the manifest:
Copy
Ask AI
oc apply -f .\complete-demo.yaml
The output should resemble the following, indicating that each component of the application (services, deployments, and routes) has been created:
There are several ways to deploy the Sock Shop application on OpenShift:
Directly via the OpenShift UI.
From a linked Git repository.
Directly from the terminal using the CLI, as demonstrated above.
Each method adheres to similar workflows. It’s beneficial to explore all approaches to become well-versed in standard deployment processes and determine which method best suits your workflow.Happy deploying!