08-27-周三_17-09-29
This commit is contained in:
52
Kubernetes/resources/03.mysql_v2.yaml
Normal file
52
Kubernetes/resources/03.mysql_v2.yaml
Normal file
@@ -0,0 +1,52 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: mysql
|
||||
name: mysql
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mysql
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mysql
|
||||
spec:
|
||||
containers:
|
||||
- name: mysql
|
||||
image: mariadb:10.3
|
||||
env:
|
||||
- name: MARIADB_ROOT_PASSWORD
|
||||
value: "123"
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/mysql
|
||||
- name: config
|
||||
mountPath: /etc/mysql/
|
||||
volumes:
|
||||
- name: data
|
||||
nfs:
|
||||
server: 10.3.202.100
|
||||
path: /root/data/nfs/mysql/data
|
||||
- name: config
|
||||
nfs:
|
||||
server: 10.3.202.100
|
||||
path: /root/data/nfs/mysql/config
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mysql
|
||||
spec:
|
||||
selector:
|
||||
app: mysql
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 3306
|
||||
targetPort: 3306
|
Reference in New Issue
Block a user