Skip to content

Commit c12ecdc

Browse files
authored
Merge pull request #672 from vr-varad/update/sks-containers-part
Update SKS Starter: Containers
2 parents fbfb8e9 + a421698 commit c12ecdc

File tree

14 files changed

+307
-0
lines changed

14 files changed

+307
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
docType: "Chapter"
3+
id: "Build & Run"
4+
chapterTitle: "Build & Run"
5+
description: ""
6+
lectures: 10
7+
title: "Build & Run"
8+
weight: 10
9+
---
10+
11+
12+
{{< chapterstyle >}}
13+
14+
<h2 class="chapter-sub-heading">Build & Run</h2>
15+
16+
```bash
17+
docker build
18+
```
19+
In our example, the first step is to build the hello-world container with the > docker build command.
20+
21+
{{< image src="/images/learning-path/intro-kubernetes/containers/c1_l10_1.png" width="100%" align="center" alt="Docker Build" >}}
22+
23+
```bash
24+
docker run
25+
```
26+
In our example, the second step is to run the hello-world container with the > docker run command.
27+
28+
{{< image src="/images/learning-path/intro-kubernetes/containers/c1_l10_2.png" width="100%" align="center" alt="Docker Run" >}}
29+
30+
<h3 class="chapter-sub-heading">Build & Run</h3>
31+
<p>Video: Build & Run </p>
32+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
33+
<video width="100%" height="100%" autoplay controls>
34+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid7.mp4?1752342546480" type="video/mp4">
35+
Your browser does not support the video tag.
36+
</video>
37+
</div>
38+
39+
{{< /chapterstyle >}}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
docType: "Chapter"
3+
id: "Containers"
4+
chapterTitle: "Containers"
5+
description: ""
6+
lectures: 8
7+
title: "Containers"
8+
weight: 8
9+
---
10+
11+
12+
{{< chapterstyle >}}
13+
14+
<h2 class="chapter-sub-heading">Containers</h2>
15+
{{< image src="/images/learning-path/intro-kubernetes/containers/c1_l8_1.png" width="100%" align="center" alt="Containers" >}}
16+
<h3 class="chapter-sub-heading">Containers</h3>
17+
<p>Video: Containers </p>
18+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
19+
<video width="100%" height="100%" autoplay controls>
20+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid4.mp4?1752342051186" type="video/mp4">
21+
Your browser does not support the video tag.
22+
</video>
23+
</div>
24+
25+
{{< /chapterstyle >}}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
docType: "Chapter"
3+
id: "Dependencies"
4+
chapterTitle: "Dependencies"
5+
description: ""
6+
lectures: 7
7+
title: "Dependencies"
8+
weight: 7
9+
---
10+
11+
12+
{{< chapterstyle >}}
13+
14+
<h2 class="chapter-sub-heading">Dealing with Dependencies</h2>
15+
<h3 class="chapter-sub-heading">Installing Dependencies ...</h3>
16+
... on Ubuntu
17+
18+
```bash
19+
# Install repository
20+
$ curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash –sudo apt-get update
21+
# Install NodeJS
22+
$ sudo apt-get install -y nodejs
23+
# Install Dependencies of the app
24+
$ npm install
25+
```
26+
<h3 class="chapter-sub-heading">Running ...</h3>
27+
... the application
28+
29+
```bash
30+
# Download or Upload app.js to the server somehow…
31+
# Run
32+
$ node app.js
33+
```
34+
35+
<h3 class="chapter-sub-heading">Dependencies</h3>
36+
<p>Video: Dependencies </p>
37+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
38+
<video width="100%" height="100%" autoplay controls>
39+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid3.mp4?1752341753956" type="video/mp4">
40+
Your browser does not support the video tag.
41+
</video>
42+
</div>
43+
44+
{{< /chapterstyle >}}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
docType: "Chapter"
3+
id: "Docker Hub"
4+
chapterTitle: "Docker Hub"
5+
description: ""
6+
lectures: 11
7+
title: "Docker Hub"
8+
weight: 11
9+
---
10+
11+
12+
{{< chapterstyle >}}
13+
14+
<h2 class="chapter-sub-heading">Docker Hub</h2>
15+
16+
Using a publicly available repository to manage, store, retrieve, and share (if you want to) your container images is a real added value. In traditional IT scenarios, such a solution has to be custom-built most of the time. In the container world, such solutions are part of the ecosystem. With docker containers, the Docker Hub is a natural solution as a repository for our scenarios.
17+
18+
{{< image src="/images/learning-path/intro-kubernetes/containers/c1_l11_1.png" width="100%" align="center" alt="Docker Hub" >}}
19+
20+
```bash
21+
docker run
22+
```
23+
In our example, the second step is to run the hello-world container with the > docker run command.
24+
25+
{{< image src="/images/learning-path/intro-kubernetes/containers/c1_l10_2.png" width="100%" align="center" alt="Docker Run" >}}
26+
27+
<h3 class="chapter-sub-heading">Docker Hub</h3>
28+
<p>Video: Docker Hub </p>
29+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
30+
<video width="100%" height="100%" autoplay controls>
31+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid8.mp4?1752343043012" type="video/mp4">
32+
Your browser does not support the video tag.
33+
</video>
34+
</div>
35+
36+
{{< /chapterstyle >}}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
docType: "Chapter"
3+
id: "Docker / Kubernetes"
4+
chapterTitle: "Docker / Kubernetes"
5+
description: ""
6+
lectures: 12
7+
title: "Docker / Kubernetes"
8+
weight: 12
9+
---
10+
11+
12+
{{< chapterstyle >}}
13+
14+
<h2 class="chapter-sub-heading">From Docker To Kubernetes</h2>
15+
16+
If you want to scale all the container benefits to an entire IT environment, you need additional functions to coordinate, scale, manage, and automate. For example, taking containerized applications from your local machine to your local server can be done without additional help. Still, if you want to do this with 10, 100, or even 1000 applications and start distributing the workloads, clustering them for higher availability and stability in operations to serve the 24/7 demands of today's customers, you need additional help. This help for containerized applications is Kubernetes. This help for a scalable, available, and more flexible infrastructure is Exoscale.
17+
18+
<h3 class="chapter-sub-heading">Docker Hub</h3>
19+
<p>Video: Docker Hub </p>
20+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
21+
<video width="100%" height="100%" autoplay controls>
22+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid9.mp4?1752343147000" type="video/mp4">
23+
Your browser does not support the video tag.
24+
</video>
25+
</div>
26+
27+
{{< /chapterstyle >}}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
docType: "Chapter"
3+
id: "Dockerfile"
4+
chapterTitle: "Dockerfile"
5+
description: ""
6+
lectures: 9
7+
title: "Dockerfile"
8+
weight: 9
9+
---
10+
11+
12+
{{< chapterstyle >}}
13+
14+
<h2 class="chapter-sub-heading">Dockerfile</h2>
15+
16+
```yaml
17+
FROM node:12-alpine * to be based on which other Docker image?
18+
19+
RUN apk add --no-cache python g++ make * install additional software
20+
21+
WORKDIR /app * create and use directory /app inside the container
22+
23+
COPY . . * 1st parameter: local directory (./ is the directory where the Dockerfile is) * 2nd parameter: target directory inside the container * → copy everything where the Dockerfile is in, into the container under /app
24+
25+
RUN npm install * dependencies for the application
26+
27+
CMD ["node", "src/index.js"] * run the app - just like when running outside a container
28+
```
29+
<h3 class="chapter-sub-heading">Dockerfile Theory</h3>
30+
<p>Video: Dockerfile Theory </p>
31+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
32+
<video width="100%" height="100%" autoplay controls>
33+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid5.mp4?1752342254038" type="video/mp4">
34+
Your browser does not support the video tag.
35+
</video>
36+
</div>
37+
</br>
38+
</br>
39+
<h3 class="chapter-sub-heading">Dockerfile Practice</h3>
40+
<p>Video: Dockerfile Practice </p>
41+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
42+
<video width="100%" height="100%" controls>
43+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid6.mp4?1752342254053" type="video/mp4">
44+
Your browser does not support the video tag.
45+
</video>
46+
</div>
47+
{{< /chapterstyle >}}

