apiVersion: v1
kind: ReplicationController
metadata:
  name: mysql-slave
  labels:
    name: mysql-slave
spec:
  replicas: 1
  selector:
    name: mysql-slave
  template:
    metadata:
      labels:
        name: mysql-slave
    spec:
      containers:
        - name: mysql-slave
          image: fjbarrena/mysql-slave:5.7
          ports:
            - containerPort: 3306
          env:
            - name: MYSQL_ROOT_PASSWORD
              value: "test"
            - name: MYSQL_REPLICATION_USER
              value: "root"
            - name: MYSQL_REPLICATION_PASSWORD
              value: "test"
            - name: MYSQL_MASTER_SERVICE_HOST
              value: "mysql-master-service"
