Files
stack/deploy/k8s/catalog-svc.yml
2025-12-13 13:12:25 +01:00

133 lines
3.4 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: catalog-svc
namespace: egommerce
annotations:
haproxy.org/check: "true"
labels:
app: catalog-svc
spec:
type: NodePort
selector:
app: catalog-svc
ports:
- name: catalog-svc
port: 443
nodePort: 31820
# - name: catalog-svc-metrics
# port: 9090
# nodePort: 31811
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: catalog-svc
namespace: egommerce
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1 # Number of extra pods that can be created during update
maxUnavailable: 1 # Max number of pods that can be unavailable during update
selector:
matchLabels:
app: catalog-svc
template:
metadata:
labels:
app: catalog-svc
spec:
# initContainers:
# - name: catalog-svc-init
# image: busybox:1.28
# command: [
# 'sh',
# '-c',
# '/bin/migrate'
# ]
containers:
- name: catalog-svc
image: localhost:32000/egommerce/catalog-svc:dev
imagePullPolicy: Always
env:
- name: APP_NAME
value: catalog-svc
- name: APP_DOMAIN
value: catalog-svc.egommerce.io
- name: APP_PATH_PREFIX
value: /catalog
- name: API_DATABASE_URL
value: postgres://egommerce:12345678@db-postgres:5432/egommerce?sslmode=disable
readinessProbe:
httpGet:
scheme: HTTPS
port: catalog-svc
path: /health
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 1
livenessProbe:
httpGet:
scheme: HTTPS
port: catalog-svc
path: /health
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 1
volumeMounts:
- name: catalog-cert
mountPath: /certs/catalog-svc.crt
readOnly: true
- name: catalog-key
mountPath: /certs/catalog-svc.key
readOnly: true
- name: catalog-migrations
mountPath: /migrations
readOnly: true
resources:
limits:
cpu: 100m
memory: 512M
requests:
cpu: 50m
memory: 256M
ports:
- name: catalog-svc
containerPort: 443
# - name: catalog-svc-metrics
# image: prom/prometheus-exporter:latest
# ports:
# - containerPort: 9090
# args:
# - --web.listen-address=:9090
# - --web.telemetry-path=/metrics
- name: catalog-scheduler # Scheduler Container
image: localhost:32000/egommerce/catalog-svc:dev
imagePullPolicy: Always
command: [
"/usr/local/bin/scheduler"
]
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 50m
memory: 256Mi
imagePullSecrets:
- name: regcred
volumes:
- name: catalog-cert
hostPath:
path: /egommerce/stack/deploy/certs/catalog-svc/catalog-svc.crt
type: File
- name: catalog-key
hostPath:
path: /egommerce/stack/deploy/certs/catalog-svc/catalog-svc.key
type: File
- name: catalog-migrations
hostPath:
path: /egommerce/stack/deploy/db_migrations/catalog-svc
type: Directory