반응형
Kubernetes pod 루트 계정 접근 방법
kubectl get deploy
kubectl get -oyaml deploy test-deploy
kubectl edit -oyaml deploy test-deploy
securityContext : {} → runAsUser: 0 변경 후 반영
## ASIS
securityContext: {}
## TOBE
securityContext:
runAsUser:0
※ statefulset의 경우 위 방법으로 루트 계정 접근이 안될 수 있으므로 아래 방법으로 진행
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
-all
readOnlyRootFilesystem: ture -> false
runAsNonRoot: true -> false
runAsUser: 0 (추가)
반응형
'Kubernetes' 카테고리의 다른 글
[Kubernetes] k9s 유용한 명령어 정리 (0) | 2024.11.12 |
---|---|
[Kubernetes] Deploy Rolling Update maxSurge 값 조정 (0) | 2024.10.28 |
[Kubernetes] 컨테이너 자원 할당 정책 (0) | 2024.09.01 |
[Kubernetes] 바닐라 쿠버네티스(Vanilla Kubernetes) 란? (0) | 2024.08.10 |
[Kubernetes] Kubernetes Storage (0) | 2024.04.14 |