Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CON-2283 make language agnostic subject and audit for projects after crud-master-py #2277

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 136 additions & 49 deletions subjects/devops/cloud-design/README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions subjects/devops/cloud-design/audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ Review the student's architecture design, ensuring that it meets the project req

#### Bonus

###### +Did the student used his/her own `orchestrator` solution instead of the provided one?

###### +Did the student add any optional bonus?

###### +Is this project an outstanding project?
223 changes: 158 additions & 65 deletions subjects/devops/code-keeper/README.md

Large diffs are not rendered by default.

139 changes: 83 additions & 56 deletions subjects/devops/orchestrator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,51 @@

MSilva95 marked this conversation as resolved.
Show resolved Hide resolved
### Objectives

In this project, You will deploy a microservices architecture on Kubernetes, you will gain experience with key technologies and concepts such as Kubernetes architecture, deployments, services, ingresses, and API gateways. Additionally, this project will provide you with an opportunity to practice DevOps skills such as containerization, continuous integration, and deployment (CI/CD), and infrastructure as code (IaC) using Kubernetes manifests. By completing this project, you will have a solid understanding of microservices architecture and the tools and techniques used to deploy and manage such systems using Kubernetes.
In this project, You will deploy a microservices' architecture on Kubernetes,
you will gain experience with key technologies and concepts such as Kubernetes
architecture, deployments, services, ingresses, and API gateways. Additionally,
this project will provide you with an opportunity to practice DevOps skills
such as containerization, continuous integration, and deployment (CI/CD), and
infrastructure as code (*IaC*) using Kubernetes manifests. By completing this
project, you will have a solid understanding of microservices architecture and
the tools and techniques used to deploy and manage such systems using
Kubernetes.

### Tips

- Spend time on the theory before rushing into the practice.
- Read the official documentation.
- You must understand the K8s components.

> Any lack of understanding of the concepts of this project may affect the difficulty of future projects, take your time to understand all concepts.
> Any lack of understanding of the concepts of this project may affect the
> difficulty of future projects, take your time to understand all concepts.

> Be curious and never stop searching!

### Architecture

![Architecture](pictures/Architecture.png)

You have to deploy this microservices architecture in a K3s cluster consisting of the following components:

- `inventory-database container` is a PostgreSQL database server that contains your inventory database, it must be accessible via port `5432`.
- `billing-database container` is a PostgreSQL database server that contains your billing database, it must be accessible via port `5432`.
- `inventory-app container` is a Node.js server that contains your inventory-app code running and connected to the inventory database and accessible via port `8080`.
- `billing-app container` is a Node.js server that contains your billing-app code running and connected to the billing database and consuming the messages from the RabbitMQ queue, and it can be accessed via port `8080`.
You have to deploy these microservices' architecture in a K3s cluster
MSilva95 marked this conversation as resolved.
Show resolved Hide resolved
consisting of the following components:

- `inventory-database container` is a PostgreSQL database server that contains
your inventory database, it must be accessible via port `5432`.
- `billing-database container` is a PostgreSQL database server that contains
your billing database, it must be accessible via port `5432`.
- `inventory-app container` is a server that contains your
inventory-app code running and connected to the inventory database and
accessible via port `8080`.
- `billing-app container` is a server that contains your billing-app
code running and connected to the billing database and consuming the messages
from the RabbitMQ queue, and it can be accessed via port `8080`.
- `RabbitMQ container` is a RabbitMQ server that contains the queue.
- `api-gateway-app container` is a Node.js server that contains your api-gateway-app code running and forwarding the requests to the other services and it's accessible via port `3000`.
- `api-gateway-app container` is a server that contains your
API gateway code running and forwarding the requests to the other
services, and it's accessible via port `3000`.

> You can use the Dockerfiles you created in the play-with-containers project!
<!--TODO: add link to solution-->
> Use the Dockerfiles provided [here](...)

### The cluster

Expand All @@ -43,73 +62,75 @@ You must install `kubectl` on your machine to manage your cluster.

The nodes must be connected and available!

```console
$> kubectl get nodes -A
NAME STATUS ROLES AGE VERSION
```console
$> kubectl get nodes -A NAME
STATUS ROLES AGE VERSION
<master-node> Ready <none> XdXh vX
<agent1-node> Ready <none> XdXh vX
<agent1-node> Ready <none> XdXh vX
$>
```

You must provide a `orchestrator.sh` script that run and create and manage the infrastructure:
You must provide a `orchestrator.sh` script that run and create and manage the
infrastructure:

```console
$> ./orchestrator create
```console
$> ./orchestrator.sh create
cluster created
$> ./orchestrator start
cluster started
$> ./orchestrator stop
cluster stopped
$>
$> ./orchestrator.sh start
cluster started
$> ./orchestrator.sh stop cluster stopped $>
```

