apiVersion: apps/v1
kind: Deployment
metadata:
  name: vapora-frontend
  namespace: vapora
  labels:
    app: vapora-frontend
    component: ui
spec:
  replicas: 2
  selector:
    matchLabels:
      app: vapora-frontend
  template:
    metadata:
      labels:
        app: vapora-frontend
        component: ui
    spec:
      containers:
      - name: frontend
        image: vapora/frontend:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        livenessProbe:
          httpGet:
            path: /health.html
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 10
          timeoutSeconds: 3
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: /health.html
            port: 80
          initialDelaySeconds: 2
          periodSeconds: 5
          timeoutSeconds: 2
          failureThreshold: 3
        resources:
          requests:
            cpu: 50m
            memory: 64Mi
          limits:
            cpu: 200m
            memory: 256Mi

---
apiVersion: v1
kind: Service
metadata:
  name: vapora-frontend
  namespace: vapora
  labels:
    app: vapora-frontend
    component: ui
spec:
  selector:
    app: vapora-frontend
  ports:
  - port: 80
    targetPort: 80
    name: http
    protocol: TCP
  type: LoadBalancer
