INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Read destinations by separating selector matches from readiness; explain Ingress/controllers and the scope of standard NetworkPolicy.

Prerequisite

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.

Read four Pods by namespace, label and readiness
PodNamespace / app labelReadyTreatment in this example
Areports / reportstrueMatches the selector and is a ready destination candidate.
Breports / reportsfalseMatches the selector, but distinguish its not-ready state.
Creports / othertrueThe app label does not match.
Dother / reportstrueOutside 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.

Configuration references, not a universal packet path
Configuration references, not a universal packet path1: Ingress — Read by matching implementation — Controller. 2: Ingress — Reference as backend — Service. 3: Service — Associate destination information — EndpointSlice123IngressControllerServiceEndpointSliceConfiguration references, not a universal packet path1: Ingress — Read by matching implementation — Controller. 2: Ingress — Reference as backend — Service. 3: Service — Associate destination information — EndpointSlice123IngressControllerServiceEndpointSlice
  1. Ingress → ControllerRead by matching implementation
  2. Ingress → ServiceReference as backend
  3. 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.

Fixed example: TCP 8080 from a source Pod to a destination Pod
Source egressDestination ingressDecision under these policy conditions
AllowsAllowsBoth policy conditions met; other connectivity checks remain.
AllowsDoes not allowThe destination condition is not met.
Does not allowAllowsThe source condition is not met.
Does not allowDoes not allowNeither 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.

How startup enforcement treats the configuration interval
ModeBefore policies are configuredCheck
standardStarts with default allow.Do not assume immediate isolation at creation.
strictApplicable 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

  1. Fix the source, destination name, port and HTTP request.
  2. Check namespace, Service selector and port/targetPort.
  3. Inspect EndpointSlices, Pod readiness and timestamps.
  4. Check the Ingress class, matching controller, events and configured destination.
  5. Read applicable policies by direction and verify enforcement status.
  6. Check DNS, VPC boundaries, application responses and business outcomes.

Distinguish destinations, implementation and permission

Choose an option to see the result and explanation.

Which Pods match the fixed selector, and which matched Pod is Ready?
Read the answer and reason

Answer: Matches A/B; A is Ready · Read namespace, label and readiness separately; connectivity remains unproven.

An Ingress exists without a matching controller. Is its public route implemented?
Read the answer and reason

Answer: No; a matching implementation is needed · An object’s existence differs from implementation of its rules.

In the fixed case, source egress allows but destination ingress does not. Are policy conditions met?
Read the answer and reason

Answer: No; the destination condition is unmet · Both directions matter in this fixed case.

A NetworkPolicy exists, but enforcement implementation/configuration is unknown. Are restrictions proven?
Read the answer and reason

Answer: No; verify support and enforcement status · Object presence alone does not establish enforcement.

Two standard policies select the same Pod for ingress: frontend/8080 and metrics/9090. What is allowed?
Read the answer and reason

Answer: The union of both allowances; source-side checks remain · Combine applicable standard allowances without skipping other conditions.

Check, then explain in your own words

  1. Classify A/B/C/D by namespace, labels and readiness.
  2. Explain the Ingress/controller and Service references.
  3. 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.