### Docker Hub

You will need to push the Docker images for each component to Docker Hub.

> You will use it in your kubernetes manifests.
> You will use it in your Kubernetes manifests.

![Dockerhub-example](pictures/dockerhub-example.jpg)
![Docker Hub example](pictures/dockerhub-example.jpg)

### Manifests

You should create a YAML Manifest that describes each component or resource of your deployment.
You should create a YAML Manifest that describes each component or resource of
your deployment.

### Secrets

You must store your passwords and credentials as a K8s secrets.

> It's forbidden to put your passwords and credentials in the YAML manifests, except the secret manifests!

### Node.js apps
> It's forbidden to put your passwords and credentials in the YAML manifests,
> except the secret manifests!

This Node.js applications must be deployed as a deployment and they must be scaled horizontally automatically, depending on CPU consumption.
### Applications deployment instructions

- `api-gateway`:
max replication: 3
min replication: 1
cpu percent trigger: 60%
The following applications must be deployed as a deployment, and they
must be scaled horizontally automatically, depending on CPU consumption.

- `inventory-app`:
max replication: 3
min replication: 1
cpu percent trigger: 60%
- `api-gateway`: max replication: 3 min replication: 1 CPU percent trigger: 60%

This Node.js application must be deployed as StatefulSet:
- `inventory-app`: max replication: 3 min replication: 1 CPU percent trigger:
60%

- `billing-app`
The `billing-app` must be deployed as *StatefulSet*.

### Databases

Your databases must be deployed as StatefulSet in your K3s cluster, and you must create volumes that enable containers to move across infrastructure without losing the data.
Your databases must be deployed as *StatefulSet* in your K3s cluster, and you
must create volumes that enable containers to move across infrastructure
without losing the data.

### Documentation

You must push a `README.md` file containing full documentation of your solution (prerequisites, configuration, setup, usage, ...).
You must push a `README.md` file containing full documentation of your solution
(prerequisites, configuration, setup, usage, ...).

### Bonus

If you complete the mandatory part successfully and you still have free time, you can implement anything that you feel deserves to be a bonus, for example:
If you complete the mandatory part successfully, and you still have free time,
you can implement anything that you feel deserves to be a bonus, for example:

- Use the `Dockerfile` you have defined in your solution for
`play-with-containers`

- Deploy a Kubernetes Dashboard to monitor the cluster

Expand All @@ -121,24 +142,30 @@ Challenge yourself!

### Submission and audit

You must submit the `README.md` file and all files used to create and delete and manage your infrastructure: Vagrantfile, Dockerfiles, Manifests,...

