* increases timeout * refactor: reuse constants for redis db * avoid closing connection on pong error * fix: prevent electron from pausing timer executions Our pings could be paused when our app is backgrounded. * refactor: remove unnecessary refs * fix: presence unreliable within same pod It was broadcasting presence changes to other pods, but not notifying clients connected to the same pod
123 lines
2.3 KiB
YAML
123 lines
2.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: pusher
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: pusher
|
|
replicas: 2
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: pusher
|
|
spec:
|
|
serviceAccountName: default-service-account
|
|
nodeSelector:
|
|
cloud.google.com/gke-spot: "true"
|
|
terminationGracePeriodSeconds: 15
|
|
containers:
|
|
- name: pusher
|
|
image: "pusher"
|
|
ports:
|
|
- containerPort: 8080
|
|
- containerPort: 50051
|
|
resources:
|
|
requests:
|
|
memory: "52Mi"
|
|
cpu: 50m
|
|
limits:
|
|
memory: "52Mi"
|
|
cpu: 50m
|
|
env:
|
|
- name: "PORT"
|
|
value: "8080"
|
|
- name: "GRPC_PORT"
|
|
value: "50051"
|
|
- name: "REDIS_HOST"
|
|
value: "10.138.57.187"
|
|
- name: "LLINK_POSTGRES_CONNECTION_URL"
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: shared-secrets
|
|
key: LLINK_POSTGRES_CONNECTION_URL
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: pusher
|
|
spec:
|
|
selector:
|
|
app: pusher
|
|
ports:
|
|
- name: http
|
|
port: 8080
|
|
targetPort: 8080
|
|
protocol: TCP
|
|
- name: grpc
|
|
port: 50051
|
|
targetPort: 50051
|
|
protocol: TCP
|
|
|
|
---
|
|
|
|
kind: HTTPRoute
|
|
apiVersion: gateway.networking.k8s.io/v1beta1
|
|
metadata:
|
|
name: pusher
|
|
spec:
|
|
parentRefs:
|
|
- kind: Gateway
|
|
name: external-gateway
|
|
hostnames:
|
|
- pusher.dev.flowy.live
|
|
rules:
|
|
- backendRefs:
|
|
- name: pusher
|
|
port: 8080
|
|
|
|
---
|
|
|
|
# WebSocket connections need a much longer timeout than the default 30s.
|
|
# Without this, GKE terminates idle WS connections after 30 seconds.
|
|
apiVersion: networking.gke.io/v1
|
|
kind: GCPBackendPolicy
|
|
metadata:
|
|
name: pusher-backend-policy
|
|
spec:
|
|
default:
|
|
timeoutSec: 3600
|
|
connectionDraining:
|
|
drainingTimeoutSec: 30
|
|
targetRef:
|
|
group: ""
|
|
kind: Service
|
|
name: pusher
|
|
|
|
---
|
|
|
|
apiVersion: networking.gke.io/v1
|
|
kind: HealthCheckPolicy
|
|
metadata:
|
|
name: pusher-service-health-check
|
|
spec:
|
|
default:
|
|
checkIntervalSec: 15
|
|
timeoutSec: 15
|
|
healthyThreshold: 1
|
|
unhealthyThreshold: 2
|
|
logConfig:
|
|
enabled: true
|
|
config:
|
|
type: HTTP
|
|
httpHealthCheck:
|
|
portSpecification: USE_FIXED_PORT
|
|
port: 8080
|
|
requestPath: /health
|
|
targetRef:
|
|
group: ""
|
|
kind: Service
|
|
name: pusher
|