쿠버네티스
-
Pod 에 root 권한 주는 법Kubernetes 2023. 7. 1. 17:04
Pod 에서 작업을 하다 보면 `Operation not permitted` 에러가 자주 발생 하는데 root 권한이 없어서 발생하는 것이다. securityContext: privileged: true pod를 올릴 때 securityContext 설정을 해주면 root 권한을 부여 받을 수 있다. 전체 pod yaml 예시 --- apiVersion: v1 kind: Pod metadata: name: csi-rbd-demo-pod spec: containers: - name: web-server image: nginx securityContext: privileged: true volumeMounts: - name: mypvc mountPath: /var/lib/www/html volumes: - ..