컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
컨테이너에서 셸 명령어 실행
일부 문제를 해결하려면 컨테이너에 액세스하여 컨테이너 자체에서 직접 명령어를 실행해야 할 수 있습니다. bash
셸을 통하거나 kubectl exec
명령어를 사용하여 PowerShell을 통해 컨테이너에 액세스할 수 있습니다.
kubectl describe pods
를 사용하여 연결하려는 클러스터에서 Pod의 이름을 찾습니다.다음 예시에서 명령어는 suitecrm-0 Pod를 나열합니다.
kubectl describe pods | grep Name
Name: suitecrm-0
- 다음 메서드 중 하나를 사용하여 셸 명령어를 실행합니다.
kubectl exec
를 사용하여 명령어를 실행할 수 있는 bash 명령어 셸을 엽니다.
kubectl exec -it pod-name -- /bin/bash
다음 예시에서는 suitecrm-0 Pod에 대한 셸을 가져옵니다.
kubectl exec -it suitecrm-0 -- /bin/bash
kubectl exec
를 사용하여 명령어를 직접 실행할 수 있습니다.
kubectl exec -it pod-name -- /bin/bash -c "command(s)"
다음 예시에서는 suitecrm-0 Pod의 루트 디렉터리를 나열합니다.
kubectl exec -it suitecrm-0 -- /bin/bash -c "ls /"
자세한 내용은 Kubernetes 문서를 참조하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2022-05-24(UTC)
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"번역 문제"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"기타"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"이해하기 쉬움"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"문제가 해결됨"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"기타"
}]