apiVersion: apps/v1
kind: Deployment
metadata:
  name: chatapp-websocket
  namespace: chatapp
spec:
  replicas: 2
  selector:
    matchLabels:
      app: chatapp-websocket
  template:
    metadata:
      labels:
        app: chatapp-websocket
    spec:
      containers:
      - name: websocket
        image: chatapp-realtime:latest
        ports:
        - containerPort: 3002
        envFrom:
        - configMapRef:
            name: chatapp-config
        - secretRef:
            name: chatapp-secrets
        resources:
          requests:
            memory: "256Mi"
            cpu: "250m"
          limits:
            memory: "512Mi"
            cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
  name: websocket
  namespace: chatapp
spec:
  selector:
    app: chatapp-websocket
  ports:
  - port: 3002
    targetPort: 3002