add: configmap, ingress + update deployment with env refs
This commit is contained in:
10
k8s/moj-servis/configmap.yaml
Normal file
10
k8s/moj-servis/configmap.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
# k8s/moj-servis/configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: moj-servis-config
|
||||
namespace: student-marijanela218
|
||||
data:
|
||||
SERVICE_NAME: "moj-servis"
|
||||
LOG_LEVEL: "info"
|
||||
WELCOME_MSG: "Pozdrav iz FPMOZ k3s clustera!"
|
||||
@@ -1,3 +1,4 @@
|
||||
# k8s/moj-servis/deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -18,6 +19,20 @@ spec:
|
||||
image: git.fpmoz.sum.ba/marijanela218/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"
|
||||
|
||||
20
k8s/moj-servis/ingress.yaml
Normal file
20
k8s/moj-servis/ingress.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
# k8s/moj-servis/ingress.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: moj-servis-svc
|
||||
namespace: student-marijanela218
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
||||
spec:
|
||||
rules:
|
||||
- host: marijanela218.argocd.fpmoz.sum.ba
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: moj-servis-svc
|
||||
port:
|
||||
number: 80
|
||||
1
manifesti
Submodule
1
manifesti
Submodule
Submodule manifesti added at 296984a339
Reference in New Issue
Block a user