Compare commits

...

17 Commits

Author SHA1 Message Date
bafaad377a fixed 2026-05-25 22:01:26 +02:00
411e23b13e fix: enable stable 2 replicas under quota 2026-05-25 21:47:30 +02:00
eb460b62ac config: set MAX_TODOS=100 and fix deployment 2026-05-25 21:36:50 +02:00
a5a96d5472 Revert "scale fastapi to 3 replicas"
This reverts commit 45050eb643.
2026-05-25 21:31:35 +02:00
45050eb643 scale fastapi to 3 replicas 2026-05-25 21:26:16 +02:00
714fb2dd23 scale fastapi to 2 replicas 2026-05-25 20:59:08 +02:00
f24b199a84 fix cpu quota for fastapi deploy 2026-05-25 17:28:43 +02:00
36a8448c4b fix cpu quota for fastapi deploy 2026-05-25 17:13:27 +02:00
99d0f2be84 fix cpu quota for fastapi deploy 2026-05-25 16:57:37 +02:00
5d89a676df fix cpu quota for fastapi deploy 2026-05-25 16:38:43 +02:00
a7f3fa41a2 fix cpu quota for fastapi deploy 2026-05-25 16:05:01 +02:00
cf4991cc8d fix cpu quota for fastapi deploy 2026-05-25 15:44:46 +02:00
628fa7de31 fix 2026-05-25 14:57:20 +02:00
31cf0dd8c4 fix 2026-05-25 14:37:44 +02:00
4f59de0df9 fix fastapi image 2026-05-25 14:28:02 +02:00
58d14454e3 fix namespace 2026-05-25 14:20:20 +02:00
10540695f8 fix namespace 2026-05-25 14:03:17 +02:00
9 changed files with 26 additions and 13 deletions

View File

@@ -2,11 +2,11 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: fastapi-api
namespace: student-<vas-username>
namespace: student-iva
annotations:
argocd.argoproj.io/sync-wave: "1" # deploy NAKON baze
spec:
replicas: 1
replicas: 2
selector:
matchLabels:
app: fastapi-api
@@ -17,7 +17,10 @@ spec:
spec:
containers:
- name: fastapi-api
image: vasic/fastapi-todo-api:1.0
image: git.fpmoz.sum.ba/dvasic/fastapi-todo-api:1.0
ports:
- containerPort: 8000
env:

View File

@@ -2,13 +2,13 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: fastapi-api-ingress
namespace: student-<vas-username>
namespace: student-iva
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
rules:
- host: <vas-username>.fpmoz.sum.ba # zamijenite!
- host: iva.fpmoz.sum.ba # zamijenite!
http:
paths:
- path: /
@@ -20,5 +20,5 @@ spec:
number: 80
tls:
- hosts:
- <vas-username>.fpmoz.sum.ba
- iva.fpmoz.sum.ba
secretName: fastapi-api-tls

View File

@@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: fastapi-api-service
namespace: student-<vas-username>
namespace: student-iva
spec:
selector:
app: fastapi-api

View File

@@ -2,8 +2,9 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: fastapi-config
namespace: student-<vas-username>
namespace: student-iva
data:
DATABASE_HOST: postgres-service
DATABASE_PORT: "5432"
APP_ENV: production
MAX_TODOS: "100"

View File

@@ -1,6 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: student-<vas-username> # zamijenite <vas-username>
name: student-iva # zamijenite <vas-username>
labels:
managed-by: argocd

View File

@@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: postgres-secret
namespace: student-<vas-username>
namespace: student-iva
type: Opaque
data:
POSTGRES_PASSWORD: c3R1ZGVudDEyMw== # student123

View File

@@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: student-<vas-username>
namespace: student-iva
spec:
replicas: 1
selector:
@@ -21,6 +21,15 @@ spec:
name: postgres-secret # lozinke iz Secreta
ports:
- containerPort: 5432
resources:
requests:
cpu: "50m"
memory: "64Mi"
limits:
cpu: "100m"
memory: "128Mi"
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data

View File

@@ -2,7 +2,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: student-<vas-username>
namespace: student-iva
spec:
accessModes:
- ReadWriteOnce # jedan node moze pisati u isto vrijeme

View File

@@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: postgres-service
namespace: student-<vas-username>
namespace: student-iva
spec:
selector:
app: postgres