apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    service: frontend
    app: ecommerce
    tags.datadoghq.com/env: "ruby-shop"
    tags.datadoghq.com/service: "store-frontend"
    tags.datadoghq.com/version: "2.0"
  name: frontend-broken
spec:
  replicas: 1
  selector:
    matchLabels:
      service: frontend
      app: ecommerce
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        service: frontend
        app: ecommerce
        tags.datadoghq.com/env: "ruby-shop"
        tags.datadoghq.com/service: "store-frontend"
        tags.datadoghq.com/version: "2.0"
    spec:
      containers:
      - args:
        - docker-entrypoint.sh
        command:
        - sh
        env:
        - name: DB_USERNAME
          value: user
        - name: DB_PASSWORD
          valueFrom:
            secretKeyRef:
              key: pw
              name: db-password
        - name: DD_AGENT_HOST
          valueFrom:
            fieldRef:
              fieldPath: status.hostIP
        - name: DD_LOGS_INJECTION
          value: "true"
        - name: DD_ENV
          valueFrom:
            fieldRef:
              fieldPath: metadata.labels['tags.datadoghq.com/env']
        - name: DD_VERSION
          valueFrom:
            fieldRef:
              fieldPath: metadata.labels['tags.datadoghq.com/version']
        - name: DD_SERVICE
          valueFrom:
            fieldRef:
              fieldPath: metadata.labels['tags.datadoghq.com/service']
        - name: DD_RUNTIME_METRICS_ENABLED
          value: "true"
        - name: DD_ANALYTICS_ENABLED
          value: "true"
        # Enable RUM
        - name: DD_CLIENT_TOKEN
          value: "pubf5a158cd2aab6ce0a10b919757b19d3d"
        - name: DD_APPLICATION_ID
          value: "fec827c1-d98f-474f-9d70-8b90489204a1"
        image: ddtraining/ecommerce-frontend:latest
        imagePullPolicy: Always
        name: ecommerce-spree-observability
        ports:
        - containerPort: 3000
          protocol: TCP
        resources:
          requests:
            cpu: 300m
            memory: 300Mi
          limits: {}
