我正在尝试安装一个本地目录以供kubernetes中的容器使用,但是出现此错误:
$ kubectl logs mysql-pd
chown: changing ownership of '/var/lib/mysql/': Input/output error
minikube版本:v0.33.1
docker for mac版本:2.0.0.2(30215)
引擎:18.09.1
Kubernetes:v1.10.11
我正在使用挂载目录启动minikube:
minikube start --mount-string /Users/foo/mysql_data:/mysql_data --mount
deployment.yml
apiVersion: v1
kind: Pod
metadata:
name: mysql-pd
spec:
containers:
- image: mysql:5.7
name: mysql-container
env:
- name: MYSQL_ROOT_PASSWORD
value: ""
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "yes"
ports:
- containerPort: 3306
volumeMounts:
- mountPath: "/var/lib/mysql"
name: host-mount
volumes:
- name: host-mount
hostPath:
path: "/mysql_data"