Skip to content
Merged
30 changes: 22 additions & 8 deletions 101-lab/content/02_builds.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Builds
In this lab, you will import the Rocket.Chat Docker image for use in your OpenShift environment. Although this section is called 'builds', we've temporarily removed image building from this section for now.
In this lab, you will import the pre-built Rocket.Chat Docker image for use in your OpenShift environment. Although this section is called 'builds', we've temporarily removed image building from this section for now.

<!-- <kbd>[![Video Walkthrough Thumbnail](././images/02_builds_thumb.png)](https://youtu.be/j7a74_I6MYw)<kbd>
<kbd>[![Video Walkthrough Thumbnail](././images/02_builds_thumb.png)](https://youtu.be/uObexFEm2oI)<kbd>

[Video walkthrough](https://youtu.be/j7a74_I6MYw) -->
[Video walkthrough](https://youtu.be/uObexFEm2oI)

## The Tools Project
The tools project is what will hold various support tools for the application. In this case, we'll import the Rocket.Chat image into this project.
Expand Down Expand Up @@ -60,17 +60,31 @@ Tags: 1
Volumes: /app/uploads
```

- You can verify the image was successfully imported:
You can verify the image was successfully imported:

- Run the following command to check the imagestream exists:

```oc:cli
# Check the imagestream exists
oc -n [-tools] get imagestream rocketchat-[username]
```

- The output of the previous command should be similar to:
```oc:cli
NAME IMAGE REPOSITORY TAGS UPDATED
rocketchat-[username] image-registry.apps.silver.devops.gov.bc.ca/[-tools]/rocketchat-[username] 8.0.1,dev,latest 54 seconds ago
```

# Get detailed information
oc -n [-tools] describe imagestream rocketchat-[username]
- Run the following command to verify the 8.0.1 tag exists:

# Verify the 8.0.1 tag exists
```
oc -n [-tools] get imagestreamtag rocketchat-[username]:8.0.1
```

- The output of the previous command should be similar to:

```oc:cli
NAME IMAGE REFERENCE UPDATED
rocketchat-[username]:8.0.1 image-registry.openshift-image-registry.svc:5000/[-tools]/rocketchat-[username]@sha256:... 7 minutes ago
```

Next page - [Deployment](./03_deployment.md)
266 changes: 224 additions & 42 deletions 101-lab/content/03_deployment.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 101-lab/content/05_resource_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The platform default resource configuration is maintained by the Platform Servic

<!-- <kbd>[![Video Walkthrough Thumbnail](././images/05_resource_requests_and_limits_thumb.png)](https://youtu.be/dhLnaUGgnQY)</kbd>

[Video walkthrough](https://youtu.be/dhLnaUGgnQY)-->
<!-- [Video walkthrough](https://youtu.be/dhLnaUGgnQY)-->

## Explore Default Resource Configurations
Since the Rocket.Chat application was imported and not deployed from a template, explore the current resources allocated to the pods:
Expand Down
4 changes: 2 additions & 2 deletions 101-lab/content/06_application_availability.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[Video walkthrough](https://youtu.be/42UxHJkNLwc)

**Note: The beginning of the video above shows the application setup for an older version of RocketChat. Please follow the written instructions below for the RocketChat setup, as they reflect the current version of RocketChat used in this lab.**
**Note: The beginning of the video above shows the application setup for an older version of RocketChat. Please follow the written instructions below for the RocketChat application setup, as they reflect the current version of RocketChat used in this lab.**

Prior to beginning this lab, navigate to the public route you created and finish the initial setup of your application.

Expand Down Expand Up @@ -64,7 +64,7 @@ oc -n [-dev] scale deployment/rocketchat-[username] --replicas=2
```oc:cli
oc -n [-dev] get pods --field-selector=status.phase=Running -l deployment=rocketchat-[username] -o wide
```
you can also simply combine with grep:
- You can also simply combine with grep:
```
oc -n [-dev] get pods -o wide | grep rocketchat-[username]
```
Expand Down
23 changes: 15 additions & 8 deletions 101-lab/content/07_autoscaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Currently CPU and memory metrics are supported, with additional arbitrary metric

[Video walkthrough](https://youtu.be/ot-pE495JLE)

**Note: The video above shows how to create a webhook using an older version of RocketChat. Please follow the written instructions below for webhook creation, as they reflect the current version of RocketChat used in this lab.**
**Note: The video above shows webhook creation in an older version of RocketChat. It’s still useful for understanding the overall process, but the written instructions below should be followed, as they match the current version of RocketChat used in this lab.**

## Autoscaling Pods
This lab will provide a simple demonstration of autoscaling based on CPU, as this is configurable in the Web Console.
Expand All @@ -25,8 +25,8 @@ oc -n [-dev] autoscale deployment/rocketchat-[username] --min 1 --max 10 --cpu-p

- Browse to the application to generate some load and monitor the behavior of the pods
- Generate some activity such as creating messages, channels, etc.
- We'll use a tool called ApacheBench to create some load for our application. You can check if you have `ab` installed by running `ab version`. If this returns an error, you can install using `sudo apt install apache2-utils` which includes the `ab` utility.
- Use the command below to benchmark your app using 10,000 requests generated by [`ab` (ApacheBench)](https://httpd.apache.org/docs/current/programs/ab.html)
- We'll use a tool called [`ab` (ApacheBench)](https://httpd.apache.org/docs/current/programs/ab.html) to create some load for our application. You can check if you have `ab` installed by running `ab version`. If this returns an error, you can install using `sudo apt install apache2-utils` which includes the `ab` utility.
- Follow the instructions below to set up the Webhook in RocketChat:

- Open your Rocketchat web application from its web route, ensuring to log in as the admin user that your previously created

Expand All @@ -46,15 +46,22 @@ oc -n [-dev] autoscale deployment/rocketchat-[username] --min 1 --max 10 --cpu-p

- Copy 'Webhook URL' (see 'COPY TO CLIPBOARD' button/link)

- Use the command below to benchmark your app using 10,000 requests generated by `ab`

```oc:cli
# Make sure the domain matches the exposed route (no "localhost:3000")!!!
# Paste the command below into your terminal, replace the URL at the end with the URL from your clipboard, and run it to begin the load test:
- Make sure the domain matches the exposed route (no "localhost:3000")!!!
- Paste the command below into your terminal, replace the URL at the end with the URL from your clipboard, and run it to begin the load test:

printf '{"text":"Example message","attachments":[{"title":"Rocket.Chat","title_link":"https://rocket.chat","text":"Rocket.Chat, the best open source chat","image_url":"https://rocket.chat/images/mockup.png","color":"#764FA5"}]}' > /tmp/rocketchat-post-msg.json && ab -p /tmp/rocketchat-post-msg.json -n 10000 -c 10 -T "application/json" http://rocketchat-[username]-[namespace].apps.silver.devops.gov.bc.ca/hooks/[integration]/[token]
```oc:cli
printf '{"text":"Example message","attachments":[{"title":"Rocket.Chat","title_link":"https://rocket.chat","text":"Rocket.Chat, the best open source chat","image_url":"https://rocket.chat/images/mockup.png","color":"#764FA5"}]}' \
> /tmp/rocketchat-post-msg.json && \
ab -p /tmp/rocketchat-post-msg.json \
-n 10000 \
-c 10 \
-T "application/json" \
http://rocketchat-[username]-[namespace].apps.silver.devops.gov.bc.ca/hooks/[integration]/[token]
```

- In the home page of Rocket.Chat, under 'Join rooms' click on 'Open directory', then choose the channel #general. Click the blue 'Join' button in the bottom-right
- In the home page of Rocket.Chat, under 'Join rooms' click on 'Open directory', then choose the channel #general. Click the blue 'Join' button in the bottom-right. You should see lots of new messages posted to the #general channel from the loadtest.

- Review the deployment and try to add or remove replicas by editing its `.spec.replicas` YAML value

Expand Down
2 changes: 1 addition & 1 deletion 101-lab/content/09_persistent_configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[Video walkthrough](https://youtu.be/g6TyE3rIHeo)

**Note: The written instructions below have been updated since the above video was recorded. If viewing the video, please make sure to follow the steps in the written instructions below.**
**Note: The written instructions below have been updated since the above video was recorded. The video is still useful for understanding the overall process,but please make sure to follow the steps in the written instructions.**

In cases where configurations need to change frequently or common configurations should be shared across deployments or pods, it is not ideal to build said configurations into the container image or maintain multiple copies of the configuration. OpenShift supports `configMaps` which can be a standalone object that is easily mounted into pods. In cases where the configuration file or data is sensitive in nature, OpenShift supports `secrets` to handle this sensitive data.

Expand Down
2 changes: 1 addition & 1 deletion 101-lab/content/15_pod_lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A Pod can be extended beyond the normal operation of the container by allowing d

[Video walkthrough](https://youtu.be/552gtIZfEu4)

**Note: The written instructions below have been updated since the above video was recorded. If viewing the video, please make sure to follow the steps in the written instructions below.**
**Note: The written instructions below have been updated since the above video was recorded. The video is still useful for understanding the overall process,but please make sure to follow the steps in the written instructions.**

## Init Containers
Init containers are specialized containers that run before app containers in a pod. Init containers can contain utilities or setup scripts not present in an app image.
Expand Down
Binary file modified 101-lab/content/images/02_builds_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 101-lab/content/images/03_deploy_image_08a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 101-lab/content/images/03_deploy_image_08i.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 101-lab/content/images/03_deployment_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading