unshare
명령을 활용--fork, --proc
옵션을 통해서 메인 프로세스를 기준으로 서브 프로세스 (local command) 단위 네임스페이스 생성--mount-proc --mount
옵션을 통해서 프로세스의 네임스페이스로 마운트될 파일 시스템 구성 (kubectl 등이 설치된 파일 시스템)unshare
명령을 활용하기 때문에 컨테이너 환경에서만 동작using VSCode
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch remote",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "",
"port": 5555,
"host": "127.0.0.1",
"showLog": true,
"trace": "log"
}
]
}
using docker-compose
$ docker-compose -f src/app/terminal/dc-debug.yaml up --build
./src/app/terminal/terminal-main.go
파일 func healthy(w http.ResponseWriter, r *http.Request) {
에 break-point 지정$ curl http://localhost:3003/healthy
${HOME}/.kube/config
적용$ docker run --rm -d --privileged -p 3003:3003 --name terminal \
-v "${HOME}/.kube:/app/.kube"\
ghcr.io/kore3lab/kore-board.terminal:latest --kubeconfig=/app/.kube/config --corsonoff=off
kubectl config view
를 실행시키는 간단한 클라이언트 예제kubectl config view
) 전달</html> ```