Skip to content

Deploy 🚀 #1

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

Merged
merged 3 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ languageCode = 'en-us'
title = 'OMAR.A'


paginate = 4
paginate = 10

[params]
description = "My Tech Blog"
Expand Down
14 changes: 14 additions & 0 deletions content/journey/journey.md
Original file line number Diff line number Diff line change
@@ -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)
37 changes: 7 additions & 30 deletions content/journey/mission-1.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
43 changes: 43 additions & 0 deletions content/journey/mission-2.md
Original file line number Diff line number Diff line change
@@ -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
79 changes: 79 additions & 0 deletions content/journey/mission-3.md
Original file line number Diff line number Diff line change
@@ -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)
---
2 changes: 1 addition & 1 deletion layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a href="{{ .Destination | safeURL }}" class="lightbox-image current gallery">
<a href="{{ .Destination | safeURL }}" class="lightbox-image current gallery md-img__a">
<img class='md-img' src="{{ .Destination | safeURL }}" {{- with .Text }} alt="{{ . }}" {{ end -}} {{- with .Title }}
title="{{ . }}" {{ end -}}>
</a>
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="/styles/style.css">
<link rel="icon" href="/images/favicon.png" />
<link rel="icon" href="/images/avatar.webp" />
<title>{{ .Title }}</title>
</head>

Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>

<div class="social">
<a href="{{ .Site.Params.social.linkedin }}" title="LinkedIn">
<a href="{{ .Site.Params.social.linkedin }}" title="LinkedIn" target="_blank">
<svg height="20" width="20" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
version="1.1" viewBox="0 0 512 512" width="100%" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"
xmlns:serif="http://www.serif.com/" xmlns:xlink="http://www.w3.org/1999/xlink">
Expand All @@ -27,7 +27,7 @@
</svg>
</a>

<a href="{{ .Site.Params.social.github }}" title="GitHub">
<a href="{{ .Site.Params.social.github }}" title="GitHub" target="_blank">
<svg enable-background="new -1163 1657.697 56.693 56.693" height="20" width="20" id="Layer_1" version="1.1"
viewBox="-1163 1657.697 56.693 56.693" width="56.693px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
Expand Down
Binary file added static/images/journey/auth-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/auth-as-service.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/discover.webp
Binary file not shown.
Binary file added static/images/journey/k8s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/prom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/journey/prom.webp
Binary file not shown.
Loading