← 返回命令列表

Linux command

linkerd 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Check CLI and control plane versions

linkerd version

Validate cluster configuration

linkerd check

Install Linkerd

linkerd install | kubectl apply -f -

Inject sidecar proxy

linkerd inject [deployment.yaml] | kubectl apply -f -

View real-time traffic

linkerd stat deploy

Open Linkerd dashboard

linkerd viz dashboard

View top traffic

linkerd viz top deploy/[name]

Check proxy status

linkerd diagnostics proxy-metrics -n [namespace] [pod-name]

Generate Linkerd upgrade manifest

linkerd upgrade | kubectl apply -f -

说明

linkerd is the CLI for Linkerd, a lightweight service mesh for Kubernetes. It manages installation, proxy injection, and provides observability tools for microservices traffic. The install command generates Kubernetes manifests for the control plane. Pipe output to kubectl apply for deployment. Use check to validate prerequisites and installation health. Sidecar proxy injection with inject adds the Linkerd proxy to pods, enabling mTLS, traffic metrics, and load balancing. Injection can be automated via namespace annotations. The viz extension provides observability features. The dashboard opens a web UI showing service topology and metrics. Commands like stat, top, and tap provide CLI-based traffic analysis. Linkerd uses mutual TLS by default, automatically encrypting traffic between meshed services without application changes.

参数

--context _name_
Kubernetes context to use.
--kubeconfig _path_
Path to kubeconfig file.
--api-addr _address_
Override API server address.
--namespace, -n _namespace_
Target namespace.
--linkerd-namespace _namespace_
Linkerd control plane namespace.
--set _key=value_
Override configuration values.
--values _file_
Path to values file for configuration.
--verbose
Enable verbose output.
--as _user_
Impersonate a Kubernetes user.
-o, --output _format_
Output format: table, json, yaml.

FAQ

What is the linkerd command used for?

linkerd is the CLI for Linkerd, a lightweight service mesh for Kubernetes. It manages installation, proxy injection, and provides observability tools for microservices traffic. The install command generates Kubernetes manifests for the control plane. Pipe output to kubectl apply for deployment. Use check to validate prerequisites and installation health. Sidecar proxy injection with inject adds the Linkerd proxy to pods, enabling mTLS, traffic metrics, and load balancing. Injection can be automated via namespace annotations. The viz extension provides observability features. The dashboard opens a web UI showing service topology and metrics. Commands like stat, top, and tap provide CLI-based traffic analysis. Linkerd uses mutual TLS by default, automatically encrypting traffic between meshed services without application changes.

How do I run a basic linkerd example?

Run `linkerd version` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --context _name_ do in linkerd?

Kubernetes context to use.