apiVersion: v1
kind: ReplicationController
metadata:
  name: s2y-db
spec:
  replicas: 1
  selector:
    app: s2y-db
  template:
    metadata:
      name: s2y-db
      labels:
        app: s2y-db
    spec:
      containers:
        - name: mariadb
          image: mariadb:10.3
          args:
            - "--ignore-db-dir=lost+found"
          ports:
            - name: mysql-port
              containerPort: 3306
          env:
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: s2y-server-secrets
                  key: db-password
          volumeMounts:
            - mountPath: "/var/lib/mysql"
              name: mysql-storage
      volumes:
        - name: mysql-storage
          persistentVolumeClaim:
            claimName: s2y-db-volume-claim
