Skip to content

Commands: Service mesh & networking

Istio, Linkerd, Consul and Envoy commands.

Index
  • #istio
  • #linkerd
  • #consul
  • #envoy
  • #network
Updated

Also:service mesh · istioctl · sidecar · mtls · service discovery

13 items

Istio4

Istio: Check proxy sync status

Safe

Whether every sidecar is in sync with istiod (SYNCED vs STALE).

istioctl proxy-status
What each part does
  1. istioctl proxy-statusevery sidecar and whether its config (CDS, LDS, EDS, RDS) is SYNCED or STALE with istiod

Also known as: STALE · proxy-status · envoy sync

Istio: Analyze a namespace for config problems

Safe

Finds broken VirtualServices, missing gateways, sidecar injection issues.

istioctl analyze -n <namespace>
What each part does
  1. istioctl analyzecheck Istio config for errors: missing gateways, bad hosts, conflicting rules
  2. -n <namespace>namespace to analyze; -A for all

Also known as: istio analyze · virtualservice

Istio: Show Envoy routes for a pod

Safe

The routes the sidecar actually received. Use clusters/listeners/endpoints for other views.

istioctl proxy-config routes <pod>.<namespace>
What each part does
  1. istioctl proxy-config routesshow the HTTP routes the pod's Envoy sidecar has
  2. <pod>.<namespace>the pod, written as name.namespace

Also known as: 404 NR · no healthy upstream · proxy-config

Istio: Enable sidecar injection for a namespace

Safe

New pods get an Envoy sidecar. Restart existing deployments to inject them.

kubectl label namespace <namespace> istio-injection=enabled --overwrite
What each part does
  1. kubectl label namespace <namespace>set a label on the namespace
  2. istio-injection=enabledtells Istio to inject the sidecar into new pods here (restart existing ones)
  3. --overwritereplace the label if it already has a value

Also known as: sidecar injection · istio-injection

Linkerd3

Linkerd: Check control plane health

Safe

Validates the install, certificates and data plane. Add --proxy -n <ns> for workloads.

linkerd check
What each part does
  1. linkerd checkrun checks on the CLI, cluster, control plane and certificates; add --proxy to check data-plane proxies

Also known as: linkerd check

Linkerd: Show live traffic stats for deployments

Safe

Success rate, RPS and latency percentiles per deployment.

linkerd viz stat deploy -n <namespace>
What each part does
  1. linkerd viz statgolden metrics: success rate, RPS, latency p50/p95/p99 (needs the viz extension)
  2. deployresource type: per deployment
  3. -n <namespace>in this namespace

Also known as: golden metrics · success rate

Linkerd: Tap live requests to a deployment

Safe

Stream individual requests and responses flowing through the proxies.

linkerd viz tap deploy/<deployment> -n <namespace>
What each part does
  1. linkerd viz tapstream live requests and responses passing through the proxies
  2. deploy/<deployment>the deployment to watch
  3. -n <namespace>its namespace

Also known as: linkerd tap

Consul3

Consul: List cluster members

Safe

Agents in the cluster with status (alive, failed, left).

consul members
What each part does
  1. consul memberslist the agents in the gossip pool: node, address, status (alive / failed / left), type, datacenter

Also known as: consul members · agent failed

Consul: Look up a service via Consul DNS

Safe

Healthy instances and ports as Consul DNS returns them.

dig @127.0.0.1 -p 8600 <service>.service.consul SRV
What each part does
  1. digDNS lookup tool
  2. @127.0.0.1ask the local Consul agent instead of the system resolver
  3. -p 8600Consul's DNS port
  4. <service>.service.consulname of a registered service; only healthy instances are returned
  5. SRVrecord type: returns the port as well as the host

Also known as: service discovery · consul dns

Consul: Read a KV value

Safe

Read one key; add -recurse to dump a prefix.

consul kv get <key>
What each part does
  1. consul kv getread a value from Consul's key/value store
  2. <key>key path, e.g. config/app/db_url; add -recurse to read a whole prefix

Also known as: consul kv

Envoy3

Envoy: Dump the running config

Safe

Full listeners/clusters/routes config from the admin API (Istio sidecars: port 15000).

curl -s localhost:<admin-port>/config_dump > envoy-config.json
What each part does
  1. curl -s localhost:<admin-port>/config_dumpthe full config Envoy is running now: listeners, routes, clusters, secrets (redacted)
  2. > envoy-config.jsonsave it to a file (it's large)

Also known as: config_dump · envoy admin

Envoy: Check upstream cluster health

Safe

Shows which upstream hosts are failing health checks or ejected.

curl -s localhost:<admin-port>/clusters | grep -E 'health_flags|cx_active'
What each part does
  1. curl -s localhost:<admin-port>/clustersEnvoy admin API: stats for every upstream host (admin port is often 15000 or 9901)
  2. | grep -Ekeep only lines matching the regex
  3. 'health_flags|cx_active'health flags (healthy or /failed_active_hc etc.) and active connections

Also known as: no healthy upstream · 503 UH · outlier detection

Envoy: Raise the log level at runtime

Caution

Turn on debug logs without a restart. Set it back to info afterwards.

curl -X POST "localhost:<admin-port>/logging?level=debug"
What each part does
  1. curl -X POSTadmin API changes need POST
  2. localhost:<admin-port>/loggingthe logging endpoint
  3. ?level=debugset every logger to debug; set it back to info when done, or use ?<logger>=debug for one

Also known as: envoy debug logs

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…