/serverless-compute-skills:dapr-distributed-runtime-configurationfrom serverless-compute-skills
Configures Dapr sidecar building blocks — state management, pub/sub, and service invocation — for polyglot microservices, including component YAML, sidecar annotations, and resiliency policies.
Ships in serverless-compute-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Dapr (Distributed Application Runtime) runs as a sidecar alongside each service instance, exposing language-agnostic HTTP/gRPC APIs for building blocks like state management, publish/subscribe messaging, and service-to-service invocation — so a polyglot fleet of services (Go, Python, Java, Node) gets consistent, swappable infrastructure integrations (Redis today, a different state store tomorrow) without each service embedding its own client library and retry logic per backend. The value is in the abstraction and the operational consistency it buys across languages; getting component scoping, resiliency policies, and sidecar resource sizing wrong undermines both. Validating these configurations before deploy is covered separately in dapr-configuration-validation.
v1alpha1, v1) matches what's
used in component manifests — component spec fields have changed
across Dapr major versions, so check the installed dapr --version
against the manifests being authored, and confirm a matching Dapr
sidecar image is pulled/available in the cluster's container
registry.dapr CLI for local development/testing (dapr run) and
kubectl for inspecting sidecar injection and component status on
Kubernetes.Enable sidecar injection per Deployment via annotations, not cluster-wide — Dapr sidecars are opt-in per pod:
apiVersion: apps/v1
kind: Deployment
metadata:
name: order-service
namespace: prod
spec:
template:
metadata:
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "order-service"
dapr.io/app-port: "8080"
dapr.io/config: "tracing-config"
spec:
containers:
- name: order-service
image: registry.example.com/order-service:2.3.0
dapr.io/app-id is the stable identifier other services use to call
this one via service invocation — treat it as a public API surface
name, not an implementation detail that changes casually.
Define a state store component scoped to specific applications, not accessible cluster-wide by default:
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orders-statestore
namespace: prod
spec:
type: state.redis
version: v1
metadata:
- name: redisHost
value: "orders-redis.prod.svc.cluster.local:6379"
- name: redisPassword
secretKeyRef:
name: orders-redis-secret
key: password
scopes:
- order-service
- order-fulfillment-service
spec.metadata[].secretKeyRef pulls the password from a Kubernetes
Secret rather than embedding it in the component manifest — never
put a real credential value directly in spec.metadata.
scopes restricts which app-ids may use this component at all;
omitting scopes makes the component usable by every Dapr-enabled
app in the namespace, which is rarely the intent for anything
holding sensitive state.
Define a pub/sub component the same way, scoped and with secrets referenced rather than embedded:
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orders-pubsub
namespace: prod
spec:
type: pubsub.kafka
version: v1
metadata:
- name: brokers
value: "kafka-broker.prod.svc.cluster.local:9092"
- name: authType
value: "password"
- name: saslUsername
secretKeyRef:
name: orders-kafka-secret
key: username
- name: saslPassword
secretKeyRef:
name: orders-kafka-secret
key: password
scopes:
- order-service
- order-fulfillment-service
- analytics-ingest-service
Publish/subscribe from application code then targets this component
by name (orders-pubsub), not a broker connection string, so
swapping the backing broker later means changing this manifest, not
every service's code.
Use service invocation for direct service-to-service calls, getting mTLS, retries, and (with the control plane's built-in tracing) distributed tracing for free, rather than each service implementing its own HTTP client resiliency:
curl -X POST http://localhost:3500/v1.0/invoke/order-fulfillment-service/method/fulfill \
-H "Content-Type: application/json" \
-d '{"orderId": "<ORDER_ID>"}'
The call goes to the local sidecar (localhost:3500 in this
example's Dapr HTTP port), which resolves order-fulfillment-service
via the configured name resolution component (Kubernetes DNS
resolution is the default on Kubernetes) and forwards the request
over mTLS to that service's own sidecar.
Attach a resiliency policy scoped to specific components/apps, not a single global policy applied blindly everywhere:
apiVersion: dapr.io/v1alpha1
kind: Resiliency
metadata:
name: order-service-resiliency
namespace: prod
spec:
policies:
retries:
retryForever:
policy: exponential
maxInterval: 15s
maxRetries: 5
circuitBreakers:
cbStateStore:
maxRequests: 1
interval: 30s
timeout: 20s
trip: consecutiveFailures >= 5
targets:
components:
orders-statestore:
outbound:
retry: retryForever
circuitBreaker: cbStateStore
apps:
order-fulfillment-service:
retry: retryForever
Different components/targets warrant different policies — a state store call and a call to a flaky third-party-backed binding rarely need the same retry/circuit-breaker tuning.
Size the sidecar's own resource requests/limits deliberately — the sidecar container consumes cluster resources on every pod it's injected into, and an under-sized sidecar becomes a request-path bottleneck invisible in the application's own metrics:
annotations:
dapr.io/sidecar-cpu-request: "100m"
dapr.io/sidecar-cpu-limit: "500m"
dapr.io/sidecar-memory-request: "128Mi"
dapr.io/sidecar-memory-limit: "256Mi"
scopes:) to the specific app-ids that
actually need it — an unscoped component is reachable by any
Dapr-enabled app in the namespace, which is rarely the intended
blast radius for anything holding state or credentials.secretKeyRef (backed by Kubernetes Secrets or
a dedicated Dapr secret store component such as Vault) in every
component manifest — never inline a credential value directly under
spec.metadata.app-id as a stable public identifier once other services
depend on it via service invocation — renaming it breaks every
caller's invocation URL.Symptom: A newly deployed component (state store, pub/sub) is
usable by an application that has no legitimate reason to touch it,
discovered during a security review.
Fix: The component manifest omitted scopes, making it available
to every Dapr-enabled app in the namespace by default; add explicit
scopes listing only the intended app-ids and redeploy.
Symptom: A component manifest committed to source control
contains a plaintext database password or broker credential.
Fix: Replace the inline value field with secretKeyRef pointing
at a Kubernetes Secret (or a Dapr secret store component), remove
the plaintext value from git history, and rotate the exposed
credential.
Symptom: Service invocation calls between two services succeed
most of the time but occasionally hang for the full request timeout
during a downstream blip, dragging down the calling service's own
latency.
Fix: No resiliency policy (retry/timeout/circuit breaker) was
attached to that target; add a Resiliency policy scoped to the
specific app or component with a bounded timeout and a circuit
breaker so a downstream blip fails fast instead of holding every
caller's request open.
Symptom: After renaming a service's Dapr app-id as part of a
refactor, other services suddenly can't reach it via service
invocation.
Fix: app-id is the stable address other services invoke by
name; treat it the same as a DNS name or public API contract — update
every caller's invocation target as part of the same change, or keep
the old app-id as an alias if the platform supports it, rather than
renaming it as an isolated change.
Symptom: Application-level latency metrics look fine, but
end-to-end request latency (as seen by clients) is noticeably higher
than the application's own numbers suggest.
Fix: The Dapr sidecar's own resource limits are likely too tight
(CPU-throttled sidecar adds latency to every building-block call);
check sidecar CPU throttling metrics specifically and raise
dapr.io/sidecar-cpu-limit if the sidecar is being throttled under
load.
Scenario: An order-service needs to persist order state to Redis,
publish an order.created event to Kafka for downstream consumers, and
call a separate order-fulfillment-service directly — all with
sensible resiliency and least-privilege component scoping.
Deployment annotations enabling the sidecar:
metadata:
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "order-service"
dapr.io/app-port: "8080"
dapr.io/sidecar-cpu-request: "100m"
dapr.io/sidecar-cpu-limit: "500m"
State store, scoped to only the two services that need order state:
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orders-statestore
namespace: prod
spec:
type: state.redis
version: v1
metadata:
- name: redisHost
value: "orders-redis.prod.svc.cluster.local:6379"
- name: redisPassword
secretKeyRef:
name: orders-redis-secret
key: password
scopes: [order-service, order-fulfillment-service]
Pub/sub component, scoped to publisher and both consumers:
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orders-pubsub
namespace: prod
spec:
type: pubsub.kafka
version: v1
metadata:
- name: brokers
value: "kafka-broker.prod.svc.cluster.local:9092"
scopes: [order-service, order-fulfillment-service, analytics-ingest-service]
Application code (pseudocode, language-agnostic Dapr HTTP calls):
PUT http://localhost:3500/v1.0/state/orders-statestore
POST http://localhost:3500/v1.0/publish/orders-pubsub/order.created
POST http://localhost:3500/v1.0/invoke/order-fulfillment-service/method/fulfill
A Resiliency policy bounds the fulfillment call so a slow
fulfillment-service instance doesn't stall order-service requests
indefinitely:
apiVersion: dapr.io/v1alpha1
kind: Resiliency
metadata:
name: order-service-resiliency
namespace: prod
spec:
policies:
timeouts:
fulfillmentCallTimeout: 5s
circuitBreakers:
cbFulfillment:
maxRequests: 1
interval: 30s
timeout: 20s
trip: consecutiveFailures >= 5
targets:
apps:
order-fulfillment-service:
timeout: fulfillmentCallTimeout
circuitBreaker: cbFulfillment
With this in place, a fulfillment-service outage trips the circuit breaker after five consecutive failures, and order-service's calls fail fast (bounded by the 5s timeout) instead of piling up waiting on a downstream that isn't responding.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
dapr, sidecar, microservices, state-management, pub-sub, service-invocation
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin serverless-compute-skills10 skills in this plugin
/aws-lambda-configuration-validationValidates an AWS Lambda function's configuration — reserved/provisioned concurrency budget, VPC networking config, environment variables, IAM execution role scope, and failure handling — before it deploys, catching problems that only otherwise surface as production throttling or an incident. Use when the user asks to "validate a Lambda function before deploy," "check Lambda reserved concurrency," "review a Lambda IAM role," "why is my Lambda throttling," or "add a pre-deploy check for Lambda config."
/aws-lambda-packaging-and-configurationPackages an AWS Lambda function as a zip deployment package or container image, tunes memory/timeout/ephemeral storage, mitigates cold starts, and scopes the function's IAM execution role to least privilege. Use when the user asks to "package a Lambda function," "build a container image for Lambda," "reduce Lambda cold start latency," "tune Lambda memory or timeout," "add a Lambda layer," or "scope down a Lambda execution role."
/azure-functions-configurationConfigures Azure Functions hosting plans (Consumption, Premium, Dedicated/App Service), triggers and bindings, and host.json/ application settings, with explicit cold-start tradeoffs between plans. Use when the user asks to "choose an Azure Functions hosting plan," "set up a Function App trigger or binding," "reduce Azure Functions cold start," "configure Premium plan pre-warmed instances," or "write host.json for a Function App."
/dapr-configuration-validationValidates Dapr component configurations — state store, pub/sub, and binding components — before deploy, catching missing scopes, inline secrets, unbounded retries, and resiliency gaps that `kubectl apply` won't reject. Use when the user asks to "validate a Dapr component before deploy," "check Dapr component scoping," "review a Dapr pub/sub config for secrets," "add a pre-deploy gate for Dapr components," or "why did my Dapr component apply but not work as expected."
/google-cloud-functions-configurationConfigures Google Cloud Functions Gen1 vs. Gen2 (Cloud Run-backed) runtime differences, HTTP/event/CloudEvent triggers, and min/max instance scaling settings, including concurrency and cold-start tradeoffs unique to each generation. Use when the user asks to "choose Cloud Functions Gen1 or Gen2," "set min instances on a Cloud Function," "configure a Pub/Sub or Eventarc trigger," "reduce Cloud Functions cold start," "migrate a function from Gen1 to Gen2," or "why is my Cloud Function scaling past max instances."
/hashicorp-nomad-scheduling-and-configurationConfigures HashiCorp Nomad job specifications, scheduler types, and cluster topology as a lighter-weight alternative to Kubernetes for scheduling containers, binaries, and batch/system workloads. Use when the user asks to "write a Nomad job spec," "choose service vs. batch vs. system scheduler in Nomad," "compare Nomad to Kubernetes for our use case," "set up Nomad server/client topology," "add a Nomad update/canary deployment strategy," or "run non-containerized workloads under a scheduler."
Other plugins' skills for the same job