-
쿠버네티스 컨테이너 설정 변경클라우드 교육/kubernetes 2023. 5. 6. 17:14
쿠버네티스에서는 파드 내 컨테이너의 /etc/hosts를 변경 가능한데
spec.hostAliases로 지정할 수 있다.
apiVersion: v1 kind: Pod metadata: name: s6 spec: containers: - name: nginx-container image: nginx:1.12 hostAliases: - ip: 8.8.8.8 hostnames: - google-dns - google-public-dns
위처럼 hostAliases 아래 지정하면
확인했을때 변경된 것을 확인할수있다.
이번에는 컨테이너 접속 시 시작 디렉터리 설정
spec.containers.workingDir 로 설정하면
apiVersion: v1 kind: Pod metadata: name: s7 spec: containers: - name: nginx-container image: nginx:1.16 workingDir: /tmp
시작위치가 바뀌는것을 확인할 수 있다.
'클라우드 교육 > kubernetes' 카테고리의 다른 글
쿠버네티스 Deployment Update (0) 2023.05.08 쿠버네티스 명령어 scale (0) 2023.05.07 쿠버네티스 DNS (0) 2023.05.06 쿠버네티스 메타데이터 (0) 2023.05.03 kubectx/kubens 설치 (0) 2023.04.30