add: configmap, ingress + update deployment with env refs

This commit is contained in:
Vinko Jakeljic
2026-04-07 11:55:44 +02:00
parent 51dc194068
commit 8f75c63edd
3 changed files with 43 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: moj-servis-config
namespace: student-vinko004
data:
SERVICE_NAME: "moj-servis"
LOG_LEVEL: "info"
WELCOME_MSG: "Pozdrav iz FPMOZ k3s clustera!"

View File

@@ -18,10 +18,24 @@ spec:
image: git.fpmoz.sum.ba/blazp04/distribuirani:1.0 image: git.fpmoz.sum.ba/blazp04/distribuirani:1.0
ports: ports:
- containerPort: 8000 - containerPort: 8000
envFrom:
- configMapRef:
name: moj-servis-config
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: moj-servis-secret
key: DB_PASSWORD
- name: API_KEY
valueFrom:
secretKeyRef:
name: moj-servis-secret
key: API_KEY
resources: resources:
requests: requests:
memory: "64Mi" memory: "64Mi"
cpu: "50m" cpu: "50m"
limits: limits:
memory: "128Mi" memory: "128Mi"
cpu: "200m" cpu: "200m"

View File

@@ -0,0 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: moj-servis-ingress
namespace: student-vinko004
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web
spec:
rules:
- host: vinko004.argocd.fpmoz.sum.ba
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: moj-servis-svc
port:
number: 80