File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ apiVersion: apps/v1
22kind : Deployment
33metadata :
44 name : github-service
5- namespace : github-service
5+ namespace : github
6+ annotations :
7+ prometheus.io/scrape : " true"
8+ prometheus.io/path : " /metrics"
9+ prometheus.io/port : " 4886"
610spec :
711 replicas : 1
812 selector :
1216 metadata :
1317 labels :
1418 app : github-service
19+ annotations :
20+ prometheus.io/scrape : " true"
21+ prometheus.io/path : " /metrics"
22+ prometheus.io/port : " 4886"
1523 spec :
1624 containers :
1725 - name : github-service
@@ -31,12 +39,12 @@ apiVersion: v1
3139kind : Service
3240metadata :
3341 name : github-service
34- namespace : github-service
42+ namespace : github
3543spec :
3644 selector :
3745 app : github-service
3846 ports :
3947 - protocol : TCP
40- port : 4886
48+ port : 80
4149 targetPort : 4886
4250 type : ClusterIP
Original file line number Diff line number Diff line change @@ -2,19 +2,20 @@ apiVersion: v1
22kind : PersistentVolumeClaim
33metadata :
44 name : postgres-pvc
5- namespace : github-service
5+ namespace : github
66spec :
77 accessModes :
88 - ReadWriteOnce
99 resources :
1010 requests :
1111 storage : 1Gi
12+ storageClassName : gp2
1213---
1314apiVersion : apps/v1
1415kind : Deployment
1516metadata :
1617 name : postgres
17- namespace : github-service
18+ namespace : github
1819spec :
1920 replicas : 1
2021 selector :
3738 value : " password"
3839 - name : POSTGRES_DB
3940 value : " careerDB"
41+ - name : PGDATA
42+ value : " /var/lib/postgresql/data/pgdata"
4043 volumeMounts :
4144 - name : postgres-storage
4245 mountPath : /var/lib/postgresql/data
@@ -49,7 +52,7 @@ apiVersion: v1
4952kind : Service
5053metadata :
5154 name : postgres
52- namespace : github-service
55+ namespace : github
5356spec :
5457 selector :
5558 app : postgres
Original file line number Diff line number Diff line change 1- kubectl create namespace github-service
1+ kubectl create namespace github
22
3- kubectl create secret generic github-service-secret --from-file=.env -n github-service
3+ kubectl create secret generic github-service-secret --from-file=.env -n github
44
55kubectl apply -f ./k8s/
66
7- kubectl exec -it <postgreSQL pod > -n github-servic -- bash
7+ kubectl exec -it <postgreSQL pod > -n github -- bash
88psql -U user -d careerDB
99
1010create table public."README_Data" (
Original file line number Diff line number Diff line change 44from pydantic import BaseModel
55import httpx
66import tempfile
7+ from prometheus_fastapi_instrumentator import Instrumentator
78
89from src .READMECreater .GithubFetcher import DownloadRepoFiles
910from src .READMECreater .READMEGenerator import GenerateREADME
2021from src .Utils .DBClient import ReadGithubFromUserID , ReadREADMEDB , ReadImageFromUserID
2122
2223app = FastAPI (title = "GitHub AI API" )
24+ instrumentator = Instrumentator ().instrument (app ).expose (app )
2325
2426
2527class RepoRequest (BaseModel ):
Original file line number Diff line number Diff line change 1111pybase64
1212supabase
1313httpx
14- psycopg2-binary
14+ psycopg2-binary
15+ prometheus-fastapi-instrumentator
You can’t perform that action at this time.
0 commit comments