-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f2e73d
commit fcb4330
Showing
2 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
tasks/_posts/2021-03-01-phase3-task4-deploy-using-helm-kustomize.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
title: Task 04. Deploy on Kubernetes using helm and kustomize. | ||
published: true | ||
active: true | ||
tags: "Phase3" | ||
difficulty: 2 | ||
--- | ||
|
||
You were able to successfully run wordpress in Kubernetes. Now it's time to make wordpress setup configurable. | ||
|
||
<!--more--> | ||
|
||
## Task | ||
|
||
### 1. Repository | ||
|
||
- Fork [repository for task03](https://github.com/learningdevops-makvaz-com/phase03_task03) and clone forked repo. | ||
|
||
### 2. Understand Kubernetes basics. | ||
|
||
- **Learn about Kubernetes [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)**: read documentation | ||
- **Run simple application in deployment from file**: Create deployment using yaml file `wordpress_manifest.yaml`, 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. | ||
|
||
- **Learn about Kubernetes [Service](https://kubernetes.io/docs/concepts/services-networking/service/)**: read documentation | ||
- **Expose simple-app pods as one endpoint**: After creating and properly configuring service make sure that application is available on this service. | ||
- **Clean up**: remove created previously deployments and service. | ||
|
||
### 2. Run local MySQL database with StatefulSet. | ||
|
||
- **Learn about Kubernetes [StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)** | ||
- **Create StatefulSet database**: Create statefulSet named `database`, with container `mysql`, with labels that you want. Add it to `database.yaml` file. | ||
- **Expose database using service**. Make sure that MySQL is accessible by port 3306. Add it to `database.yaml` file. | ||
|
||
### 3. Run local WordPress setup in couple pods using Deployment. | ||
|
||
- **Create Deployment with following parameters:** | ||
- deployment name: `wordpress` | ||
- replicas: `2` | ||
- pods labels `app: wordpress` | ||
- use `wordpress` pod manifest from previous task as a template for deployment | ||
- save manifest to `wordpress.yaml` file | ||
|
||
- **Expose wordpress using service**. Make sure that Wordpress blog is accessible by port 80. Add it to `wordpress.yaml` file. | ||
|
||
### 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. | ||
|
||
- _N/A_ | ||
|
||
### Tips: | ||
|
||
- _N/A_ | ||
|
||
### Recommended soft: | ||
|
||
- _N/A_ | ||
|
||
### Useful links: | ||
|
||
- [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 | ||
|
||
- _N/A_ |
8 changes: 0 additions & 8 deletions
8
tasks/_posts/2021-03-01-phase3-task4-horisontal-autoscaling.md
This file was deleted.
Oops, something went wrong.