apiVersion: apps/v1
kind: Deployment
metadata:
  name: tracker-web
  namespace: bytelyst-dashboards
  labels:
    app: tracker-web
    tier: dashboard
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tracker-web
  template:
    metadata:
      labels:
        app: tracker-web
        tier: dashboard
    spec:
      containers:
      - name: tracker-web
        image: bytelyst/tracker-web:latest
        imagePullPolicy: Never
        ports:
        - containerPort: 3003
          name: http
        env:
        - name: NODE_ENV
          value: "production"
        - name: PORT
          value: "3003"
        - name: PLATFORM_SERVICE_URL
          value: "http://platform-service.bytelyst-platform.svc:4003"
        resources:
          requests:
            cpu: "100m"
            memory: "256Mi"
          limits:
            cpu: "500m"
            memory: "512Mi"
        readinessProbe:
          httpGet:
            path: /
            port: 3003
          initialDelaySeconds: 15
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /
            port: 3003
          initialDelaySeconds: 30
          periodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
  name: tracker-web
  namespace: bytelyst-dashboards
spec:
  selector:
    app: tracker-web
  ports:
  - name: http
    port: 3003
    targetPort: 3003
---
apiVersion: v1
kind: Service
metadata:
  name: tracker-web-external
  namespace: bytelyst-dashboards
spec:
  type: NodePort
  selector:
    app: tracker-web
  ports:
  - name: http
    port: 3003
    targetPort: 3003
    nodePort: 3003
