3.5.9.4. 특정 컨테이너에 스토리지 추가
devfile에 여러 컨테이너가 있는 경우 odo storage create 명령에서 --container 플래그를 사용하여 스토리지를 연결할 컨테이너를 지정할 수 있습니다.
다음 예제는 여러 컨테이너가 있는 devfile에서 발췌한 것입니다.
components:
- name: nodejs1
container:
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
memoryLimit: 1024Mi
endpoints:
- name: "3000-tcp"
targetPort: 3000
mountSources: true
- name: nodejs2
container:
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
memoryLimit: 1024Mi
이 예제에는nodejs1 및 nodejs2 라는 두 개의 컨테이너가 있습니다. 스토리지를 nodejs2 컨테이너에 연결하려면 다음 명령을 사용합니다.
$ odo storage create --container
출력 예:
$ odo storage create store --path /data --size 1Gi --container nodejs2
✓ Added storage store to nodejs-testing-xnfg
Please use `odo push` command to make the storage accessible to the component
odo storage list 명령을 사용하여 스토리지 리소스를 나열할 수 있습니다.
$ odo storage list
출력 예:
The component 'nodejs-testing-xnfg' has the following storage attached:
NAME SIZE PATH CONTAINER STATE
store 1Gi /data nodejs2 Not Pushed