apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mariadb
  labels:
    app: mariadb
spec:
  serviceName: mariadb
  selector:
    matchLabels:
      app: mariadb
  template:
    metadata:
      labels:
        app: mariadb
    spec:
      containers:
        - image: mariadb
          name: mariadb
          volumeMounts:
            - mountPath: /var/lib/mysql
              name:      mariadb-data
          env:
            - name: MYSQL_ROOT_PASSWORD
              value: mot-de-passe-root
  volumeClaimTemplates:
    - metadata:
        name: mariadb-data
      spec:
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 100Mi
