Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit dab0480

Browse files
committed
Added diagram
1 parent 4b23331 commit dab0480

File tree

2 files changed

+55
-6
lines changed

2 files changed

+55
-6
lines changed

workshop/Lab3/README.md

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,29 @@ When looking at what kind of storage class you would like to use in Kubernetes,
88

99
In this lab we will deploy a Mongo database on top of block storage on Kubernetes.
1010

11+
![archDiagram](./images/archDiagram.png)
12+
13+
The basic architecture is as follows
14+
15+
1. When we install MongoDB with the helm chart, a `Persistent Volume Claim` (PVC) is created on the cluster. This PVC is a request for storage to be used by the application.
16+
17+
2. In IBM Cloud, the request goes to the IBM Cloud storage provider which then provisions a physical storage device within IBM Cloud.
18+
19+
3. A `Persistent Volume` (PV) is then created which acts as a reference to the physical storage device created earlier. This PV is then mounted as a directory in a container's file system.
20+
21+
4. The guestbook application receives requests to store guestbook entries from the user which the guestbook pod then sends to the MongoDB pod to store.
22+
23+
5. The MongoDB pod receives the request to store information and persists the data to the mounted directory from the Persistent Volume.
24+
1125
## Setup
1226

1327
Before we get into the lab we first need to do some setup to ensure that the lab will flow smoothly.
1428

15-
1. Replace `<docker username>` with your DockerHub username and run the following command (be sure to replace the `< >` too!).
29+
<!-- 1. Replace `<docker username>` with your DockerHub username and run the following command (be sure to replace the `< >` too!).
1630
1731
```bash
18-
DOCKER_USERNAME=<docker username>
19-
```
32+
DOCKERUSER=<docker username>
33+
``` -->
2034

2135
1. In your terminal, navigate to where you would like to store the files used in this lab and run the following.
2236

@@ -41,6 +55,39 @@ By default IBM Kubernetes Service Clusters don't have the option to deploy block
4155

4256
1. Follow the steps outlined [here](https://cloud.ibm.com/docs/containers?topic=containers-block_storage#install_block) to install the block storage `storageClass`.
4357

58+
1. First you need to add the `iks-charts` helm repo to your local helm repos. This will allow you to utilize a variety of charts to install software on the IBM Kubernetes Service.
59+
60+
```bash
61+
helm repo add iks-charts https://icr.io/helm/iks-charts
62+
```
63+
64+
1. Then, we need to update the repo to ensure that we have the latest charts:
65+
66+
```bash
67+
helm repo update
68+
```
69+
70+
1. Install the block storage plugin from the `iks-charts` repo:
71+
72+
```bash
73+
helm install block-storage-plugin iks-charts/ibmcloud-block-storage-plugin
74+
```
75+
76+
1. Lastly, verify that the plugin installation was successful by retrieving the list of storage classes in the cluster:
77+
78+
```bash
79+
kubectl get storageclasses
80+
```
81+
82+
You should notice a few options that start with `ibmc-block` as seen below.
83+
84+
```bash
85+
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
86+
ibmc-block-bronze ibm.io/ibmc-block Delete Immediate true 62s
87+
ibmc-block-custom ibm.io/ibmc-block Delete Immediate true 62s
88+
ibmc-block-gold ibm.io/ibmc-block Delete Immediate true 62s
89+
```
90+
4491
## Helm Repo setup
4592

4693
The lab uses Bitnami's Mongodb [Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/mongodb) to show case the use of block storage. Set the Bitnami helm repo prior to installing mongodb.
@@ -83,7 +130,9 @@ Dryrun:
83130
helm install mongo bitnami/mongodb --set global.storageClass=ibmc-block-gold,auth.password=testing,auth.username=guestbookAdmin,auth.database=guestbook -n mongo --dry-run > mongdb-install-dryrun.yaml
84131
```
85132

86-
This command will test out our helm install command and save the output manifests in a file called `mongodb-install-dryrun.yaml`
133+
>There is a detailed breakdown of this command in the next section titled `Installing MongoDB` if you would like to understand what this helm command is doing.
134+
135+
This command will test out our helm install command and save the output manifests in a file called `mongodb-install-dryrun.yaml`. You can then examine this manifest file so that you know exactly what will be installed on your cluster.
87136

88137
Check out the file in your code editor and take a look at the `PersistentVolumeClaim` object. There should be a property named `storageClassName` in the spec and the value should be `ibmc-block-gold` to signify that we will be using block storage for our database.
89138

@@ -264,9 +313,9 @@ In this file we are telling the application which datasource we should use; in-m
264313
265314
```bash
266315
cd $WORK_DIR/guestbook-nodejs/src
267-
IMAGE_NAME=$DOCKER_USERNAME/guestbook-nodejs:mongo
316+
IMAGE_NAME=$DOCKERUSER/guestbook-nodejs:mongo
268317
docker build -t $IMAGE_NAME .
269-
docker login -u $DOCKER_USERNAME
318+
docker login -u $DOCKERUSER
270319
docker push $IMAGE_NAME
271320
```
272321
50.8 KB
Loading

0 commit comments

Comments
 (0)