K8S在集群节点挂载数据卷
K8S在集群节点挂载数据卷spec:volumes:- name: mysql-confhostPath:path: /usr/mysql/conftype: DirectoryOrCreate- name: mysql-datahostPath:path: /usr/mysql/datatype: D
·
K8S在集群节点挂载数据卷
spec:
volumes:
- name: mysql-conf
hostPath:
path: /usr/mysql/conf
type: DirectoryOrCreate
- name: mysql-data
hostPath:
path: /usr/mysql/data
type: DirectoryOrCreate
- name: mysql-log
hostPath:
path: /usr/mysql/log
type: DirectoryOrCreate
containers:
- name: mysql
image: '12.16.21.16/hub/mysql:5.7'
ports:
- name: mysql
containerPort: 3306
protocol: TCP
env:
- name: MYSQL_ROOT_HOST
value: '%'
- name: MYSQL_ROOT_PASSWORD
value: pwd
- name: TZ
value: Asia/Shanghai
resources:
limits:
memory: 2Gi
requests:
memory: 1Gi
volumeMounts:
- name: mysql-conf
mountPath: /etc/mysql
- name: mysql-data
mountPath: /var/lib/mysql
- name: mysql-log
mountPath: /logs
更多推荐
已为社区贡献3条内容
所有评论(0)