# Illustrative target; inboundConnectionPool requires Istio >= 1.21 and matching CRDs.
# v1beta1 avoids assuming networking v1 CRDs on the 1.21 minimum.
# This resource CONFIGURES an existing injected sidecar; it does not inject one.
apiVersion: networking.istio.io/v1beta1
kind: Sidecar
metadata:
  name: example-obrh-inbound-capacity
  namespace: obrh-example
spec:
  workloadSelector:
    labels:
      app: obrh-direct-example
  inboundConnectionPool:
    tcp:
      maxConnections: 100 # Upstream sockets from Envoy to its local JVM.
      connectTimeout: 1s
    http:
      http2MaxRequests: 200 # Active HTTP requests, including HTTP/1.1.
      http1MaxPendingRequests: 20 # Waiting for pool capacity, including HTTP/2.
      maxRetries: 1 # Finite simultaneous retry allowance; DOES NOT enable retries.
      # Disable retries in the owning route policy when the local leg must not retry.
      # Istio 1.21 ignores maxRetries: 0 in translation; it is NOT a no-retry bound.
  ingress:
  - port:
      number: 8080
      name: http-8080
      protocol: HTTP
    defaultEndpoint: 127.0.0.1:8080 # Same Pod network namespace / local JVM.
  # Deliberately no egress.hosts override: retain existing outbound configuration.
  # An inbound-only installation may retain its verified ~/* plus capture bypass.
  # Do not add a second overlapping Sidecar for the same workload.
