• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

nfs마운트에 대해서 질문 드립니다.

21.09.14 19:59 작성 조회수 281

1

강좌를 듣고 pv pvc를 작성하였습니다.

그런데 container에서 마운트를 하면 디렉토리 안에

lost+found만 있고 마운트가 안되있습니다.

무엇이 원인이 될수 있을까요.

container:tomcat

          volumeMounts:
            - namepvc-vol
              mountPath/app-logs
 
      volumes:
        - namepvc-vol
          persistentVolumeClaim:
            claimNamepvc-nfs
 
잘 부탁드리겠습니다.

답변 3

·

답변을 작성해보세요.

0

오...subpath라는게 있군요..자주 사용하지 않는 기능이라 몰랐네요.

근데 왜 그걸로 해서 마운트 되었는지 궁금하네요. 

일단 정의는 다음과 같고..

mountPath shows where the referenced volume should be mounted in the container. For instance, if you mount a volume to mountPath: /a/b/c, the volume will be available to the container under the directory /a/b/c.

Mounting a volume will make all of the volume available under mountPath. If you need to mount only part of the volume, such as a single file in a volume, you use subPath to specify the part that must be mounted. For instance, mountPath: /a/b/csubPath: d will make whatever d is in the mounted volume under directory /a/b/c

subpath 로 만들어진건  immutable로 만든 것처럼 업데이트도 주기적으로 하지 않는 군요. 

세밀하게 관리할때 사용 가능할 것 같네요. 저도 감사드립니다. 

https://kubernetes.io/ko/docs/concepts/storage/volumes/

0

김용구님의 프로필

김용구

질문자

2021.09.15

답변 감사드립니다.

volumeMounts에subPath를 추가하여 마운트 할수가 있었습니다

 

0

안녕하세요 

컨테이너 이미지를 tomcat을 쓰셨다고 적어주신거 같아요 

뭐 그거하고 관계는 없긴 하지만...

마운트 자체는 왠만한 이미지는 (보안적으로 막아진 이미지 제외) 되어야 하는거라서요 

좀 제한적으로 내용을 적어주셔서 파악하기가 애매하긴 한데 

뭔가 더 많이 만들어진거 같은데요..

현재의 pv,pvc를 모두 삭제하고 5.5를 진행하시면 될꺼 같아 보여요. 

정확히 파악하기 위해서는 pod상태와 logs, describe가 모두 필요해요. 

참고하셔서 한번 진행해 보시고 다시 얘기해주시겠어요?