--- apiVersion: apps/v1 kind: StatefulSet metadata: name: nextcloud-mariadb namespace: kube-public labels: app: nextcloud-mariadb spec: replicas: 1 selector: matchLabels: app: nextcloud-mariadb template: metadata: labels: app: nextcloud-mariadb spec: terminationGracePeriodSeconds: 60 containers: - name: nextcloud-mariadb image: harbor.uenpay.com/base/mariadb:10.5 #image: mariadb:10.5 imagePullPolicy: IfNotPresent ports: - containerPort: 3306 env: - name: MYSQL_ROOT_PASSWORD value: nextcloud - name: MYSQL_LOG_CONSOLE value: "true" - name: MYSQL_DATABASE value: "nextcloud" - name: MYSQL_USER value: "nextcloud" - name: MYSQL_PASSWORD value: "nextcloud" readinessProbe: tcpSocket: port: 3306 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 30 failureThreshold: 10 livenessProbe: tcpSocket: port: 3306 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 3 failureThreshold: 1 resources: limits: cpu: 1 memory: 2Gi requests: cpu: 200m memory: 500Mi volumeMounts: - name: data mountPath: /var/lib/mysql volumeClaimTemplates: - metadata: name: data spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 30Gi --- apiVersion: v1 kind: Service metadata: name: nextcloud-mariadb namespace: kube-public labels: app: nextcloud-mariadb spec: selector: app: nextcloud-mariadb ports: - name: nextcloud-mariadb port: 3306 protocol: TCP