Rwatana / BlogService

0 stars 0 forks source link

[Infra] Implement k8s for logging services #12

Closed Rwatana closed 3 weeks ago

Rwatana commented 2 months ago

Summary

Currently, our Logging Service includes two services. We have to set env for logging services.

Goal

This issue will be closed when we implement k8s env for logging services.

Test

General test

make skaffold_dev

k get pod
NAME                                READY   STATUS    RESTARTS   AGE
client-depl-75b5586758-scjq5        1/1     Running   0          5m46s
comments-depl-579b7b994c-m4h7t      1/1     Running   0          5m45s
event-bus-depl-78bdd7ff44-2tt22     1/1     Running   0          5m45s
log-intermediate-5d668dbd5f-wpwlv   1/1     Running   0          5m44s
loggingdb-mysql-b64fb55cd-xgt6k     1/1     Running   0          68s
moderation-depl-64d9f6cb55-qwb89    1/1     Running   0          5m44s
posts-depl-7848f85c8b-v92cf         1/1     Running   0          5m44s
query-depl-68766c594-lfg2n          1/1     Running   0          5m43s

DB Migration test

kubectl exec -it loggingdb-mysql-b64fb55cd-xgt6k -- /bin/bash

bash-5.1# mysql -u user -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.38 MySQL Community Server - GPL

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use logging
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from logging
    -> ;
+-----------+---------------------+-----------------+----------------+-----------------+----------------------------------+
| log_level | date                | current_service | source_service | type_of_request | content                          |
+-----------+---------------------+-----------------+----------------+-----------------+----------------------------------+
| INFO      | 2024-07-14 09:07:11 | ServiceA        | ServiceB       | GET             | This is an info log message      |
| ERROR     | 2024-07-14 09:07:11 | ServiceB        | ServiceC       | POST            | This is an error log message     |
| DEBUG     | 2024-07-14 09:07:11 | ServiceC        | ServiceA       | PUT             | This is a debug log message      |
| WARN      | 2024-07-14 09:07:11 | ServiceA        | ServiceC       | DELETE          | This is a warning log message    |
| INFO      | 2024-07-14 09:07:11 | ServiceB        | ServiceA       | PATCH           | This is another info log message |
+-----------+---------------------+-----------------+----------------+-----------------+----------------------------------+
5 rows in set (0.01 sec)

Deadline

7/20

Rwatana commented 2 months ago

@ryuji0123 Please check my code.

Rwatana commented 2 months ago

I think I have modified the points. Please review my code.

nayuta-ai commented 2 months ago

You should add this implementation to this repository. https://github.com/okuda-seminar/Twitter-Clone/pull/335

There are some rules that need to be corrected.

nayuta-ai commented 2 months ago

@Rwatana Also, you should first merge the https://github.com/Rwatana/BlogService/pull/10 to solve the above.

Rwatana commented 2 months ago

@nayuta-ai Thank you for your review. I would like to confirm one thing. I believe the issue mentioned will be resolved once that PR is merged first. Is it correct that there is nothing else I need to do for this PR at the moment?

ryuji0123 commented 3 weeks ago

Do we still need this PR?