apiVersion: apps/v1
kind: Deployment
metadata:
  name: chatapp-web
  namespace: chatapp
spec:
  replicas: 2
  selector:
    matchLabels:
      app: chatapp-web
  template:
    metadata:
      labels:
        app: chatapp-web
    spec:
      containers:
      - name: web
        image: chatapp-frontend:latest
        ports:
        - containerPort: 3001
        resources:
          requests:
            memory: "128Mi"
            cpu: "100m"
          limits:
            memory: "256Mi"
            cpu: "250m"
---
apiVersion: v1
kind: Service
metadata:
  name: web
  namespace: chatapp
spec:
  selector:
    app: chatapp-web
  ports:
  - port: 3001
    targetPort: 3001