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>
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: iloom-purchaser-service
|
|
namespace: iloom
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 8082
|
|
targetPort: 8082
|
|
selector:
|
|
app: iloom-purchaser-service
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: iloom-purchaser-service
|
|
namespace: iloom
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: iloom-purchaser-service
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: iloom-purchaser-service
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: harbor-pull-secret
|
|
initContainers:
|
|
- name: wait-mysql
|
|
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
|
|
command: ['sh', '-c', 'until nc -z mysql 3306; do sleep 2; done']
|
|
- name: wait-muyu-inventory
|
|
image: harbor-in-k3s.cheverjohn.me/iloom/busybox:1.36
|
|
command: ['sh', '-c', 'until nc -z muyu-inventory-rpc 9002; do sleep 2; done']
|
|
containers:
|
|
- name: purchaser-service
|
|
image: harbor-in-k3s.cheverjohn.me/iloom/iloom-purchaser-service:v1
|
|
ports:
|
|
- containerPort: 8082
|
|
env:
|
|
- name: PORT
|
|
value: "8082"
|
|
- name: DB_DSN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: db-secret
|
|
key: DB_DSN
|
|
- name: INTERNAL_SERVICE_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: app-secret
|
|
key: INTERNAL_SERVICE_KEY
|
|
- name: MUYU_INVENTORY_RPC_ADDR
|
|
value: "muyu-inventory-rpc:9002"
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 64Mi
|
|
limits:
|
|
cpu: 250m
|
|
memory: 128Mi
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8082
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8082
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 30
|