add: configmap, ingress + update deployment with env refs

This commit is contained in:
2026-04-07 11:33:02 +02:00
parent b873c97f9f
commit 744461565f
4 changed files with 52 additions and 2 deletions

View File

@@ -21,3 +21,4 @@ spec:
selfHeal: true selfHeal: true
syncOptions: syncOptions:
- CreateNamespace=true - CreateNamespace=true
#kubectl apply -f argocd/apps/moj-servis.app.yaml -n argocd

View File

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

View File

@@ -18,3 +18,24 @@ spec:
image: git.fpmoz.sum.ba/fsusak03/filipsusak:latest image: git.fpmoz.sum.ba/fsusak03/filipsusak:latest
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:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "200m"

View File

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