아래의 예시는 pod을 기준으로 한다.
kubectl get pod <pod-name> -n <namespace> -o yaml
네임스페이스가 기본 네임스페이스인 default에 있다면 이 부분은 생략할 수 있다.
이 상태에서 webapp-color pod의 yaml을 보고 싶다면,
아래와 같이 kubectl get pods webapp-color -o yaml 명령어를 입력한다. (pod이 아닌 pods로 해도 상관없다. 개인적인 습관)
복사의 경우
kubectl get pod <pod-name> -n <namespace> -o yaml > xxx.yaml # xxx는 자유롭게
728x90
'Kubernetes' 카테고리의 다른 글
[k8s] pod의 env가 ConfigMap 참조하도록 설정 (0) | 2024.08.18 |
---|---|
[k8s] yaml 정의 파일 빠르게 템플릿 생성 (0) | 2024.07.31 |
[k8s] kubectl, minikube 세팅 (0) | 2024.07.18 |
[k8s] pod practice (0) | 2024.07.18 |
[k8s] Kubernetes Architecture (0) | 2024.07.08 |
댓글