I'm currently experimenting with Kubernetes and installed a small cluster on ESX, which I ran here locally. I installed two sub nodes with the node wizard using Project Atomic with Fedora. The cluster is installed and working fine. However, at first I want the MySQL container to work and work, but no matter what I try, I cannot get it to work.
apiVersion: v1
kind: Pod
metadata:
name: mysql
labels:
name: mysql
spec:
containers:
- resources:
limits :
cpu: 0.5
image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: myPassw0rd
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
nfs:
server: 10.0.0.2
path: "/export/mysql"
For the volume, I have already tried all sorts of solutions, I tried to use a persistent volume with and without complaints. I tried using the host host and emptyDir, but I always get this error when starting the container:
chown: ownership change to / var / lib / mysql /: operation not allowed
I have to do something stupid, but I don’t know what to do here?