apiVersion: v1 kind: Pod metadata: name: client namespace: istio-vt-t56-r2 labels: app: client annotations: sidecar.istio.io/inject: "true" spec: containers: - name: curl image: curlimages/curl:8.14.1 command: ["sleep", "infinity"] --- apiVersion: apps/v1 kind: Deployment metadata: name: echo namespace: istio-vt-t56-r2 labels: app: echo spec: replicas: 1 selector: matchLabels: app: echo template: metadata: labels: app: echo annotations: sidecar.istio.io/inject: "true" spec: containers: - name: echo image: mendhak/http-https-echo:37 env: - name: HTTP_PORT value: "8080" - name: HTTPS_PORT value: "8443" ports: - containerPort: 8080 - containerPort: 8443 --- apiVersion: v1 kind: Service metadata: name: echo namespace: istio-vt-t56-r2 spec: selector: app: echo ports: - name: http port: 80 targetPort: 8080 - name: https port: 443 targetPort: 8443 --- # CORRECTED from spec: net.ipv4.ip_local_port_range is on the kubelet safe sysctls # allowlist, so it must be set via pod securityContext.sysctls at pod-creation time # (applied pod-wide, i.e. to the shared netns of BOTH the curl container and the # istio-proxy sidecar, by the CRI before container start) rather than via a runtime # `sysctl -w` inside a container -- run 1 showed sysctl -w fails with "Read-only # file system" for both a NET_ADMIN-capable container and the istio-proxy container # (drop ALL caps, readOnlyRootFilesystem=true), because /proc/sys is masked at # runtime regardless of capabilities; only kubelet/CRI-applied pod-level sysctls # can write it before the netns is handed to the containers. apiVersion: v1 kind: Pod metadata: name: port-exhaust-client namespace: istio-vt-t56-r2 labels: app: port-exhaust-client annotations: sidecar.istio.io/inject: "true" spec: securityContext: sysctls: - name: net.ipv4.ip_local_port_range value: "32768 32787" # exactly 20 ephemeral ports, pod-wide (shared with istio-proxy) containers: - name: curl image: curlimages/curl:8.14.1 command: ["sleep", "infinity"]