apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: mariadb
  namespace: libki
spec:
  selector:
    matchLabels:
      app: mariadb
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: mariadb
    spec:
      containers:
        - image: linuxserver/mariadb
          name: mariadb
          envFrom:
            - configMapRef:
                name: mariadb-config
          ports:
            - containerPort: 3306
              name: mariadb
          volumeMounts:
            - name: mariadb-persistent-storage
              mountPath: /var/lib/mariadb
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
            limits:
              cpu: 200m
              memory: 100Mi
      volumes:
        - name: mariadb-persistent-storage
          persistentVolumeClaim:
            claimName: mariadb-pv-claim
