i,m trying to create a persistent Ubuntu Kubernetes deployment
my idea was to mount the entire Ubuntu pod file system to a persistent volume
here is what i tried
apiVersion: apps/v1
kind: Deployment
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
replicas: 1
selector:
matchLabels:
app: ubuntu
template:
metadata:
labels:
app: ubuntu
spec:
containers:
- name: ubuntu
image: ubuntu:latest
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: "/"
name: task-pv-storage
volumes:
- name: task-pv-storage
persistentVolumeClaim:
claimName: task-pv-claim
but i get the following error
command : kubectl describe pod [Ubuntu-pod]
output:
Error: Error response from daemon: invalid bind mount spec "/home/moses/test:/:rslave": invalid volume specification: '/home/moses/test:/:rslave': invalid mount config for type "bind": invalid specification: destination can't be '/'
any ideas on how to achieve this?