Ingress
This commit is contained in:
49
k8s/moj-servis/deployment.yaml
Normal file
49
k8s/moj-servis/deployment.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
# k8s/deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: helloo-cicdd
|
||||
namespace: student-marijanela218
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: helloo-cicdd
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: helloo-cicdd
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: gitea-creds
|
||||
containers:
|
||||
- name: helloo-cicdd
|
||||
image: git.fpmoz.sum.ba/Marijanela218/helloo-cicdd:latest
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
# ── Liveness: je li proces živ? ─────────────────
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 10 # čekaj 10s nakon starta
|
||||
periodSeconds: 15 # provjeri svakih 15s
|
||||
timeoutSeconds: 3 # timeout odgovora
|
||||
failureThreshold: 3 # 3 fail-a => restart
|
||||
|
||||
# ── Readiness: prima li promet? ─────────────────
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 2
|
||||
failureThreshold: 2
|
||||
|
||||
env:
|
||||
- name: APP_VERSION
|
||||
value: "latest"
|
||||
resources:
|
||||
requests: {cpu: 50m, memory: 64Mi}
|
||||
limits: {cpu: 200m, memory: 128Mi}
|
||||
22
k8s/moj-servis/ingress.yaml
Normal file
22
k8s/moj-servis/ingress.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: helloo-cicdd-ingress
|
||||
namespace: student-marijanela218
|
||||
annotations:
|
||||
# ── Traefik specifične opcije ──
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
- host: helloo-cicdd-marijanela218.argocd.fpmoz.sum.ba
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: helloo-cicdd-svc
|
||||
port:
|
||||
number: 80
|
||||
15
k8s/moj-servis/service.yml
Normal file
15
k8s/moj-servis/service.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
# k8s/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: helloo-cicdd-svc
|
||||
namespace: student-marijanela218
|
||||
spec:
|
||||
selector:
|
||||
app: helloo-cicdd
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8000
|
||||
protocol: TCP
|
||||
type: ClusterIP
|
||||
|
||||
Reference in New Issue
Block a user