apiVersion: v1
kind: ReplicationController
metadata:
  name: mysql-master
  labels:
    name: mysql-master
spec:
  replicas: 1
  selector:
    name: mysql-master
  template:
    metadata:
      labels:
        name: mysql-master
    spec:
      containers:
        - name: master
          image: paulliu/mysql-master:0.1
          ports:
            - containerPort: 3306
          volumeMounts:
            - name: mysql-data
              mountPath: /var/lib/mysql
          env:
            - name: MYSQL_ROOT_PASSWORD
              value: "test"
            - name: MYSQL_REPLICATION_USER
              value: 'demo'
            - name: MYSQL_REPLICATION_PASSWORD
              value: 'demo'
      volumes:
        - name: mysql-data
          hostPath:
            path: /var/lib/mysql
