You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: workshop/Lab1/README.md
+25-24Lines changed: 25 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,18 @@
1
-
# Lab 1. Non-pesistent storage with Kubernetes
1
+
# Lab 1: Non-persistent storage with Kubernetes
2
2
3
3
Storing data in containers or worker nodes are considered as the [non-persistent](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#local-ephemeral-storage) forms of data storage.
4
-
In this lab, we will explore storage options on the IBM Kubernetes worker nodes. Follow this [lab](https://github.com/remkohdev/docker101/tree/master/workshop/lab-3) is you are interested in learning more about containerbased storage.
4
+
In this lab, we will explore storage options on the IBM Kubernetes worker nodes. Follow this [lab](https://github.com/remkohdev/docker101/tree/master/workshop/lab-3) is you are interested in learning more about container-based storage.
5
5
6
6
The lab covers the following topics:
7
-
- Create and claim persistent volumes based on the [primary]() and secondary storage available on the worker nodes.
7
+
- Create and claim IBM Kubernetes [non-persistent](https://cloud.ibm.com/docs/containers?topic=containers-storage_planning#non_persistent_overview) storage based on the primary and secondary storage available on the worker nodes.
8
8
- Make the volumes available in the `Guestbook` application.
9
-
- Use the volumes to stroage application cache and debug information.
9
+
- Use the volumes to store application cache and debug information.
10
10
- Access the data from the guestbook container using the Kubernetes CLI.
11
+
- Assess the impact of losing a pod on data retention.
11
12
- Claim back the storage resources and clean up.
12
13
13
14
14
-
The primary storage maps to the volume type `hostPath` and the secondary storage maps to `emptyDir`. Learn more about Kubernetes volume types [here](https://kubernetes.io/docs/concepts/storage/volumes/).
15
+
The primary storage maps to the volume type `hostPath` and the secondary storage maps to `emptyDir`. Learn more about Kubernetes volume types [here](https://Kubernetes.io/docs/concepts/storage/volumes/).
15
16
16
17
## Reserve Persistent Volumes
17
18
@@ -44,7 +45,7 @@ spec:
44
45
path: "/mnt/data"
45
46
```
46
47
47
-
Create the persistent volume as shown in the comamand below.
48
+
Create the persistent volume as shown in the command below:
48
49
```
49
50
kubectl create -f pv-hostpath.yaml
50
51
persistentvolume/guestbook-primary-pv created
@@ -90,15 +91,15 @@ Change to the guestbook application source directory:
90
91
```
91
92
cd $HOME/guestbook-nodejs/src
92
93
```
93
-
Review the source `common/models/entry.js`. The application uses storage allocated using `hostPath` to store data cache in the file `data/cache.txt`. The file `logs/debug.txt` records debug messages and is provisioned via the `emptyDir` storage type.
94
+
Review the source `common/models/entry.js`. The application uses storage allocated using `hostPath` to store data cache in the file `data/cache.txt`. The file `logs/debug.txt` records debug messages provisioned using the `emptyDir` storage type.
94
95
95
96
```source
96
97
module.exports = function(Entry) {
97
98
98
99
Entry.greet = function(msg, cb) {
99
100
100
101
// console.log("testing " + msg);
101
-
fs.appendFile('logs/debug.txt', "Recevied message: "+ msg +"\n", function (err) {
102
+
fs.appendFile('logs/debug.txt', "Received message: "+ msg +"\n", function (err) {
Review the deployment yaml file `guestbook-deplopyment.yaml` prior to deploying the application into the cluster.
125
125
126
126
```
127
-
cd $HOME/storage/lab1
128
-
cat guestbook-deplopyment.yaml
127
+
cd $HOME/guestbook-config/storage/lab1
128
+
cat guestbook-deployment.yaml
129
129
```
130
130
131
+
Replace the first part of `image` name with your docker hub user id.
131
132
The section `spec.volumes` lists `hostPath` and `emptyDir` volumes. The section `spec.containers.volumeMounts` lists the mount paths that the application uses to write in the volumes.
0 commit comments