I'm testing with ceph-csi pv and pvc's on a kubernetes cluster (version 1.21.2). Trying to assign a small pv for a dnsmasq pod to be able to change dnsmasq.conf without restarting the pod.
apiVersion: v1
metadata:
name: dnsmasq-pvc
namespace: vt
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
storageClassName: ceph-rbd-sc
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: dnsmasq
namespace: vt
labels:
app: dnsmasq
spec:
serviceName: "dnsmasq"
replicas: 1
selector:
matchLabels:
app: dnsmasq
template:
metadata:
labels:
app: dnsmasq
spec:
hostname: dnsmasq
containers:
- name: dnsmasq
image: jpillora/dnsmasq
ports:
- containerPort: 8080
imagePullPolicy: IfNotPresent
env:
- name: HTTP_USER
value: "user"
- name: HTTP_PASS
value: "password"
volumeMounts:
- mountPath: /etc/dnsmasq.conf
name: dnsmasq-pvc
subPath: dnsmasq.conf
volumes:
- name: dnsmasq-pvc
persistentVolumeClaim:
claimName: dnsmasq-pvc
dnsPolicy: "None"
dnsConfig:
nameservers:
- 8.8.8.8
After i apply the yaml file and i get the error below:
Error: failed to create containerd task: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/var/lib/kubelet/pods/48d9fac5-1603-416c-83b1-d57de22e1c81/volume-subpaths/pvc-d197a21c-107c-47a9-b334-fa4f97375b57/dnsmasq/0" to rootfs at "/etc/dnsmasq.conf" caused: mount through procfd: not a directory: unknown
How can i resolve this?