Skip to content

Commit

Permalink
improve tasks 2 and 3
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaksei-karneyeu committed Mar 2, 2024
1 parent 28a2f01 commit c2ee6b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
3 changes: 2 additions & 1 deletion tasks/_posts/2021-02-01-phase2-task4-setup-ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Job should do following:

#### 4.1. Update `build_wp_image` stage.

- **Build docker wordpress docker image with newly created plugin**: build wordpress image with provided version of plugin.
- **Build docker wordpress image with newly created plugin**: build wordpress image with provided version of plugin.
- **Push docker wordpress image with plugin to Docker Hub**

#### 4.2. Run docker-compose with new wordpress image.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You started learning Kubernetes from the Pods. So your first idea was to run "Vi

- **Run pod with MySQL database**: Update `database.yaml` so that there would be pod `database` with `mysql` container that works on port `3306`. Password and other parameters should be hardcoded in manifest.
- **Check that `database` pod is running**.
- **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 hardcoded in manifest. Use `database` pod's address as your database.
- **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 hardcoded in manifest. Use `database` pod's hostname as your database.
- **Check that wordpress pod is running**.

### 4. Run Init container inside WordPress pod.
Expand All @@ -55,6 +55,9 @@ Create Pull Request with changes on files:
- `database.yaml`
- `wordpress.yaml`


### 6. Cleanup created resources

### Additional tasks if you feel that it was too easy.

1. Resources and limits: Before running any container it's always nice to limit it's resources usage so that it doesn't allocate all of them. Try to use it.
Expand All @@ -63,7 +66,7 @@ Create Pull Request with changes on files:

### Tips:

- _N/A_
- Try to find info, how to get pod's hostname

### Recommended soft:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,24 @@ Now it's time to scale your application to be able to handle load. So you decide
### 3. Run local WordPress setup in couple pods using Deployment.

- Create Deployment with following parameters:
- deployment name: `wordpress`
- 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`
- use `wordpress` pod manifest from previous task as a template for deployment

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

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

- **Build container with wordpress that doesn't have plugin built it**.
- **Replace container image from `app` container with newly built image**.
- **Run Init container `plugin-download` that downloads plugin**: Before `app` container started we need to have [thank-after-post-plugin](https://github.com/korney4eg/thank-after-post-plugin) to be downloaded by `plugin-download` container and later to be mounted in `app` container. Please update `wordpress.yaml` file for this task.

### 5. Make your work visible.
### 4. Make your work visible.

Create Pull Request with changes on files:

- `wordpress_manifest.yaml`
- `database.yaml`
- `wordpress.yaml`

### 5. Cleanup created resources

### Additional tasks if you feel that it was too easy.

1. Resources and limits: Before running any container it's always nice to limit it's resources usage so that it doesn't allocate all of them. Try to use it.
2. Kubernetes has mechanism to check whether container is ready to handle traffic, it's called `readinessProbe`. Try to use it.
3. Kubernetes has mechanism to check whether container is ready to handle traffic, it's called `livenessProbe`. Try to use it.
- _N/A_

### Tips:

Expand All @@ -78,6 +66,8 @@ Create Pull Request with changes on files:

- [Kuberentes API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/)
- [Kuberentes Deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)
- [Kubernetes Service](https://kubernetes.io/docs/concepts/services-networking/service/)
- [Kubernetes StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)

### FAQ

Expand Down

0 comments on commit c2ee6b0

Please sign in to comment.