From 3da273a379c711224369861fc9849fea2820affe Mon Sep 17 00:00:00 2001 From: IvaCerkez Date: Tue, 31 Mar 2026 11:33:32 +0200 Subject: [PATCH 1/5] add: moj-servis k8s manifests (deployment + service) --- deployment.yaml | 28 ++++++++++++++++++++++++++++ service.yaml | 14 ++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 deployment.yaml create mode 100644 service.yaml diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..313b573 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,28 @@ +# k8s/moj-servis/deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: moj-servis + namespace: student-iva +spec: + replicas: 1 + selector: + matchLabels: + app: moj-servis + template: + metadata: + labels: + app: moj-servis + spec: + containers: + - name: moj-servis + image: git.fpmoz.sum.ba/iva/moj-servis:1.0 + ports: + - containerPort: 8000 + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "128Mi" + cpu: "200m" diff --git a/service.yaml b/service.yaml new file mode 100644 index 0000000..00858f8 --- /dev/null +++ b/service.yaml @@ -0,0 +1,14 @@ +# k8s/moj-servis/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: moj-servis-svc + namespace: student-iva +spec: + selector: + app: moj-servis + ports: + - port: 80 + targetPort: 8000 + protocol: TCP + type: NodePort From 9d52f7d4dbdc74c609fc8773009b84449c490e5b Mon Sep 17 00:00:00 2001 From: IvaCerkez Date: Tue, 31 Mar 2026 12:03:07 +0200 Subject: [PATCH 2/5] . --- deployment.yaml => k8n/moj-servis/deployment.yaml | 0 service.yaml => k8n/moj-servis/service.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename deployment.yaml => k8n/moj-servis/deployment.yaml (100%) rename service.yaml => k8n/moj-servis/service.yaml (100%) diff --git a/deployment.yaml b/k8n/moj-servis/deployment.yaml similarity index 100% rename from deployment.yaml rename to k8n/moj-servis/deployment.yaml diff --git a/service.yaml b/k8n/moj-servis/service.yaml similarity index 100% rename from service.yaml rename to k8n/moj-servis/service.yaml From 43892d901201eecf355e7c45bfd6f0d5c20755ef Mon Sep 17 00:00:00 2001 From: IvaCerkez Date: Tue, 7 Apr 2026 12:07:31 +0200 Subject: [PATCH 3/5] add: configmap, ingress + update deployment with env refs --- configmap.yaml | 10 ++++++++ ingress.yaml | 20 ++++++++++++++++ k8s/moj-servis/deployment.yaml | 42 ++++++++++++++++++++++++++++++++++ k8s/moj-servis/service.yaml | 14 ++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 configmap.yaml create mode 100644 ingress.yaml create mode 100644 k8s/moj-servis/deployment.yaml create mode 100644 k8s/moj-servis/service.yaml diff --git a/configmap.yaml b/configmap.yaml new file mode 100644 index 0000000..c7ff1cb --- /dev/null +++ b/configmap.yaml @@ -0,0 +1,10 @@ +# k8s/moj-servis/configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: moj-servis-config + namespace: student-iva +data: + SERVICE_NAME: "moj-servis" + LOG_LEVEL: "info" + WELCOME_MSG: "Pozdrav iz FPMOZ k3s clustera!" diff --git a/ingress.yaml b/ingress.yaml new file mode 100644 index 0000000..020327e --- /dev/null +++ b/ingress.yaml @@ -0,0 +1,20 @@ +# k8s/moj-servis/ingress.yaml +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: moj-servis-ingress + namespace: student-iva + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web +spec: + rules: + - host: iva.argocd.fpmoz.sum.ba + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: moj-servis-svc + port: + number: 80 diff --git a/k8s/moj-servis/deployment.yaml b/k8s/moj-servis/deployment.yaml new file mode 100644 index 0000000..bdb3024 --- /dev/null +++ b/k8s/moj-servis/deployment.yaml @@ -0,0 +1,42 @@ +# k8s/moj-servis/deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: moj-servis + namespace: student-iva +spec: + replicas: 1 + selector: + matchLabels: + app: moj-servis + template: + metadata: + labels: + app: moj-servis + spec: + containers: + - name: moj-servis + image: git.fpmoz.sum.ba/iva/moj-servis:1.0 + ports: + - containerPort: 8000 + envFrom: # <-- NOVO + - configMapRef: + name: moj-servis-config # <-- ConfigMap + env: # <-- NOVO + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: moj-servis-secret # <-- Secret + key: DB_PASSWORD + - name: API_KEY + valueFrom: + secretKeyRef: + name: moj-servis-secret + key: API_KEY + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "128Mi" + cpu: "200m" diff --git a/k8s/moj-servis/service.yaml b/k8s/moj-servis/service.yaml new file mode 100644 index 0000000..00858f8 --- /dev/null +++ b/k8s/moj-servis/service.yaml @@ -0,0 +1,14 @@ +# k8s/moj-servis/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: moj-servis-svc + namespace: student-iva +spec: + selector: + app: moj-servis + ports: + - port: 80 + targetPort: 8000 + protocol: TCP + type: NodePort From e23f254d6e7694692c81e3bca28f56565ea228bf Mon Sep 17 00:00:00 2001 From: IvaCerkez Date: Tue, 7 Apr 2026 12:20:34 +0200 Subject: [PATCH 4/5] add: configmap, ingress + update deployment with env refs --- configmap.yaml => k8s/moj-servis/configmap.yaml | 0 ingress.yaml => k8s/moj-servis/ingress.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename configmap.yaml => k8s/moj-servis/configmap.yaml (100%) rename ingress.yaml => k8s/moj-servis/ingress.yaml (100%) diff --git a/configmap.yaml b/k8s/moj-servis/configmap.yaml similarity index 100% rename from configmap.yaml rename to k8s/moj-servis/configmap.yaml diff --git a/ingress.yaml b/k8s/moj-servis/ingress.yaml similarity index 100% rename from ingress.yaml rename to k8s/moj-servis/ingress.yaml From 7359d34a7892ba66cce4e5abcd13683e71b1687a Mon Sep 17 00:00:00 2001 From: IvaCerkez Date: Tue, 7 Apr 2026 12:25:59 +0200 Subject: [PATCH 5/5] add: configmap, ingress + update deployment with env refs --- {k8s => k8n}/moj-servis/configmap.yaml | 0 k8n/moj-servis/deployment.yaml | 14 +++++++++ {k8s => k8n}/moj-servis/ingress.yaml | 0 k8s/moj-servis/deployment.yaml | 42 -------------------------- k8s/moj-servis/service.yaml | 14 --------- 5 files changed, 14 insertions(+), 56 deletions(-) rename {k8s => k8n}/moj-servis/configmap.yaml (100%) rename {k8s => k8n}/moj-servis/ingress.yaml (100%) delete mode 100644 k8s/moj-servis/deployment.yaml delete mode 100644 k8s/moj-servis/service.yaml diff --git a/k8s/moj-servis/configmap.yaml b/k8n/moj-servis/configmap.yaml similarity index 100% rename from k8s/moj-servis/configmap.yaml rename to k8n/moj-servis/configmap.yaml diff --git a/k8n/moj-servis/deployment.yaml b/k8n/moj-servis/deployment.yaml index 313b573..bdb3024 100644 --- a/k8n/moj-servis/deployment.yaml +++ b/k8n/moj-servis/deployment.yaml @@ -19,6 +19,20 @@ spec: image: git.fpmoz.sum.ba/iva/moj-servis:1.0 ports: - containerPort: 8000 + envFrom: # <-- NOVO + - configMapRef: + name: moj-servis-config # <-- ConfigMap + env: # <-- NOVO + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: moj-servis-secret # <-- Secret + key: DB_PASSWORD + - name: API_KEY + valueFrom: + secretKeyRef: + name: moj-servis-secret + key: API_KEY resources: requests: memory: "64Mi" diff --git a/k8s/moj-servis/ingress.yaml b/k8n/moj-servis/ingress.yaml similarity index 100% rename from k8s/moj-servis/ingress.yaml rename to k8n/moj-servis/ingress.yaml diff --git a/k8s/moj-servis/deployment.yaml b/k8s/moj-servis/deployment.yaml deleted file mode 100644 index bdb3024..0000000 --- a/k8s/moj-servis/deployment.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# k8s/moj-servis/deployment.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - name: moj-servis - namespace: student-iva -spec: - replicas: 1 - selector: - matchLabels: - app: moj-servis - template: - metadata: - labels: - app: moj-servis - spec: - containers: - - name: moj-servis - image: git.fpmoz.sum.ba/iva/moj-servis:1.0 - ports: - - containerPort: 8000 - envFrom: # <-- NOVO - - configMapRef: - name: moj-servis-config # <-- ConfigMap - env: # <-- NOVO - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: moj-servis-secret # <-- Secret - key: DB_PASSWORD - - name: API_KEY - valueFrom: - secretKeyRef: - name: moj-servis-secret - key: API_KEY - resources: - requests: - memory: "64Mi" - cpu: "50m" - limits: - memory: "128Mi" - cpu: "200m" diff --git a/k8s/moj-servis/service.yaml b/k8s/moj-servis/service.yaml deleted file mode 100644 index 00858f8..0000000 --- a/k8s/moj-servis/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# k8s/moj-servis/service.yaml -apiVersion: v1 -kind: Service -metadata: - name: moj-servis-svc - namespace: student-iva -spec: - selector: - app: moj-servis - ports: - - port: 80 - targetPort: 8000 - protocol: TCP - type: NodePort