K8s:部署MySQL
部署mysql5.7
创建密码
echo -n "1125482715" | base64
mysql-secret.yml:
---
apiVersion: v1
kind: Secret
metadata:
name: mysql-secrets
type: Opaque
data:
ROOT_PASSWORD: MTEyNTQ4MjcxNQ==
kubectl apply -f mysql-secret.yml
kubectl get secret
kubectl describe secret mysql-secrets
创建持久化卷
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-data-disk
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100m
kubectl apply -f mysql-volume.yml
kubectl get persistentvolumeclaim
kubectl describe persistentvolumeclaim mysql-data-disk