apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: mysql
  labels:
    app: mysql
spec:
  selector:
    matchLabels:
      app: mysql
      version: v1
  replicas: 1
  template:
    metadata:
      labels:
        app: mysql
        version: v1
    spec:
      containers:
      - name: mysql
        # MySQL 5.5 should be used to match 
        # the support of express-mysql-session
        image: mysql:5.5
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: rootpassword
        - name: MYSQL_USER
          value: myuser
        - name: MYSQL_PASSWORD
          value: mypassword
        - name: MYSQL_DATABASE
          value: session
        ports:
        - containerPort: 3306
