본문 바로가기
WIKI 기술 지식 베이스

diagnostics

원문 보기 위키 갱신

Linkerd 컴포넌트를 진단하는 데 사용되는 명령들이에요.

이 명령은 Linkerd의 기능을 진단하는 하위 명령(서브커맨드)들을 제공해요.

출처: Linkerd diagnostics

본문

예시

# Get control-plane component metrics
linkerd diagnostics controller-metrics

# Get metrics from the web deployment in the emojivoto namespace.
linkerd diagnostics proxy-metrics -n emojivoto deploy/web

# Get the endpoints for authorities in Linkerd's control-plane itself
linkerd diagnostics endpoints web.linkerd-viz.svc.cluster.local:8084

서브커맨드

Subcommand Description
controller-metrics Linkerd 컨트롤 플레인 컨테이너에서 직접 메트릭을 가져온다
endpoints Linkerd의 서비스 디스커버리 상태를 들여다본다
policy Linkerd의 정책 상태를 들여다본다
profile Linkerd의 서비스 디스커버리 상태를 들여다본다
proxy-metrics Linkerd 프록시에서 직접 메트릭을 가져온다

controller-metrics

Linkerd 컨트롤 플레인 컨테이너에서 직접 메트릭을 가져와요.

이 명령은 각 컨트롤 플레인 프로세스에 포트 포워딩을 시작하고 그들의 /metrics 엔드포인트를 조회해요.

플래그
Flag Usage
--wait-w 진단을 가져오는 데 허용되는 시간

endpoints

Linkerd의 서비스 디스커버리 상태를 들여다봐요.

이 명령은 컨트롤 플레인의 destination 컨테이너 내부 상태에 대한 디버그 정보를 제공해요. linkerd-proxy와 동일한 Destination 서비스 엔드포인트를 조회하고, 해당 destination과 연관된 주소들을 반환해요.

예시
# get all endpoints for the authorities emoji-svc.emojivoto.svc.cluster.local:8080 and web-svc.emojivoto.svc.cluster.local:80
linkerd diagnostics endpoints emoji-svc.emojivoto.svc.cluster.local:8080 web-svc.emojivoto.svc.cluster.local:80

# get that same information in json format
linkerd diagnostics endpoints -o json emoji-svc.emojivoto.svc.cluster.local:8080 web-svc.emojivoto.svc.cluster.local:80

# get the endpoints for authorities in Linkerd's control-plane itself
linkerd diagnostics endpoints web.linkerd-viz.svc.cluster.local:8084
플래그
Flag Usage
--destination-pod 실행 중인 파드가 여러 개일 때 특정 destination 파드를 대상으로 지정한다
--output-o 출력 형식; "table" 또는 "json" 중 하나
--token destination API에 요청할 때 사용할 context token

install-sp

proxy-metrics

Linkerd 프록시에서 직접 메트릭을 가져와요.

이 명령은 주어진 파드 또는 파드 집합에 포트 포워딩을 시작하고 Linkerd 프록시의 /metrics 엔드포인트를 조회해요.

RESOURCE 인자는 메트릭을 조회할 대상 리소스를 지정해요: (TYPE/NAME)

예시:

  • cronjob/my-cronjob
  • deploy/my-deploy
  • ds/my-daemonset
  • job/my-job
  • po/mypod1
  • rc/my-replication-controller
  • sts/my-statefulset

유효한 리소스 유형:

  • cronjobs
  • daemonsets
  • deployments
  • jobs
  • pods
  • replicasets
  • replicationcontrollers
  • statefulsets
예시
# Get metrics from pod-foo-bar in the default namespace.
linkerd diagnostics proxy-metrics po/pod-foo-bar

# Get metrics from the web deployment in the emojivoto namespace.
linkerd diagnostics proxy-metrics -n emojivoto deploy/web

# Get metrics from the linkerd-destination pod in the linkerd namespace.
linkerd diagnostics proxy-metrics -n linkerd $(
  kubectl --namespace linkerd get pod \
    --selector linkerd.io/control-plane-component=destination \
    --output name
)
플래그
Flag Usage
--namespace-n 리소스의 네임스페이스
--obfuscate 민감한 정보를 난독화한다

더 알아보기 (Learn more)