From 8e6c78faf4d0040952a037656226f7b527e719ff Mon Sep 17 00:00:00 2001 From: Ivan Filipovic Date: Mon, 4 May 2026 17:10:51 +0200 Subject: [PATCH] fix: restore deployment selectors and fix namespace --- k8s/moj-servis/configmap.yaml | 9 +++++++ k8s/moj-servis/deployment.yaml | 46 ++++++++++++++++------------------ k8s/moj-servis/service.yaml | 2 +- 3 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 k8s/moj-servis/configmap.yaml diff --git a/k8s/moj-servis/configmap.yaml b/k8s/moj-servis/configmap.yaml new file mode 100644 index 0000000..5dd1eff --- /dev/null +++ b/k8s/moj-servis/configmap.yaml @@ -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!" diff --git a/k8s/moj-servis/deployment.yaml b/k8s/moj-servis/deployment.yaml index ae478b6..475d7d9 100644 --- a/k8s/moj-servis/deployment.yaml +++ b/k8s/moj-servis/deployment.yaml @@ -1,43 +1,39 @@ -# k8s/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: moj-servis - namespace: student-ivanivso7 + namespace: student-ivanivso7 # Provjeri da ovdje ne piše VAS_KORISNIK spec: + replicas: 1 + selector: + matchLabels: + app: moj-servis # OVO JE NEDOSTAJALO template: + metadata: + labels: + app: moj-servis # OVO MORA BITI ISTO KAO SELECTOR spec: containers: - name: moj-servis image: git.fpmoz.sum.ba/ivanivso7/moj-servis:1.0 ports: - containerPort: 8000 - - # ── Liveness: je li proces živ? ───────────────── - livenessProbe: + resources: + requests: + cpu: "50m" + memory: "64Mi" + limits: + cpu: "200m" + memory: "128Mi" + livenessProbe: # OVDJE TI JE FALIO "HANDLER TYPE" httpGet: - path: /health - port: 8000 - initialDelaySeconds: 10 # čekaj 10s nakon starta - periodSeconds: 15 # provjeri svakih 15s - timeoutSeconds: 3 # timeout odgovora - failureThreshold: 3 # 3 fail-a => restart - - - - # ── Readiness: prima li promet? ───────────────── + path: /health + port: 8000 + initialDelaySeconds: 10 + periodSeconds: 15 readinessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 2 - failureThreshold: 2 - - resources: - requests: { memory: "64Mi", cpu: "50m" } - limits: { memory: "128Mi", cpu: "200m" } - - - + periodSeconds: 10 \ No newline at end of file diff --git a/k8s/moj-servis/service.yaml b/k8s/moj-servis/service.yaml index c60cda2..3c6ec8d 100644 --- a/k8s/moj-servis/service.yaml +++ b/k8s/moj-servis/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: moj-servis-svc - namespace: student-VAS_KORISNIK + namespace: student-ivanivso7 spec: selector: app: moj-servis