content/en/learning-paths/intro-kubernetes-course/containers/content/history_of_application_deployment.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,13 @@ As a solution, virtualization was introduced. It allows you to run multiple Virt
2525

2626
Containers are similar to VMs, but they have relaxed isolation properties to share the Operating System (OS) among the applications. Therefore, containers are considered lightweight. Similar to a VM, a container has its own file system, share of CPU, memory, process space, and more. As they are decoupled from the underlying infrastructure, they are portable across clouds and OS distributions.
2727

28+
<h3 class="chapter-sub-heading">App Deployment</h3>
29+
<p>Video: Application Deployment Overview</p>
30+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
31+
<video width="100%" height="100%" autoplay controls>
32+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid0.mp4?1752340619870" type="video/mp4">
33+
Your browser does not support the video tag.
34+
</video>
35+
</div>
36+
2837
{{< /chapterstyle >}}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
docType: "Chapter"
3+
id: "Running Application"
4+
chapterTitle: "Running Applications"
5+
description: ""
6+
lectures: 6
7+
title: "Running Applications"
8+
weight: 6
9+
---
10+
11+
12+
{{< chapterstyle >}}
13+
14+
<h2 class="chapter-sub-heading">What do I need ...</h2>
15+
16+
Considering the next steps based on the Node.js sample app from before.
17+
18+
<h3 class="chapter-sub-heading"><strong>What do I need to run apps in container?</strong></h3>
19+
20+
<ul>
21+
<li>Node.js – in the correct Version</li>
22+
<li>All dependencies of the App (e.g. via Package Manager NPM)</li>
23+
</ul>
24+
25+
<h3 class="chapter-sub-heading"><strong>Possibly … when the Application gets bigger ...</strong></h3>
26+
27+
<ul>
28+
<li>Database (and its requirements …)</li>
29+
<li>Private Network</li>
30+
</ul>
31+
32+
<h3 class="chapter-sub-heading">Running Apps</h3>
33+
<p>Video: Running App </p>
34+
<div style="border: 2px solid #ccc; border-radius: 8px; padding: 10px; background-color: #1e1e1e; box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 1em; margin-bottom: 1em; width: 75%; height:50%; display: block; margin: auto;">
35+
<video width="100%" height="100%" autoplay controls>
36+
<source src="https://sos-de-fra-1.exo.io/exoscale-academy/videos/sks_starter_vid2.mp4?1752341367873" type="video/mp4">
37+
Your browser does not support the video tag.
38+
</video>
39+
</div>
40+
41+
{{< /chapterstyle >}}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
docType: "Chapter"
3+
id: "Sample Application"
4+
chapterTitle: "Sample Application"
5+
description: ""
6+
lectures: 5
7+
title: "Sample Application"
8+
weight: 5
9+
---
10+
11+
12+
{{< chapterstyle >}}
13+
14+
<h2 class="chapter-sub-heading">Sample Application using Node.js</h2>
15+
16+
This sample app demonstration shows how traditional software deployment looks. A little JavaScript spins up a web server and runs the sample app on the server. It demonstrates how easy it is to run web-based applications, but still, you need to install and run Node.js beforehand. In addition, you have to use the proper versions of the software components in place and take care of all dependencies (runtime environments, libraries, ...). Otherwise, the app will not run or will not run properly.
17+
18+
This is the source code of our sample app:
19+
20+
```javascript
21+
const express = require("express")
22+
const app = express()
23+
const port = 3000
24+
app.get('/', (req, res) => { res.send("Hello World!") })
25+
app.listen(port, () => {
26+
console.log("Example app listening at http://localhost:3000")
27+
})
28+
```
29+
Take the code into action:
30+
31+
```bash
32+
node app.js
33+
```
34+
35+
The application at work, displaying Hello World!:
36+
37+
{{< image src="/images/learning-path/intro-kubernetes/containers/c1_l5_1.png" width="100%" align="center" alt="NodeJS App" >}}
38+
39+
{{< /chapterstyle >}}
Loading

0 commit comments

Comments
 (0)