ytdlbot/k8s/02.mariadb.yml

81 lines
1.4 KiB
YAML
Raw Normal View History

2022-11-25 15:09:56 +08:00
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
ytdl: mariadb-pvc
name: mariadb-pvc
namespace: ytdl
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 10Gi
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
creationTimestamp: null
labels:
ytdl: mariadb
name: mariadb
namespace: ytdl
spec:
replicas: 1
selector:
matchLabels:
ytdl: mariadb
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
ytdl: mariadb
spec:
containers:
- env:
- name: MYSQL_ROOT_PASSWORD
value: ro0tP4sSworD
- name: MYSQL_DATABASE
value: ytdl
image: mariadb:latest
name: mariadb
ports:
- containerPort: 3306
resources: {}
volumeMounts:
- mountPath: /var/lib/mysql
name: "mariadb-persistent-storage"
restartPolicy: Always
volumes:
- name: mariadb-persistent-storage
persistentVolumeClaim:
claimName: mariadb-pvc
status: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
ytdl: mariadb
name: mariadb-svc
namespace: ytdl
spec:
ports:
- name: "3306"
port: 3306
targetPort: 3306
selector:
ytdl: mariadb
status:
loadBalancer: {}