Skip to content

Commit

Permalink
add task 3 on phase3
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaksei-karneyeu committed Feb 27, 2024
1 parent 3c11290 commit a96a64f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 36 deletions.
65 changes: 36 additions & 29 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,70 +1,77 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.1.8)
em-websocket (0.5.2)
concurrent-ruby (1.2.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.0)
ffi (1.15.5)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.10)
google-protobuf (3.22.0-arm64-darwin)
google-protobuf (3.22.0-x86_64-darwin)
google-protobuf (3.22.0-x86_64-linux)
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (4.2.0)
addressable (~> 2.8)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (~> 3.0)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-paginate (1.1.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.1)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.5.1)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rb-fsevent (0.10.4)
public_suffix (5.0.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.26.0)
rouge (3.30.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)
sass-embedded (1.58.3)
google-protobuf (~> 3.21)
rake (>= 10.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.4.2)
webrick (1.8.1)

PLATFORMS
universal-darwin-22
x86_64-linux
x86_64-linux-musl

DEPENDENCIES
jekyll-paginate
Expand Down
3 changes: 2 additions & 1 deletion tasks/_posts/2021-03-01-phase3-task1-start-k8s-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ As a first step, you decided to run Kubernetes locally on your computer.
- **Run pod with nginx container**: Start new pod with nginx container and make sure that it's running.
- **Check logs of nginx container**
- **Make port forwarding of nginx pod**: Try to access nginx inside pod using your web browser and tools provided by Kubernetes.
- ** Check resources used by nginx pod**: Try to find Kubernetes command that will allow you to see resource usage by pod.
- **Check resources used by nginx pod**: Try to find Kubernetes command that will allow you to see resource usage by pod.
- **get information of when did pod started**
- **remove nginx pod**

Expand All @@ -42,6 +42,7 @@ As a first step, you decided to run Kubernetes locally on your computer.
### Useful links:

- [Kubernetes getting started](https://kubernetes.io/docs/setup/)
- [Working with Pods](https://kubernetes.io/docs/concepts/workloads/pods/)

### FAQ

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
title: Task 03. Run blog engine on k8s. Workloads.
title: Task 03. Run WordPress on kubernetes using Deployment, StatefulSet, Service.
published: true
active: true
tags: "Phase3"
difficulty: 2
---
TODO: think about tasks with Deployments, statefulSets, Services and other types of resources.

You have learned about Kubernetes pods. So your first idea was to run "Video Games Magazine" inside those pods.
Now it's time to scale your application to be able to handle load. So you decided to use deployments, services, statefulsets in your blog engine.

<!--more-->

Expand All @@ -24,7 +23,6 @@ You have learned about Kubernetes pods. So your first idea was to run "Video Gam
{: refdef}

- Create Deployment with following parameters:

- replicas: `3`
- pods labels `app: wordpress`
- container port should be `80`
Expand All @@ -35,9 +33,9 @@ You have learned about Kubernetes pods. So your first idea was to run "Video Gam
- **Run MySQL database inside container `database` in pod `wordpress`**: Update `wordpress_manifest.yaml` so that there would be pod `wordpress` with `database` container that listens on port `3306`. Feel free to hard-code password and other parameters should into manifest. To verify that database is working properly try to run expose database port using `kubectl port-forward` command.
- **Run Wordpress inside container `app` in pod `wordpress`**: Update `wordpress_manifest.yaml` by adding `app` container that listens on port `80` and accessing database by address `localhost:3306`. Use password and other parameters that you configured in previous step.
- **Check that wordpress pod is running**.
- ** Clean up**: Run command `kubectl delete -f wordpress_manifest.yaml`.
- **Clean up**: Run command `kubectl delete -f wordpress_manifest.yaml`.

### 3. Run local WordPress setup in multiple pods.
### 3. Run local MySQL database with StatefulSet.

{:refdef: style="text-align: center;"}
![Diagramm](assets/ph3_t2_p3.png)
Expand Down

0 comments on commit a96a64f

Please sign in to comment.