初始化提交
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ws-gateway
|
||||
labels:
|
||||
app.kubernetes.io/name: ws-gateway
|
||||
spec:
|
||||
replicas: 2
|
||||
revisionHistoryLimit: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: ws-gateway
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: ws-gateway
|
||||
spec:
|
||||
serviceAccountName: easyai-workload
|
||||
terminationGracePeriodSeconds: 45
|
||||
containers:
|
||||
- name: ws-gateway
|
||||
image: registry.cn-shanghai.aliyuncs.com/easyaigc/wsgateway:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: websocket
|
||||
containerPort: 3002
|
||||
- name: tcp-events
|
||||
containerPort: 4002
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: easyai-app-config
|
||||
- secretRef:
|
||||
name: easyai-app-secret
|
||||
env:
|
||||
- name: GATEWAY_CLUSTER_NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: CONFIG_TCP_HOST
|
||||
value: 0.0.0.0
|
||||
- name: CONFIG_TCP_PORT
|
||||
value: "4002"
|
||||
- name: GATEWAY_INBOUND_ENABLED
|
||||
value: "true"
|
||||
- name: GATEWAY_INBOUND_TCP_HOST
|
||||
value: easyai-server
|
||||
- name: GATEWAY_INBOUND_TCP_PORT
|
||||
value: "4001"
|
||||
volumeMounts:
|
||||
- name: pm2
|
||||
mountPath: /app/.pm2
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: websocket
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: websocket
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
resources:
|
||||
requests:
|
||||
cpu: 200m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 512Mi
|
||||
securityContext:
|
||||
readOnlyRootFilesystem: true
|
||||
allowPrivilegeEscalation: false
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
volumes:
|
||||
- name: pm2
|
||||
emptyDir: {}
|
||||
- name: tmp
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ws-gateway
|
||||
labels:
|
||||
app.kubernetes.io/name: ws-gateway
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app.kubernetes.io/name: ws-gateway
|
||||
ports:
|
||||
- name: websocket
|
||||
port: 3002
|
||||
targetPort: websocket
|
||||
- name: tcp-events
|
||||
port: 4002
|
||||
targetPort: tcp-events
|
||||
Reference in New Issue
Block a user