Linkerd

From G1Joshi/Agent-Skills · View interactive version

Linkerd is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert Linkerd service mesh assistance covering ultralight Rust micro-proxies, automatic mTLS, traffic splitting, and zero-config observability. Use when adding secure mTLS and latency metrics to Kubernetes with minimal overhead.

How to use this skill

Skill file

Linkerd

Linkerd is an ultralight, zero-config service mesh written in Rust, providing automatic mutual TLS (mTLS), layer-7 metrics, and transparent traffic shifting without administrative complexity.

When to Use

Quick Start

# Install Linkerd CLI and check cluster compatibility
curl -fsL https://run.linkerd.io/install | sh
linkerd check --pre

# Install Linkerd control plane into Kubernetes
linkerd install --crds | kubectl apply -f -
linkerd install | kubectl apply -f -
linkerd check

# Inject Linkerd sidecar into an existing namespace
kubectl get deploy -n my-app -o yaml | linkerd inject - | kubectl apply -f -

Core Concepts

Automatic Proxy Injection Annotation

Injecting micro-proxies into deployment pods via annotations:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: user-service
  namespace: default
  annotations:
    linkerd.io/inject: enabled # Linkerd proxy automatically injected
spec:
  replicas: 2
  selector:
    matchLabels:
      app: user-service
  template:
    metadata:
      labels:
        app: user-service
    spec:
      containers:
        - name: app
          image: myregistry/user-service:v1.0
          ports:
            - containerPort: 8080

TrafficSplit for Canary Deployment

Routing canary traffic across distinct service versions:

apiVersion: split.smi-spec.io/v1alpha2
kind: TrafficSplit
metadata:
  name: user-service-split
  namespace: default
spec:
  service: user-service
  backends:
    - service: user-service-v1
      weight: 800m # 80% traffic
    - service: user-service-v2
      weight: 200m # 20% traffic

Linkerd CLI Diagnostic & Telemetry Inspection

Inspecting real-time traffic statistics between pods:

# Check Linkerd control plane health
linkerd check

# Real-time traffic inspection (Golden Metrics: RPS, Success Rate, Latency P99)
linkerd viz stat deployment -n default

# Trace live traffic calls between services
linkerd viz tap deployment/user-service -n default --to deployment/db-service

Common Patterns

TrafficSplit for Canary Deployment

Problem: Releasing new microservice versions without the risk of impacting 100% of user traffic.

Solution:

Use the SMI TrafficSplit custom resource:

apiVersion: split.smi-spec.io/v1alpha2
kind: TrafficSplit
metadata:
  name: service-canary-split
  namespace: prod
spec:
  service: my-service
  backends:
    - service: my-service-v1
      weight: 900
    - service: my-service-v2
      weight: 100

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| :-------------------------------------------------- | :------------------------------------------------------------------ | :------------------------------------------------------------------------ |

| linkerd check: failed to connect to control plane | linkerd-controller pod not running or admission webhook unready. | Run kubectl get pods -n linkerd and verify cluster certificates. |

| linkerd-proxy: connection refused to 127.0.0.1 | Application container within pod hasn't finished binding port. | Configure readiness probe on application container. |

| Certificates expiring soon warning | Linkerd internal trust anchor or issuer certificate nearing expiry. | Rotate certificates: linkerd upgrade --identity-trust-anchors-file .... |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.