8 minutes
In Kubernetes, ingress and egress refer to how network traffic enters and exits a cloud-native containerized application environment.
These traffic flows are central to running modern applications within cloud infrastructure. Managing them effectively supports a wide range of use cases, such as routing customer traffic to web apps or securely accessing third-party APIs.
In today’s cloud computing-driven world, Kubernetes powers increasingly critical workloads. As a result, the granular ability to control traffic has become essential for maintaining performance, enforcing security measures and meeting compliance requirements.
Industry newsletter
Stay up to date on the most important—and intriguing—industry trends on AI, automation, data and beyond with the Think newsletter. See the IBM Privacy Statement.
Your subscription will be delivered in English. You will find an unsubscribe link in every newsletter. You can manage your subscriptions or unsubscribe here. Refer to our IBM Privacy Statement for more information.
Kubernetes, also known as k8s or kube, is a container orchestration platform that automates the deployment, scaling and maintenance of applications across a pool of computing resources. Instead of managing servers directly, DevOps and IT teams use Kubernetes to run applications in containers—lightweight self-contained units of software that include everything needed to run an application.
According to a CNCF report, Kubernetes is the second-largest open source project in the world (after Linux), and the primary container orchestration tool for 71% of Fortune 100 companies.
Docker is the most widely used tool for building container images. In Kubernetes, containers are grouped into units called pods, which are the smallest deployable units and can contain one or more containers. Kubernetes schedules these pods across a cluster of machines known as nodes.
Pods and their related resources are organized into namespaces, which provide logical separation for managing different teams, projects or environments within the same cluster. Kubernetes handles key cluster functionality, such as load balancing, failover, scaling and self-healing, abstracting away much of the low-level infrastructure complexity.
Within a Kubernetes cluster, services often need to communicate with one another and sometimes with external systems. Kubernetes manages and controls traffic in a way that isolates internal components to enhance performance and security. As a result, both incoming and outgoing traffic must be explicitly defined, managed and configured.
In basic computer science, ingress versus egress refers to the inbound versus outbound traffic in a network or system. Kubernetes ingress and egress provide platform teams with a controlled framework for governing how traffic flows into and out of the Kubernetes cluster. This aspect is essential for operating secure and scalable production environments.
Ingress refers to incoming traffic from external users or systems into a Kubernetes cluster, typically over HTTP or HTTPS (which both run on the TCP protocol). Rather than exposing every service directly to the internet, organizations define ingress rules through an Ingress resource. This resource is typically written in YAML, which instructs Kubernetes on how to route traffic based on criteria like URL paths or domain names.
Ingress rules are enforced by an ingress controller—a piece of software (often based on NGINX or another reverse proxy) that serves as the actual entry point. The controller receives incoming requests, decrypts traffic if necessary, and forwards it to the correct service within the cluster.
For example, ingress rules might be configured to do:
Kubernetes provides several built-in methods for exposing services outside the cluster. The Ingress resource works with certain service types but offers a more flexible and centralized approach, especially for web-based traffic.
Here are some of the most common service types:
By comparison, the Ingress resource allows multiple services to be accessed through a single external IP address by using smart routing rules, based on domain names or paths. It centralizes HTTP(S) handling and traffic control, making it a strong choice for production workloads.
Egress refers to outbound traffic—when services inside the Kubernetes cluster need to communicate with external traffic destinations or systems (for example, APIs, cloud services, databases, and so on). While Kubernetes allows unrestricted outbound traffic by default, this open policy is rarely suitable for production environments.
Organizations typically want to control and monitor which services can connect to external endpoints, both for security and compliance reasons. For example, a retail company might want its payment service to reach only approved payment gateways and block all other destinations.
Kubernetes provides several methods for effectively and securely managing egress. By implementing these controls, organizations can ensure that only authorized traffic is allowed to flow to external networks, therefore enhancing security and compliance.
Kubernetes network policies can restrict which pods are allowed to make outbound connections and specify the addresses or domains they can reach—often using CIDR notation for IP ranges. These policies support zero-trust models by allowing only explicitly authorized communication. Egress rules within these network policies define outbound traffic restrictions, controlling which external destinations pods can access.
Egress gateways, often deployed as part of a service mesh, can route all outbound traffic through a monitored control point, enabling advanced traffic control, encryption and observability.
Dedicated egress nodes or NAT gateways can also be used to centralize and log outgoing connections, providing traceability and improved performance isolation.
IBM SevOne Network Performance Management is monitoring and analytics software that provides real-time visibility and insights into complex networks.
Cloud networking solutions from IBM provide high-performing connectivity to power your apps and business.
Modernize your applications and navigate industry requirements with IBM Consulting.