0

Hi I have set up an small NFS server at home using my raspberry pi.

An I want to set that as the default storage for all of my kubernetes containers.

However I keep on getting this chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

here is my config.

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: pg-ss
spec:
  replicas: 1
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
    spec: 
      containers:
      - name: postgres
        image: postgres:9.6
        volumeMounts:
        - name: pv-data
          mountPath: /var/lib/postgresql/data           
        env:
        - name: POSTGRES_USER
          value: postgres
        - name: POSTGRES_PASSWORD
          value: postgres
        ports:
        - containerPort: 5432
          name: postgredb
      volumes:
      - name: pv-data
        nfs:
          path: /mnt/infra-data/pg
          server: 192.168.1.150
          readOnly: false

I'm wondering what would be the cause of this. and how can i solve it. Thanks,

Jayson Gonzaga
  • 140
  • 1
  • 4
  • 11
  • https://serverfault.com/a/212181 – mdaniel Aug 02 '20 at 00:30
  • @mdaniel I tried adding ```no_root_squash``` but didn't work. my ```/mnt/``` is the directory where I mounted my usb – Jayson Gonzaga Aug 02 '20 at 14:58
  • please follow also this [post](https://stackoverflow.com/questions/51200115/chown-changing-ownership-of-data-db-operation-not-permitted/51203031#51203031) with additional 2 solotuins using securityContext and initContainers – Mark Aug 03 '20 at 14:52

0 Answers0