Kubernetes - ServicesHow can you combine EndpointSlices with Network Policies to control traffic to specific pods?AApply NetworkPolicy only on Endpoints resourceBConfigure NetworkPolicy to block EndpointSlices resource directlyCUse EndpointSlices labels to select pods in NetworkPolicy selectorsDEndpointSlices cannot be used with Network PoliciesCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand NetworkPolicy selectorsNetworkPolicies select pods based on labels to allow or deny traffic.Step 2: Use EndpointSlices labelsEndpointSlices carry labels matching pods, so NetworkPolicies can use these labels to control traffic.Final Answer:Use EndpointSlices labels to select pods in NetworkPolicy selectors -> Option CQuick Check:EndpointSlices labels used in NetworkPolicy selectors [OK]Quick Trick: NetworkPolicy selects pods via labels on EndpointSlices [OK]Common Mistakes:Trying to block EndpointSlices resource directlyApplying NetworkPolicy only on EndpointsAssuming EndpointSlices can't be used with NetworkPolicy
Master "Services" in Kubernetes9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kubernetes Quizzes Kubernetes Fundamentals - kubectl CLI installation and configuration - Quiz 9hard Kubernetes Fundamentals - Node components (kubelet, kube-proxy, container runtime) - Quiz 7medium Namespaces - Resource quotas per namespace - Quiz 8hard Namespaces - Switching namespace context - Quiz 13medium Pods - Why Pods are the smallest deployable unit - Quiz 7medium ReplicaSets and Deployments - Deployment as higher-level abstraction - Quiz 12easy ReplicaSets and Deployments - Rollback to previous version - Quiz 3easy ReplicaSets and Deployments - Rolling update strategy - Quiz 6medium ReplicaSets and Deployments - Recreate update strategy - Quiz 11easy Services - NodePort service type - Quiz 5medium