Enforce read-only access on EFS to pod

0

Hello, I have two k8s pods accessing the same EFS. One pod writes in the filesystem and the other reads from it. How can I limit the access of the 2nd pod to readonly?

1 Antwort
0

Hi

Two ways you can do it

  1. PVC with ReadOnly Access Mode: Create a separate PVC with accessModes: ["ReadOnly"] for the read-only pod.

https://aws.amazon.com/blogs/storage/persistent-storage-for-kubernetes/ Or 2. Pod Security Policies (PSPs):Enforce Read-Only Mounts: Create a PSP that restricts pods to read-only volume mounts. Annotate Read-Only Pods: Annotate pods requiring read-only access with a designated key-value pair.

https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

profile picture
EXPERTE
GK
beantwortet vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen