Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # 초기화 전용 컨테이너 스토리지를 마운트할 때 '스토리지 안에 새로운 디렉터리를 만들고, 소유자를 변경한 후 데이터를 저장'하는 것과 같은 초기화 처리 전담 ### YAML <code> apiVersion: v1 kind: Pod metadata: name: init-sample spec: containers: - name: main # 메인 컨테이너 image: ubuntu command: ["/bin/sh"] args: [ "-c", "tail -f /dev/null"] volumeMounts: - mountPath: /docs # 공유 볼륨 마운트 경로 name: data-vol readOnly: false initContainers: # 메인 컨테이너 실행 전에 초기화 전용 컨테이너를 기동 - name: init image: alpine ## 공유 볼륨에 디렉터리를 작성하고, 소유를 변경 command: ["/bin/sh"] args: [ "-c", "mkdir /mnt/html; chown 33:33 /mnt/html" ] volumeMounts: - mountPath: /mnt # 공유 볼륨 마운트 경로 name: data-vol readOnly: false volumes: # 파드의 공유 볼륨 - name: data-vol emptyDir: {} </code> open/초기화-전용-컨테이너.txt Last modified: 2024/10/05 06:15by 127.0.0.1