Skip to main content
The WebSocket service (exchange-ws-stream) provides real-time market data streaming capabilities for the exchange platform.

Deployment Configuration

apiVersion: apps/v1
kind: Deployment
metadata:
  name: exchange-ws-stream-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: exchange-ws-stream
  template:
    metadata:
      labels:
        app: exchange-ws-stream
    spec:
      containers:
        - name: exchange-ws-stream
          image: jogeshwar01/exchange-ws-stream:ed9f044dc79ee713da9518648524e0c68a70ddf7
          ports:
            - containerPort: 4000
          env:
            - name: WS_STREAM_URL
              valueFrom:
                configMapKeyRef:
                  name: exchange-ws-stream-config
                  key: ws_stream_url
            - name: REDIS_URL
              valueFrom:
                configMapKeyRef:
                  name: exchange-ws-stream-config
                  key: redis_url

Service Configuration

The WebSocket service is exposed on port 80, routing to container port 4000.
apiVersion: v1
kind: Service
metadata:
  name: exchange-ws-stream-service
spec:
  selector:
    app: exchange-ws-stream
  ports:
    - protocol: TCP
      port: 80
      targetPort: 4000
  type: ClusterIP

ConfigMap

Configuration is managed through a ConfigMap:
apiVersion: v1
kind: ConfigMap
metadata:
  name: exchange-ws-stream-config
data:
  ws_stream_url: "0.0.0.0:4000"
  redis_url: "redis://exchange-redis-service.default.svc.cluster.local:80"

Environment Variables

VariableValueDescription
WS_STREAM_URL0.0.0.0:4000WebSocket server listen address
REDIS_URLredis://exchange-redis-service.default.svc.cluster.local:80Redis connection URL for pub/sub

Service Details

  • Container Port: 4000
  • Service Port: 80
  • Replicas: 1
  • Service Type: ClusterIP
  • Image: jogeshwar01/exchange-ws-stream:ed9f044dc79ee713da9518648524e0c68a70ddf7

Dependencies

The WebSocket service depends on:
  • Redis: For real-time message pub/sub and caching
  • exchange-redis-service: Internal cluster service endpoint

Build docs developers (and LLMs) love