---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: catalogue-db
  labels:
    name: catalogue-db
    app: sock-shop
  annotations:
    litmuschaos.io/chaos: "true"
  namespace: sock-shop
spec:
  replicas: 1
  selector:
    matchLabels:
      name: catalogue-db
      app: sock-shop
  template:
    metadata:
      labels:
        name: catalogue-db
        app: sock-shop
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9104"
    spec:
      containers:
      - name: catalogue-db
        image: weaveworksdemos/catalogue-db:0.3.0
        env:
          - name: MYSQL_ROOT_PASSWORD
            value: fake_password
          - name: MYSQL_DATABASE
            value: socksdb
        ports:
        - name: mysql
          containerPort: 3306
        resources:
          limits:
            cpu: 100m
            memory: 300Mi
          requests:
            cpu: 100m
            memory: 300Mi
      - name: mysqld-exporter
        image: prom/mysqld-exporter
        ports:
        - name: exporter
          containerPort: 9104
        env:
        - name: DATA_SOURCE_NAME
          value: 'root:fake_password@(localhost:3306)/'
      nodeSelector:
        beta.kubernetes.io/os: linux
        cloud.google.com/gke-nodepool: "default-pool"
