86 lines
2.5 KiB
YAML
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
|