fix: restore deployment selectors and fix namespace
This commit is contained in:
9
k8s/moj-servis/configmap.yaml
Normal file
9
k8s/moj-servis/configmap.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: moj-servis-config
|
||||||
|
namespace: student-ivanivso7
|
||||||
|
data:
|
||||||
|
SERVICE_NAME: "moj-servis"
|
||||||
|
LOG_LEVEL: "info"
|
||||||
|
WELCOME_MSG: "Pozdrav iz FPMOZ k3s clustera!"
|
||||||
@@ -1,43 +1,39 @@
|
|||||||
# k8s/deployment.yaml
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: moj-servis
|
name: moj-servis
|
||||||
namespace: student-ivanivso7
|
namespace: student-ivanivso7 # Provjeri da ovdje ne piše VAS_KORISNIK
|
||||||
spec:
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: moj-servis # OVO JE NEDOSTAJALO
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: moj-servis # OVO MORA BITI ISTO KAO SELECTOR
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: moj-servis
|
- name: moj-servis
|
||||||
image: git.fpmoz.sum.ba/ivanivso7/moj-servis:1.0
|
image: git.fpmoz.sum.ba/ivanivso7/moj-servis:1.0
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
|
resources:
|
||||||
# ── Liveness: je li proces živ? ─────────────────
|
requests:
|
||||||
livenessProbe:
|
cpu: "50m"
|
||||||
|
memory: "64Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "200m"
|
||||||
|
memory: "128Mi"
|
||||||
|
livenessProbe: # OVDJE TI JE FALIO "HANDLER TYPE"
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /health
|
path: /health
|
||||||
port: 8000
|
port: 8000
|
||||||
initialDelaySeconds: 10 # čekaj 10s nakon starta
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 15 # provjeri svakih 15s
|
periodSeconds: 15
|
||||||
timeoutSeconds: 3 # timeout odgovora
|
|
||||||
failureThreshold: 3 # 3 fail-a => restart
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ── Readiness: prima li promet? ─────────────────
|
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /health
|
path: /health
|
||||||
port: 8000
|
port: 8000
|
||||||
initialDelaySeconds: 5
|
initialDelaySeconds: 5
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
timeoutSeconds: 2
|
|
||||||
failureThreshold: 2
|
|
||||||
|
|
||||||
resources:
|
|
||||||
requests: { memory: "64Mi", cpu: "50m" }
|
|
||||||
limits: { memory: "128Mi", cpu: "200m" }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: moj-servis-svc
|
name: moj-servis-svc
|
||||||
namespace: student-VAS_KORISNIK
|
namespace: student-ivanivso7
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: moj-servis
|
app: moj-servis
|
||||||
|
|||||||
Reference in New Issue
Block a user