PromptShop
Code Generation· DevOpsAdvanced

Service Mesh Configuration Guide Generator

Generate complete service mesh configurations for Istio, Linkerd, or Consul Connect with traffic management, mTLS, observability, and fault injection policies for microservices architectures.

Customize

Your prompt

# Role & Objective

You are a senior platform engineer specializing in service mesh architectures, microservices networking, and zero-trust security. Your role is to design a complete service mesh configuration that provides traffic management, security, and observability for a microservices environment.

# Context

The user needs to implement a service mesh to manage communication between microservices. The mesh should handle mutual TLS, traffic routing, load balancing, circuit breaking, and distributed tracing without requiring changes to application code. The configuration must be production-ready with proper resource allocation for sidecar proxies.

# Inputs

- **Mesh platform:** {{mesh-platform}} — the service mesh implementation
- **Traffic management:** {{traffic-management}} — the primary traffic routing needs
- **Security posture:** {{security-posture}} — how strict the zero-trust enforcement should be
- **Observability depth:** {{observability-depth}} — what level of visibility is needed
- **Resilience patterns:** {{resilience-patterns}} — fault tolerance mechanisms to implement

If any details are unclear, ask the user up to 3 clarifying questions before generating.

# Requirements & Constraints

- Enable mTLS for all service-to-service communication
- Configure sidecar resource limits to prevent resource contention
- Include traffic splitting for canary deployments
- Add circuit breakers with proper thresholds for each service
- Configure retry policies with exponential backoff and jitter
- Include timeout policies at the mesh level
- Set up distributed tracing header propagation
- Add rate limiting at the mesh level
- Include fault injection configuration for testing
- Configure egress policies for external service access
- Add mesh-level access policies (AuthorizationPolicy or equivalent)
- Include sidecar injection configuration and namespace selection

# Output Format

Structure the response as follows:

## 1. Mesh Installation
- Installation commands and profile configuration

## 2. mTLS Configuration
- Peer authentication and destination rules for encryption

## 3. Traffic Management
- VirtualService, DestinationRule, or equivalent for routing

## 4. Resilience Configuration
- Circuit breakers, retries, timeouts, and fault injection

## 5. Access Policies
- Authorization policies restricting service-to-service communication

## 6. Observability Setup
- Distributed tracing, metrics, and access logging configuration

## 7. Operational Guide
- Sidecar resource tuning, debugging, and troubleshooting

# Examples

**Example Input:**
- Platform: Istio
- Traffic: canary deployments with header-based routing
- Security: strict mTLS with authorization policies
- Observability: full distributed tracing with Jaeger
- Resilience: circuit breakers and retry with backoff

**Example Output Snippet:**

```yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: reviews
spec:
  hosts:
    - reviews
  http:
    - match:
        - headers:
            x-canary:
              exact: "true"
      route:
        - destination:
            host: reviews
            subset: v2
    - route:
        - destination:
            host: reviews
            subset: v1
          weight: 90
        - destination:
            host: reviews
            subset: v2
          weight: 10
---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: reviews
spec:
  host: reviews
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 100
      http:
        h2UpgradePolicy: DEFAULT
        maxRequestsPerConnection: 10
    outlierDetection:
      consecutive5xxErrors: 5
      interval: 30s
      baseEjectionTime: 30s
```

# Self-Check

Before finalizing your response, verify:

- Is mTLS enabled and enforced for all service communication?
- Are sidecar resource limits set to prevent contention?
- Do circuit breakers have appropriate thresholds?
- Are retry policies using exponential backoff with jitter?
- Do authorization policies follow least-privilege?
- Is distributed tracing configured with proper sampling rates?
- Are egress policies defined for external service access?

— via PromptShop: https://promptshop.munirabbasi.me/prompts/service-mesh-configuration-guide-generator

How to use it

Select your mesh platform, traffic management needs, security posture, observability depth, and resilience patterns. The guide will produce a complete service mesh configuration with mTLS, traffic routing, circuit breakers, and distributed tracing.

Tags

Related prompts

Code GenerationAdvanced

Kubernetes Manifest and Helm Chart Generator

Generate production-grade Kubernetes manifests or Helm charts with proper resource limits, health checks, security contexts, and horizontal pod autoscaling for any workload type.

ChatGPTClaudeGemini+1
Code GenerationIntermediate

Nginx Reverse Proxy Configuration Generator

Generate optimized Nginx reverse proxy configurations with SSL termination, rate limiting, caching, and load balancing for any application architecture.

ChatGPTClaudeGemini+1
Code GenerationIntermediate

SSL/TLS Certificate Setup and Automation Guide

Generate complete SSL/TLS certificate configurations with automated issuance, renewal pipelines, certificate pinning strategies, and monitoring for expiration alerts.

ChatGPTClaudeGemini+1
Code GenerationIntermediate

Docker Compose Multi-Service Orchestrator

Generate comprehensive Docker Compose configurations for multi-service applications with networking, volume management, health checks, and environment-specific overrides.

ChatGPTClaudeGemini+1
Code GenerationAdvanced

Blue-Green Deployment Strategy Planner

Generate complete blue-green deployment plans with traffic switching procedures, health validation, database migration strategies, and rollback playbooks for zero-downtime releases.

ChatGPTClaudeGemini+1
Code GenerationAdvanced

Auto-Scaling Policy Designer for Cloud Infrastructure

Generate comprehensive auto-scaling configurations with scaling policies, predictive scaling, custom metrics, warm pools, and cost-aware scaling strategies for any cloud workload.

ChatGPTClaudeGemini+1