Compare commits
2 Commits
9d52f7d4db
...
e23f254d6e
| Author | SHA1 | Date | |
|---|---|---|---|
| e23f254d6e | |||
| 43892d9012 |
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-iva
|
||||||
|
data:
|
||||||
|
SERVICE_NAME: "moj-servis"
|
||||||
|
LOG_LEVEL: "info"
|
||||||
|
WELCOME_MSG: "Pozdrav iz FPMOZ k3s clustera!"
|
||||||
42
k8s/moj-servis/deployment.yaml
Normal file
42
k8s/moj-servis/deployment.yaml
Normal file
@@ -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"
|
||||||
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-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
|
||||||
14
k8s/moj-servis/service.yaml
Normal file
14
k8s/moj-servis/service.yaml
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user