iloom/k8s/30-iloom/gateway.yaml
Chever John 9c39c8cbd7
init: iloom WMS monorepo with K8s deployment manifests
Go workspace (go.work) with 5 microservices + shared library:
- gateway (8080), auth-service (8081), purchaser-service (8082)
- textile-service (8083), washing-service (8084)
- shared: proto definitions, common packages

Infrastructure: docker-compose for local dev, K8s manifests for
K3s cluster deployment (mysql/redis/etcd + traefik ingress).

Frontend (iloom-flatten) added as git submodule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-14 11:33:31 +08:00

86 lines
2.5 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: iloom-gateway
namespace: iloom
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
selector:
app: iloom-gateway
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: iloom-gateway
namespace: iloom
spec:
replicas: 1
selector:
matchLabels:
app: iloom-gateway
template:
metadata:
labels:
app: iloom-gateway
spec:
imagePullSecrets:
- name: harbor-pull-secret
initContainers:
- name: wait-auth
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
command: ['sh', '-c', 'until nc -z iloom-auth-service 8081; do sleep 2; done']
- name: wait-purchaser
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
command: ['sh', '-c', 'until nc -z iloom-purchaser-service 8082; do sleep 2; done']
- name: wait-textile
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
command: ['sh', '-c', 'until nc -z iloom-textile-service 8083; do sleep 2; done']
- name: wait-washing
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
command: ['sh', '-c', 'until nc -z iloom-washing-service 8084; do sleep 2; done']
containers:
- name: gateway
image: harbor-in-k3s.cheverjohn.me/iloom/iloom-gateway:v1
ports:
- containerPort: 8080
env:
- name: PORT
value: "8080"
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: app-secret
key: JWT_SECRET
- name: AUTH_SERVICE_URL
value: "http://iloom-auth-service:8081"
- name: PURCHASER_SERVICE_URL
value: "http://iloom-purchaser-service:8082"
- name: TEXTILE_SERVICE_URL
value: "http://iloom-textile-service:8083"
- name: WASHING_SERVICE_URL
value: "http://iloom-washing-service:8084"
- name: ALLOW_ORIGINS
value: "https://iloom.cheverjohn.me"
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 20
periodSeconds: 30