```console
.
├── Manifests
│ └── [...]
├── Scripts
│ └── [...]
├── Dockerfiles
│ └── [...]
└── Vagrantfile
You must submit the `README.md` file and all files used to create and delete
and manage your infrastructure: Vagrantfile, Dockerfiles, Manifests, ...

```console
.
├── Manifests
│ └── [...]
├── Scripts
│ └── [...]
├── Dockerfiles
│ └── [...]
└── Vagrantfile
```

If you decide to use a different structure for your project remember you should be able to explain and justify your decision during the audit.
If you decide to use a different structure for your project remember you should
be able to explain and justify your decision during the audit.

> In the audit you will be asked different questions about the concepts and the practice of this project, prepare yourself!
> In the audit you will be asked different questions about the concepts and the
> practice of this project, prepare yourself!

#### What's next?

In order to develop your knowledge and career as a devops engineer, we highly recommend you to learn and practice more about kubernetes and even get a certification for kubernetes.
In order to develop your knowledge and career as a DevOps engineer, we highly
recommend you to learn and practice more about Kubernetes and even get a
certification for Kubernetes.

[https://kubernetes.io/training/](https://kubernetes.io/training/)
64 changes: 35 additions & 29 deletions subjects/devops/orchestrator/audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

MSilva95 marked this conversation as resolved.
Show resolved Hide resolved
##### Check the Repo content

A `README.md` and `orchestrator.sh` and `Vagrantfile` files and all files used to create and delete and manage the student infrastructure must be submitted in the repo.
The repo contains a `README.md`, an `orchestrator.sh` script, a `Vagrantfile`
and all the additional files used to create, delete and manage the submitted
infrastructure.

###### Are all the required files present?


###### Does the project as a structure similar to the one below? If not, can the student provide a justification for the chosen project structure?

```console
.
Expand All @@ -15,21 +22,20 @@ A `README.md` and `orchestrator.sh` and `Vagrantfile` files and all files used t
└── Vagrantfile
```

###### Are all the required files present?

##### Ask the following questions to the group or student

- What is container orchestration and what are its benefits?
- What is container orchestration, and what are its benefits?

- What is Kubernetes and what is its main role?
- What is Kubernetes, and what is its main role?

- What are K3s and what is their main role?
- What is K3s, and what is their main role?
MSilva95 marked this conversation as resolved.
Show resolved Hide resolved

###### Did the student reply correctly to the questions?

##### Check the Student Documentation

The Documentation must exist in the `README.md` file!
> There must be a `README.md` file with the project Documentation

###### Did the README.md file contains all the required information about the solution (prerequisites, configuration, setup, usage, ...)?

Expand All @@ -41,27 +47,27 @@ The Documentation must exist in the `README.md` file!

By using K3s in Vagrant two virtual machines must be created:

1. Master: the master in the K3s cluster.
1. `Master`: the master in the K3s cluster.

2. Agent: an agent in the K3s cluster.
2. `Agent`: an agent in the K3s cluster.

`kubectl` must be installed and configured in the learner machine to manage the cluster.

The nodes must be connected and available, try:

```console
$> kubectl get nodes -A
NAME STATUS ROLES AGE VERSION
NAME STATUS ROLES AGE VERSION
<master-node> Ready <none> XdXh vX
<agent1-node> Ready <none> XdXh vX
$>
```

###### Was the cluster created by a Vagrantfile?
###### Is kubectl installed and configured in the learner's machine?

###### Does the cluster contains two nodes (master and agent)?
###### Was the cluster created by a Vagrantfile?

###### Is kubectl installed and configured in the learner's machine?
###### Does the cluster contain two nodes (*master* and *agent*)?

###### Are the nodes connected and ready for usage?

Expand Down Expand Up @@ -94,9 +100,9 @@ user:~$

- What is infrastructure as code and what are the advantages of it?

- Explain What is a K8s manifest.
- Explain what is a K8s manifest.

- Explain the K8s manifests.
- Explain each K8s manifests.

###### Did the student reply correctly to the questions?

Expand All @@ -120,44 +126,42 @@ user:~$

- `inventory-database container` is a PostgreSQL database server that contains your inventory database, it must be accessible via port `5432`.
- `billing-database container` is a PostgreSQL database server that contains your billing database, it must be accessible via port `5432`.
- `inventory-app container` is a Node.js server that contains your inventory-app code running and connected to the inventory database and accessible via port `8080`.
- `billing-app container` is a Node.js server that contains your billing-app code running and connected to the billing database and consuming the messages from the RabbitMQ queue, and it can be accessed via port `8080`.
- `inventory-app container` is a server that contains your inventory-app code running and connected to the inventory database and accessible via port `8080`.
- `billing-app container` is a server that contains your billing-app code running and connected to the billing database and consuming the messages from the RabbitMQ queue, and it can be accessed via port `8080`.
- `RabbitMQ container` is a RabbitMQ server that contains the queue.
- `api-gateway-app container` is a Node.js server that contains your api-gateway-app code running and forwarding the requests to the other services and it's accessible via port `3000`.
- `api-gateway-app container` is a server that contains your api-gateway-app code running and forwarding the requests to the other services and it's accessible via port `3000`.

###### Are all the required applications deployed?

- databases must be deployed as StatefulSet, and volumes that enable containers to move across infrastructure without losing the data must be created.
- Databases must be deployed as *StatefulSet*, and volumes that enable containers to move across infrastructure without losing the data must be created.

- Node.js applications must be deployed as a deployment and they must be scaled horizontally automatically, depending on CPU consumption:
- The following applications must be deployed as a deployment, and they must be scaled horizontally automatically, depending on CPU consumption:

1. `api-gateway`:
max replication: 3
min replication: 1
cpu percent trigger: 60%
CPU percent trigger: 60%

2. `inventory-app`:
max replication: 3
min replication: 1
cpu percent trigger: 60%
CPU percent trigger: 60%

This Node.js application must be deployed as StatefulSet:

1. `billing-app`
The `billing-app` must be deployed as *StatefulSet*.

###### Do all apps deploy with the correct configuration?

##### Ask the following questions to the group or student

- What is StatefulSet in K8s?
- What is *StatefulSet* in K8s?

- What is deployment in K8s?
- What is *deployment* in K8s?

- What is the difference between deployment and StatefulSet in K8s?
- What is the difference between *deployment* and *StatefulSet* in K8s?

- What is scaling and why do we use it?
- What is scaling, and why do we use it?

- What is a load balancer and what is its role?
- What is a load balancer, and what is its role?

- Why we don't put the database as a deployment?

MSilva95 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -224,6 +228,8 @@ In less than 15 minutes and with the help of Google the student must explain all

#### Bonus

###### +Did the student used his/her own `play-with-container` solution instead of the provided one?
MSilva95 marked this conversation as resolved.
Show resolved Hide resolved

###### +Did the student add any optional bonus?

###### +Is this project an outstanding project?
Loading