From 34d91b2598ffc714dc38221bd354b02b9c64655b Mon Sep 17 00:00:00 2001 From: "nabil.abdennad" <nabil.abdennadher@hesge.ch> Date: Mon, 21 Oct 2024 00:03:58 +0200 Subject: [PATCH] Major updates --- README.md | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7481910..5cddbae 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The application will be deployed on a local kubernetes cluster created using the Kind (Kubernetes in Docker) is a tool designed to facilitate the running of local Kubernetes clusters using Docker containers as nodes. It simplifies the process of setting up a Kubernetes cluster by eliminating the need for virtual machines or cloud infrastructure, making it accessible and efficient for developers and testers. With kind, clusters can be created, managed, and deleted using straightforward commands, allowing for quick iterations and experiments. Its flexibility supports multi-node clusters, enabling realistic testing scenarios and the development of distributed applications in an environment closely resembling production. For further detail you can read this [web site](https://kind.sigs.k8s.io/). -## Kind +## The application The application to deploy is composed of 4 modules: Data Retrieval, Forecast, Redis and Grafana. The figure below describes how these 4 modules interact and how they are deployed. @@ -71,14 +71,6 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3h37m ``` -#### Creating a Secret Key - -```bash -kubectl create secret generic aws-secret \ - --from-literal=AWS_ACCESS_KEY_ID=<Your access key> \ - --from-literal=AWS_SECRET_ACCESS_KEY=<your secret key> -``` - You are ready to deploy services to your cluster. ### Deployment Files @@ -107,8 +99,6 @@ Both the `data-retrieval` and `forecast` folders have the following structure: |---- Dockerfile ``` -The `main.py` file has some functions that need to be finished before the container is build. Also, the `Dockerfile` needs to be completed, and a container be created and pushed to Docker Hub. - ## Deployment The application needs to be deployed in the following order: @@ -118,18 +108,29 @@ The application needs to be deployed in the following order: If the order isn't followed, there will be several errors happening. `Redis` needs to be the first to be deployed as both the `Data-Retrieval` and `Forecast` are dependant on it. -## Exercises +## Tasks + +### Task 1: redis deployment + +### Task 2: Data Retrieval deployment + +Read the data-retrieval-deployment.yaml carefully and spot the name of the secrets used. This secrets must be generated by this command: + +```bash +kubectl create secret generic <name-of-the-secrets> \ + --from-literal=AWS_ACCESS_KEY_ID=<Your access key> \ + --from-literal=AWS_SECRET_ACCESS_KEY=<your secret key> +``` +Build the Data Retrieval docker, complete the file "data-retrieval-deployment.yaml" and deploy data-retrieval module. + +### Task 3: Forecast deployment + + +### Task 4: Grafana deployment + -1. Install, configure and deploy Kind -2. Finish both the `data-retrieval` and the `forecast` code. WARNING: make sure to only finish what is asked in the code. Do not change anything else. -3. Create the Dockerfile for both the `data-retrieval` and `forecast`. - a. Build the containers. - b. Push the containers to Docker Hub -4. Finish the kubernetes deployment files -5. Deploy the application -6. Build a Grafana dashboard to visualize the forecasted data. -## Load Balancer +## Task 5: Load Balancer Kubernetes provides Load Balancing capabilities natively. This permits the distribution of load between several replicas of the same pod. But, as we are deploying using kind, to access this ability we have to create a port-forward between the service and the host device: -- GitLab