# T96 오버레이 — 20-backends.yaml 위에 apply. "in-flight 요청"을 만들기 위한 느린 응답 경로 추가. # # 변경점 (identity location / 는 그대로 유지 — flip-test.sh 호환): # - location /slow/ : 300KB 파일을 limit_rate 10k(=10KB/s)로 전송 → 응답 1건이 ~30초 동안 # wire 위에 걸쳐 있음 = flip 순간 "진행 중인 요청"을 보장하는 장치 # - add_header X-Backend : /slow/ 응답 body가 zero라 정체 식별을 헤더로 # - initContainer(gen-slow) : busybox dd로 /data/slow.bin(300KB) 생성 (emptyDir 공유) --- apiVersion: v1 kind: ConfigMap metadata: { name: backend-a-conf, namespace: dns-lab } data: default.conf: | server { listen 443 ssl; server_name gslb.lab.internal; ssl_certificate /etc/nginx/tls/tls.crt; ssl_certificate_key /etc/nginx/tls/tls.key; default_type text/plain; location / { return 200 "backend-a\n"; } location /slow/ { alias /data/; limit_rate 10k; add_header X-Backend backend-a always; } } --- apiVersion: v1 kind: ConfigMap metadata: { name: backend-b-conf, namespace: dns-lab } data: default.conf: | server { listen 443 ssl; server_name gslb.lab.internal; ssl_certificate /etc/nginx/tls/tls.crt; ssl_certificate_key /etc/nginx/tls/tls.key; default_type text/plain; location / { return 200 "backend-b\n"; } location /slow/ { alias /data/; limit_rate 10k; add_header X-Backend backend-b always; } } --- apiVersion: apps/v1 kind: Deployment metadata: { name: backend-a, namespace: dns-lab, labels: { app: backend-a } } spec: replicas: 1 selector: { matchLabels: { app: backend-a } } template: metadata: labels: { app: backend-a } annotations: { sidecar.istio.io/inject: "false" } spec: initContainers: - name: gen-slow image: busybox:1.36 command: ["sh", "-c", "dd if=/dev/zero of=/data/slow.bin bs=1024 count=300"] volumeMounts: [{ name: data, mountPath: /data }] containers: - name: nginx image: nginx:1.27-alpine ports: [{ containerPort: 443 }] volumeMounts: - { name: conf, mountPath: /etc/nginx/conf.d/default.conf, subPath: default.conf } - { name: tls, mountPath: /etc/nginx/tls, readOnly: true } - { name: data, mountPath: /data, readOnly: true } readinessProbe: tcpSocket: { port: 443 } initialDelaySeconds: 2 volumes: - name: conf configMap: { name: backend-a-conf } - name: tls secret: { secretName: gslb-tls } - name: data emptyDir: {} --- apiVersion: apps/v1 kind: Deployment metadata: { name: backend-b, namespace: dns-lab, labels: { app: backend-b } } spec: replicas: 1 selector: { matchLabels: { app: backend-b } } template: metadata: labels: { app: backend-b } annotations: { sidecar.istio.io/inject: "false" } spec: initContainers: - name: gen-slow image: busybox:1.36 command: ["sh", "-c", "dd if=/dev/zero of=/data/slow.bin bs=1024 count=300"] volumeMounts: [{ name: data, mountPath: /data }] containers: - name: nginx image: nginx:1.27-alpine ports: [{ containerPort: 443 }] volumeMounts: - { name: conf, mountPath: /etc/nginx/conf.d/default.conf, subPath: default.conf } - { name: tls, mountPath: /etc/nginx/tls, readOnly: true } - { name: data, mountPath: /data, readOnly: true } readinessProbe: tcpSocket: { port: 443 } initialDelaySeconds: 2 volumes: - name: conf configMap: { name: backend-b-conf } - name: tls secret: { secretName: gslb-tls } - name: data emptyDir: {}