apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql
spec:
  selector:
    matchLabels:
      app: mysql
  replicas: 1
  template:
    metadata:
      labels:
        app: mysql
    spec:
      hostname: mysql
      containers:
      - env:
          - name: MYSQL_DATABASE
            value: py_demo
          - name: MYSQL_PASSWORD
            value: root01
          - name: MYSQL_ROOT_HOST
            value: '%'
          - name: MYSQL_ROOT_PASSWORD
            value: hadoop
          - name: MYSQL_USER
            value: docker
        name: mysql
        ports:
          - containerPort: 3306
        image: 119.253.86.183:18080/hadoop_plus/book2/mysql:5.7
        tty: true

