apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\nspec:\n selector:\n app: my-app\n ports:\n - protocol: TCP\n port: 80\n targetPort: 8080 defines a Service with selector and TCP port, matching typical service mesh setup.
Step 2: Check other options
apiVersion: v1\nkind: Pod\nmetadata:\n name: my-service\nspec:\n containers:\n - name: app\n image: my-image is a Pod, not a Service. apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: my-service\nspec:\n replicas: 3\n selector:\n matchLabels:\n app: my-app is a Deployment, not a Service. apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\nspec:\n ports:\n - protocol: UDP\n port: 80\n targetPort: 8080 uses UDP, usually not for HTTP services.
Final Answer:
YAML defining a Service with selector and TCP port -> Option B
Quick Check:
Service YAML with selector and TCP port = correct [OK]
Quick Trick:Service must have selector and TCP port for mesh traffic [OK]
Common Mistakes:
Confusing Pod or Deployment YAML with Service YAML
Using UDP instead of TCP for service ports
Omitting selector in Service definition
Master "Networking" in Kubernetes
9 interactive learning modes - each teaches the same concept differently