apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql-dp
  labels:
    app: mysql-app
    type: database
spec:
  template:
    metadata:
      name: mysql-pod
      labels:
        app: mysql-app
        type: database
    spec:
      containers:
      - name: mysql
        image: mysql:5.7
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: root
        - name: MYSQL_DATABASE
          value: kubedb
        - name: MYSQL_USER
          value: kubeadmin
        ports:
          - containerPort: 3306
  selector:
    matchLabels:
      app: mysql-app
  replicas: 1