Topic lessonTopic: Kubernetes and EKS: structure, networking and upgrades
Kubernetes networking explained: Services, Ingress and NetworkPolicy
A Service groups application destinations, an Ingress declares HTTP routing, and NetworkPolicy restricts Pod traffic. Creating any one object does not complete connectivity. Read destinations, implementation and permissions through a fictional report API on EKS.
Read destinations by separating selector matches from readiness; explain Ingress/controllers and the scope of standard NetworkPolicy.
A Pod groups containers for placement. A namespace scopes object names, a label is a classification key/value, and a selector matches those labels. No live cluster or account is needed.
Separate selected destinations from ready destinations
Pods can receive different IPs when replaced. A Service abstracts access to a changing set of Pods. Its role differs from a Deployment maintaining replicas. This example uses an ordinary selector-based ClusterIP Service.
Fixed conditions: a Service in namespace reports selects app=reports and maps port 8080 to targetPort 8080. No Pod is terminating; publishNotReadyAddresses=false. Records are synthetic, not measured traffic.
| Pod | Namespace / app label | Ready | Treatment in this example |
|---|---|---|---|
| A | reports / reports | true | Matches the selector and is a ready destination candidate. |
| B | reports / reports | false | Matches the selector, but distinguish its not-ready state. |
| C | reports / other | true | The app label does not match. |
| D | other / reports | true | Outside the Service namespace. |
Two Pods match: A/B. One matched Pod is Ready: A. In a real cluster, inspect EndpointSlice addresses, ports, conditions and observation times. A candidate alone does not establish DNS, forwarding, network permission or application response. Do not apply this counting rule unchanged to selectorless or ExternalName Services.
Distinguish Ingress configuration from its controller
An Ingress declares HTTP(S) host/path-to-backend rules; a controller interprets those rules and configures supported infrastructure. An Ingress object without a matching controller does not implement the public entry path.
- Ingress → ControllerRead by matching implementation
- Ingress → ServiceReference as backend
- Service → EndpointSliceAssociate destination information
- Ingress
- Declare host/path and backend
- Controller
- Configure supported infrastructure
- Service
- Selector and port mapping
- EndpointSlice
- Destinations and readiness conditions
The diagram shows references. A load balancer need not always traverse the Service virtual IP. Check controller/class, target mode, TLS termination and AWS permissions separately. Ingress is frozen, not removed. For new designs, consider Gateway API with its implementation support and migration conditions.
Read standard NetworkPolicy by direction
This section assumes standard namespaced NetworkPolicy and supporting enforcement. Egress is outbound; ingress is inbound. When a policy isolates a selected Pod for a direction, combine the allowances of policies applying to that direction; the last policy does not replace all others.
| Source egress | Destination ingress | Decision under these policy conditions |
|---|---|---|
| Allows | Allows | Both policy conditions met; other connectivity checks remain. |
| Allows | Does not allow | The destination condition is not met. |
| Does not allow | Allows | The source condition is not met. |
| Does not allow | Does not allow | Neither condition is met. |
The table fixes both directions and excludes admin policies, hostNetwork and NAT ambiguities. A direction not isolated by standard policy is not proof of connectivity. EKS Admin-tier ClusterNetworkPolicy has distinct deny/priority behavior; do not fold it into this additive example. Network rules do not replace IAM/RBAC or HTTP authentication.
On EKS, verify that enforcement is supported and enabled
CNI provides Pod networking. A policy object and enforced traffic restrictions are different facts. For Amazon VPC CNI network policy, check supported versions, feature enablement and EC2 Linux node conditions; do not assume identical enforcement on Fargate or Windows nodes.
| Mode | Before policies are configured | Check |
|---|---|---|
| standard | Starts with default allow. | Do not assume immediate isolation at creation. |
| strict | Applicable Pods start with default deny. | Account for necessary dependencies including DNS. |
Blocking a required dependency can leave a running application unusable. Match implementation status, events and enforcement observations with expected restrictions. Replacing rules with unrestricted access is not a substitute for diagnosis.
Trace one failing request through the evidence
- Fix the source, destination name, port and HTTP request.
- Check namespace, Service selector and port/targetPort.
- Inspect EndpointSlices, Pod readiness and timestamps.
- Check the Ingress class, matching controller, events and configured destination.
- Read applicable policies by direction and verify enforcement status.
- Check DNS, VPC boundaries, application responses and business outcomes.
Distinguish destinations, implementation and permission
Choose an option to see the result and explanation.
Check, then explain in your own words
- Classify A/B/C/D by namespace, labels and readiness.
- Explain the Ingress/controller and Service references.
- Read standard-policy directions and additive allowances separately from enforcement conditions.
Check your understanding: Service, Ingress and NetworkPolicy objects all exist. What evidence is still needed?
Match selected/ready destinations, controller configuration, policy directions and enforcement, DNS/VPC boundaries, and actual application responses.
Declarations alone do not prove a successful user operation across every boundary.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- Kubernetes: ServiceChecked:
Scope and conditionsService references and EndpointSlices; selection alone does not establish readiness or reachability. Documentation review; not live-cluster verification.
Used in this lessonSeparate selected destinations from ready destinations Distinguish destinations, implementation and permission
- Kubernetes: EndpointSlicesChecked:
Scope and conditionsEndpoint addresses/ports and ready/serving/terminating conditions. The fixed example assumes publishNotReadyAddresses=false and non-terminating endpoints; real forwarding and application responses are not validated.
Used in this lessonSeparate selected destinations from ready destinations Distinguish destinations, implementation and permission
- Kubernetes: IngressChecked:
Scope and conditionsAn implementation controller is required; frozen Ingress API is not removed; evaluate Gateway for new designs. Documentation review; not live-cluster verification.
Used in this lessonDistinguish Ingress configuration from its controller Distinguish destinations, implementation and permission
- Kubernetes: Network PoliciesChecked:
Scope and conditionsStandard NetworkPolicy only: directional isolation, additive allow rules, both source egress and destination ingress. Documentation review; not live-cluster verification.
Used in this lessonRead standard NetworkPolicy by direction Distinguish destinations, implementation and permission
Scope and conditionsVPC CNI-specific support and limits; standard NetworkPolicy differs from ClusterNetworkPolicy in the Admin tier. Documentation review; not live-cluster verification.
Used in this lessonRead standard NetworkPolicy by direction On EKS, verify that enforcement is supported and enabled Distinguish destinations, implementation and permission
Scope and conditionsCheck prerequisites, enablement and startup standard/strict modes for the chosen version. Prerequisite tables and procedure examples use different versions; verify support for the actual configuration. Documentation review; not live-cluster verification.
Used in this lessonOn EKS, verify that enforcement is supported and enabled