How to share a file inside kube-ovn-monitor pod to another pod in a different namespace involving shared volumes

24 views Asked by At

I need to share the conf.db file located in /etc/openvswitch directory inside the kubeovn pod to another pod called ipmonitor involving a shared storage such that both pods can access and any changes made in the conf.db inside the ipmonitor pod should reflect in the other pods in the kubernetes cluster.

I created pv and pvc

apiVersion: v1
kind: PersistentVolume
metadata:
  name: shared-storage-pv
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteMany
  hostPath:
    path: /etc/openvswitch 
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: shared-storage-pvc
  namespace: kube-system
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Gi

and mounted the same pvc in both pods and kube ovn pod is running with the pvc with bound mount but the ipmonitor pod is stuck in pending state with message:

Volumes:
  shared-storage:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  shared-storage-pvc
    ReadOnly:   false


Warning  FailedScheduling  10m (x171 over 14h)  default-scheduler  0/1 nodes are available: persistentvolumeclaim "shared-storage-pvc" not found. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod..
1

There are 1 answers

0
Ron Etch On

It is important to know the supported storageclass or volume plugin being used since not all storage supports ReadWriteMany accessModes. You can see the sample configuration and more on the attached links.