Skip to content

Commit

Permalink
Fixes for task3
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaksei-karneyeu committed Feb 27, 2024
1 parent 4111354 commit 41b4309
Showing 1 changed file with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,31 @@ Now it's time to scale your application to be able to handle load. So you decide

- Fork [repository for task03](https://github.com/learningdevops-makvaz-com/phase03_task03) and clone forked repo.

### 2. Run local WordPress setup in couple pods using Deployment.
### 2. Understand Kubernetes basics.

{:refdef: style="text-align: center;"}
![Diagramm](assets/ph3_t2_p2.png)
{: refdef}
- **Learn about Kubernetes workflow [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)**: read documentation
- **Run simple application in deployment from file**: Create deployment using yaml file, with name `simple-app` that would run `dockersamples/static-site` container, has label `app: simple-app` and has `2` replicas, exposed port 80. Apply your changes to kubernetes. And using `kubectl port-forward` command try to open you application in browser.
- **Run simple application in deployment using command line**: Create deployment using command `kubectl run`, with name `simple-app2` that would run `dockersamples/static-site` container, has label `app: simple-app2` and has `2` replicas, exposed port 80. Apply your changes to kubernetes. And using `kubectl port-forward` command try to open you application in browser.

- Create Deployment with following parameters:
- replicas: `3`
- pods labels `app: wordpress`
- container port should be `80`
- image for wordpress container should be `korney4eg/wordpress-empty:latest`
- pods selector should look for pods labeled `app: wordpress`
- pod name: `wordpress`

- **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`.

### 3. Run local MySQL database with StatefulSet.

{:refdef: style="text-align: center;"}
![Diagramm](assets/ph3_t2_p3.png)
{: refdef}
### 2. Run local MySQL database with StatefulSet.

- **Learn about Kubernetes workflow [StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)**
- **Run pod `database` with MySQL database container**: Update `database.yaml` so that there would be pod `database` with `mysql` container that works on port `3306`. Password and other parameters should be hard-coded in manifest.
- **Check that `database` pod is running**. Try to use Kubernetes service.
- **Run pod with Wordpress**: Update `wordpress.yaml` so that there would be pod `wordpress` with `app` container that works on port `80`. Password and other parameters should be hard-coded in manifest. Use `database` pod's address as your database.
- **Check that wordpress pod is running**. Try to use Kubernetes service.
- ** Clean up**: Run command `kubectl delete -f wordpress_manifest.yaml`.

### 3. Run local WordPress setup in couple pods using Deployment.

- Create Deployment with following parameters:
- replicas: `2`
- pods labels `app: wordpress`
- container port should be `80`
- image for wordpress container should be `korney4eg/wordpress-empty:latest`
- pods selector should look for pods labeled `app: wordpress`
- pod name: `wordpress`

### 4. Run Init container inside WordPress pod.

{:refdef: style="text-align: center;"}
Expand Down

0 comments on commit 41b4309

Please sign in to comment.