diff --git a/config.toml b/config.toml index c0af230..2e391c7 100644 --- a/config.toml +++ b/config.toml @@ -3,7 +3,7 @@ languageCode = 'en-us' title = 'OMAR.A' -paginate = 4 +paginate = 10 [params] description = "My Tech Blog" diff --git a/content/journey/journey.md b/content/journey/journey.md new file mode 100644 index 0000000..eb1cef8 --- /dev/null +++ b/content/journey/journey.md @@ -0,0 +1,14 @@ +--- +title: "My Software Journey: Intro" +date: 2024-07-01T19:11:50+03:00 +draft: false +description: "My Software Journey" +image: "/images/journey/1.jpg" +imageBig: "/images/journey/1.jpg" +categories: ["journey"] +avatar: "/images/avatar.webp" +--- + +I'm starting a journey to build random stuff, and apply and practice Backend Engineering, I will go from a Monolithic application to a Microservices exploring and building cool stuff and Proof of Concepts. ๐Ÿš€๐Ÿ’ป + +![incantogamus](/images/journey/discover.webp) \ No newline at end of file diff --git a/content/journey/mission-1.md b/content/journey/mission-1.md index e695a93..a4645b7 100644 --- a/content/journey/mission-1.md +++ b/content/journey/mission-1.md @@ -1,16 +1,14 @@ --- -title: "Sw Journey: Mission 1" -date: 2024-08-06T19:11:50+03:00 -draft: true -description: "Software Journey Mission 1" -image: "/images/journey/1.jpg" -imageBig: "/images/journey/1.jpg" -categories: ["journey", "k8s", "kubernetes"] +title: "My Journey: K8s and Helm" +date: 2024-08-05T19:11:50+03:00 +draft: false +description: "Discovering Kubernetes and Helm Charts" +image: "/images/journey/k8s.png" +imageBig: "/images/journey/k8s.png" +categories: ["journey", "k8s", "kubernetes", "helm", "helm-charts", "docker"] avatar: "/images/avatar.webp" --- -I'm starting a journey to build random stuff, and apply and practice Backend Engineering, I will go from a Monolithic application to a Microservices exploring and building cool stuff and Proof of Concepts. ๐Ÿš€๐Ÿ’ป - ## Mission 1 during this week I will discover and learn Kubernetes, and how to deploy a simple application to k8s. @@ -48,25 +46,4 @@ the API will be a **Incantogamus app** a simple CRUD application for video games - The Helm Chart is accessible at: https://civilcoder55.github.io/learning-helm-charts/ - updated the application readme to include the Helm Chart usage. https://github.com/civilcoder55/incantogamus -## Mission 2 - -- [x] Discover Prometheus and Grafana - - - I discovered Prometheus, understanding its functionality and how to use it for monitoring applications. Additionally, I learned about Grafana and how to visualize the metrics collected by Prometheus. - - I also gained knowledge on creating and using an Exporter to gather metrics from an application and expose them to Prometheus. - -- [x] Collect and Visualize Asterisk Metrics - - - I collected metrics from an Asterisk server using the Asterisk `res_prometheus` module and exposed them to Prometheus. - - I visualized these metrics using a simple Grafana dashboard. - - Additionally, I used `node_exporter` to collect metrics from the Asterisk server node. - - ![incantogamus](/images/journey/prom-1.png) - - ![incantogamus](/images/journey/prom-2.png) - - ![incantogamus](/images/journey/prom-3.png) -- [ ] Collect K8s Cluster Metrics Using Prometheus -- [ ] Visualize the Metrics Using Grafana -- [ ] Create Alerts using Prometheus Alertmanager diff --git a/content/journey/mission-2.md b/content/journey/mission-2.md new file mode 100644 index 0000000..172dd64 --- /dev/null +++ b/content/journey/mission-2.md @@ -0,0 +1,43 @@ +--- +title: "My Journey: Prometheus and Grafana" +date: 2024-08-06T19:11:50+03:00 +draft: false +description: "Discovering Prometheus and Grafana" +image: "/images/journey/prom.png" +imageBig: "/images/journey/prom.webp" +categories: + [ + "journey", + "prometheus", + "grafana", + "monitoring", + "metrics", + "asterisk", + "observability", + "dashboard", + ] +avatar: "/images/avatar.webp" +--- + +## Mission 2 + +- [x] Discover Prometheus and Grafana + + - I discovered Prometheus, understanding its functionality and how to use it for monitoring applications. Additionally, I learned about Grafana and how to visualize the metrics collected by Prometheus. + - I also gained knowledge on creating and using an Exporter to gather metrics from an application and expose them to Prometheus. + +- [x] Collect and Visualize Asterisk Metrics + + - I collected metrics from an Asterisk server using the Asterisk `res_prometheus` module and exposed them to Prometheus. + - I visualized these metrics using a simple Grafana dashboard. + - Additionally, I used `node_exporter` to collect metrics from the Asterisk server node. + + ![incantogamus](/images/journey/prom-1.png) + + ![incantogamus](/images/journey/prom-2.png) + + ![incantogamus](/images/journey/prom-3.png) + +- [ ] Collect K8s Cluster Metrics Using Prometheus +- [ ] Visualize the Metrics Using Grafana +- [ ] Create Alerts using Prometheus Alertmanager diff --git a/content/journey/mission-3.md b/content/journey/mission-3.md new file mode 100644 index 0000000..a1c1b8e --- /dev/null +++ b/content/journey/mission-3.md @@ -0,0 +1,79 @@ +--- +title: "Managing authorizations in microservices." +date: 2024-08-09T20:11:50+03:00 +draft: false +description: "Discovering a way to manage authorizations and permissions in a microservices architecture using authorizations-as-service." +image: "/images/journey/auth-as-service.png" +imageBig: "/images/journey/auth-as-service.png" +categories: + ["journey", "authorization", "permissions", "permify", "microservices"] +avatar: "/images/avatar.webp" +--- + +## Authorizations in Microservices + +While developing a monolithic application, managing authorizations and permissions is a bit easier, as you can have a single point of control for all the authorizations and permissions. However, microservices have become a bit more complex. + +In a microservices architecture, each service has its own database and logic for handling permissions. This can lead to a lot of duplication and inconsistency in the way permissions are managed across services. also, there will be an issue of sharing the permissions across services. + +One way to solve this issue is to use an authorization-as-service. This means that you have a separate service that is responsible for managing all the authorizations for all the services in your architecture. + + +### POC + +Today I will do a quick proof of concept. I will use an open source that provide this functionality, there are a lot, + +#### Some of Open source solutions +- perimfy +- openfga +- casbin +- topaz + +#### Cloud solutions +- there are good cloud solutions like [Permit.io](https://www.permit.io) + +For today poc I will use [Permify](https://permify.co/). + +![permify](https://user-images.githubusercontent.com/34595361/196884110-147862c9-3657-4f07-831c-3e0d0e39eccf.png) +--- + +1. Run the permify service on docker and expose HTTP and GRPC ports. + +![step](/images/journey/auth-1.png) +--- + +2. Created a new tenant at permify to store our policies + +![step](/images/journey/auth-2.png) +--- + +3. Created our schema, I used here the traditional RBAC model for simplicity. but in the real world and complex apps, there are a lot of models for complex use cases. Actually, Permify is considered as fine-grained access control service inspired by `Googleโ€™s Zanzibar`. + + Permify has a gread article about their solution [Here](https://docs.permify.co/permify-overview/authorization-service) + +![step](/images/journey/auth-3.png) +--- +![step](/images/journey/auth-4.png) +--- + +4. Attached roles to our users + +![step](/images/journey/auth-5.png) +--- + +5. Created a simple nodejs services to test check user permissions using GRPC via permify sdk. + +![step](/images/journey/auth-6.png) +--- +![step](/images/journey/auth-7.png) +--- + +6. Created a wrapper to check user permissions. + +![step](/images/journey/auth-8.png) +--- + +7. Final Test + +![step](/images/journey/auth-9.png) +--- \ No newline at end of file diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 868355d..cb92108 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,4 +1,4 @@ - + {{ . }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 2e4a5ab..bde7474 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -11,7 +11,7 @@ - + {{ .Title }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index d912a69..b43169f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -6,7 +6,7 @@
- + @@ -27,7 +27,7 @@ - + diff --git a/static/images/journey/auth-1.png b/static/images/journey/auth-1.png new file mode 100644 index 0000000..d3d0d33 Binary files /dev/null and b/static/images/journey/auth-1.png differ diff --git a/static/images/journey/auth-2.png b/static/images/journey/auth-2.png new file mode 100644 index 0000000..5d391f1 Binary files /dev/null and b/static/images/journey/auth-2.png differ diff --git a/static/images/journey/auth-3.png b/static/images/journey/auth-3.png new file mode 100644 index 0000000..535391d Binary files /dev/null and b/static/images/journey/auth-3.png differ diff --git a/static/images/journey/auth-4.png b/static/images/journey/auth-4.png new file mode 100644 index 0000000..7aaa407 Binary files /dev/null and b/static/images/journey/auth-4.png differ diff --git a/static/images/journey/auth-5.png b/static/images/journey/auth-5.png new file mode 100644 index 0000000..74c340e Binary files /dev/null and b/static/images/journey/auth-5.png differ diff --git a/static/images/journey/auth-6.png b/static/images/journey/auth-6.png new file mode 100644 index 0000000..c2d4f38 Binary files /dev/null and b/static/images/journey/auth-6.png differ diff --git a/static/images/journey/auth-7.png b/static/images/journey/auth-7.png new file mode 100644 index 0000000..10a13ff Binary files /dev/null and b/static/images/journey/auth-7.png differ diff --git a/static/images/journey/auth-8.png b/static/images/journey/auth-8.png new file mode 100644 index 0000000..47cc8bc Binary files /dev/null and b/static/images/journey/auth-8.png differ diff --git a/static/images/journey/auth-9.png b/static/images/journey/auth-9.png new file mode 100644 index 0000000..b16bf81 Binary files /dev/null and b/static/images/journey/auth-9.png differ diff --git a/static/images/journey/auth-as-service.png b/static/images/journey/auth-as-service.png new file mode 100644 index 0000000..26128d2 Binary files /dev/null and b/static/images/journey/auth-as-service.png differ diff --git a/static/images/journey/discover.webp b/static/images/journey/discover.webp new file mode 100644 index 0000000..2639928 Binary files /dev/null and b/static/images/journey/discover.webp differ diff --git a/static/images/journey/k8s.png b/static/images/journey/k8s.png new file mode 100644 index 0000000..a392aba Binary files /dev/null and b/static/images/journey/k8s.png differ diff --git a/static/images/journey/prom.png b/static/images/journey/prom.png new file mode 100644 index 0000000..68818a1 Binary files /dev/null and b/static/images/journey/prom.png differ diff --git a/static/images/journey/prom.webp b/static/images/journey/prom.webp new file mode 100644 index 0000000..8163f89 Binary files /dev/null and b/static/images/journey/prom.webp differ diff --git a/static/styles/style.css b/static/styles/style.css index 951682b..86a0097 100644 --- a/static/styles/style.css +++ b/static/styles/style.css @@ -17,7 +17,7 @@ body { font-size: 16px; } -body.light{ +body.light { --bg: #dee4eb; --text: #1a2237; } @@ -55,6 +55,7 @@ a { position: sticky; top: 0; background-color: var(--bg); + flex-wrap: wrap; } .logo { @@ -165,7 +166,7 @@ a { font-size: 14px; } -.pagination{ +.pagination { display: flex; gap: 10px; list-style: none; @@ -176,7 +177,7 @@ a { margin-bottom: 30px; } -.page-item{ +.page-item { border: 1px solid gray; width: 30px; height: 30px; @@ -186,11 +187,12 @@ a { border-radius: 5px; } -.page-item.active{ +.page-item.active { background-color: var(--text); color: var(--bg); } -.page-item.disabled{ + +.page-item.disabled { background-color: #313845; cursor: not-allowed; } @@ -226,6 +228,7 @@ a { display: flex; align-items: center; gap: 20px; + flex-wrap: wrap; } .single-avatar { @@ -251,9 +254,10 @@ a { .single-bottom { display: flex; - justify-content: space-between; + justify-content: center; gap: 50px; margin-top: 50px; + max-width: 1136px !important; } .single-content { @@ -269,11 +273,6 @@ a { margin: 20px 0px; } -.single-content img { - width: 100%; - object-fit: cover; -} - .single-content pre { width: 100%; overflow-x: scroll; @@ -282,21 +281,47 @@ a { /* SINGLE END */ + +/* Markdown Styles START */ + +.md-img__a { + display: flex; + justify-content: center; +} + +.md-img { + display: block; + width: 100%; + border-radius: 15px; + box-shadow: 0 4px 10px rgba(0, 0, 0, .25); + border: 1px solid rgba(0, 0, 0, .5); + max-width: 850px; + height: auto; + box-sizing: border-box; +} + + +/* Markdown Styles END */ + + @media (max-width: 1536px) { .container { max-width: 1366px; } } + @media (max-width: 1366px) { .container { max-width: 1280px; } } + @media (max-width: 1280px) { .container { max-width: 1024px; } } + @media (max-width: 1024px) { .container { max-width: 768px; @@ -312,10 +337,12 @@ a { flex-direction: column-reverse; } } + @media (max-width: 768px) { .container { max-width: 640px; } + .links { font-size: 14px; } @@ -323,22 +350,23 @@ a { .list-Item__image { display: none; } -} -@media (max-width: 640px) { - .container { - max-width: 475px; - } -} + .links a { + display: none; + } -/* Markdown Styles START */ + .md-img { + max-width: 100%; + width: auto; + } -.md-img { - display: block; - max-width: 100%; - box-shadow: 0 4px 10px rgba(0, 0, 0, .25); - border: 1px solid rgba(0, 0, 0, .5); - border-radius: 15px; + .single-head__title { + font-size: 20px; + } } -/* Markdown Styles END */ +@media (max-width: 640px) { + .container { + max-width: 475px; + } +} \ No newline at end of file