Files
workshops/data/windows/exercise4.mdx

91 lines
4.2 KiB
Plaintext

---
title: Deploying a windows workload
exercise: 4
date: '2024-05-26'
tags: ['openshift','windows','kubernetes','containers']
draft: false
authors: ['default']
summary: "Putting our new cluster windows node to work 🚀"
---
With our cluster now having both Windows and Linux worker nodes, let's deploy a hybrid workload that will make use of both.
**The NetCandy Store**
You will be deploying a sample application stack that delivers an eCommerce site, The NetCandy Store. This application is built using Windows Containers working together with Linux Containers.
This application consists of:
1. Windows Container running a .NET v4 frontend, which is consuming a backend service.
2. Linux Container running a .NET Core backend service, which is using a database.
3. Linux Container running a MSSql database 🤯.
<Zoom>
|![workshop](/static/images/windows/mixed-workloads.png) |
|:-----------------------------------------------------------------------------:|
| *Mixed workload architecture diagram* |
</Zoom>
## 4.1 Add helm repository
In this exercise we will deploy the NetCandy Store application using `helm`. You can deliver your Windows workloads in the same way you deliver your Linux workloads. Since everything is just YAML, the workflow is the same. Whether that be via Helm, an Operator, or via Ansible.
We'll get started by creating a project and adding a helm repository that our application helm chart will be sourced from.
Follow the steps below to add the repository:
1. Switch from **Administrator** to **Developer** view in the top left web console dropdown menu.
2. Click on **+Add** in the left menu.
3. Click on the **Project** dropdown at the top and click **Create Project**
4. Enter the name `netcandystore` and click **Create**.
5. Click on **Helm Chart repositories**.
6. Enter the name `redhat-demos` and url `https://redhat-developer-demos.github.io/helm-repo` then click **Create**.
This will allow us to deploy any helm charts available in this repository.
<Zoom>
|![workshop](/static/images/windows/add-helm-repo.gif) |
|:-----------------------------------------------------------------------------:|
| *Creating a project and adding a helm repository* |
</Zoom>
## 4.2 Deploy candystore helm chart
With our helm chart repository added, let's deploy our application! This is as simple as following the three steps below to create a helm release.
1. Search for `candy` on the **Helm charts** screen.
2. Click on **Netcandystore** and then click **Create**.
3. Review the chart settings and click **Create** once more.
<Zoom>
|![workshop](/static/images/windows/deploy-application.gif) |
|:-----------------------------------------------------------------------------:|
| *Create mixed archiecture application via helm* |
</Zoom>
> Note: The application can take a few minutes to complete deploying, time for another coffee ☕.
## 4.3 Review deployed windows application
After creating our helm release we can see the status of the application from the **Topology** screen in the **Developer** view.
We can verify our Windows Container is running by:
1. Clicking on the **netcandystore** frontend Windows Container.
2. Selecting the **Resources** tab on the right hand panel and clicking on the pod name.
3. Clicking the **Terminal** tab and verifying that a Windows command prompt displays.
4. Returning to the **Topology** screen and opening the URL for the **netcandystore** application to confirm the application is running.
> Note: You may need to change from `https://` to `http://` in your browser address bar when opening the application URL as some browsers now automatically attempt to redirect to HTTPS, however this application route is currently only served as HTTP.
<Zoom>
|![workshop](/static/images/windows/confirm-application.gif) |
|:-----------------------------------------------------------------------------:|
| *Confirm Windows container status* |
</Zoom>
Congratulations! You've taken an existing OpenShift 4 cluster, set it up for running Windows workloads, then deployed a Windows app 🎉.