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개 답변
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
전문가
GK
답변함 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