Files
awesome-kubernetes/docs/kubernetes-networking.md

67 KiB
Raw Blame History

Kubernetes Networking

  1. Introduction
  2. Kubernetes DNS
  3. Kubernetes Services and Load Balancing
  4. TCP Keep Alive Requests
  5. Headless Kubernetes Service
  6. NetworkPolicy
  7. Nginx Ingress Controller
  8. Contour Ingress Controller
  9. Kubernetes Gateway API
  10. Kube-proxy
  11. Multicloud communication for Kubernetes
  12. Multi-Cluster Kubernetes Networking
  13. Kubernetes Network Policy
    1. Cilium
    2. Kubernetes Network Policy Samples
  14. Kubernetes Ingress Specification
  15. Xposer Kubernetes Controller To Manage Ingresses
  16. Software-Defined IP Address Management (IPAM)
  17. CNI Container Networking Interface
    1. List of existing CNI Plugins (IPAM)
    2. Project Calico
  18. DNS Service with CoreDNS
  19. Kubernetes Node Local DNS Cache
  20. k8gb
  21. VPC Lattice
  22. Images
  23. Videos
  24. Tweets

Introduction

Kubernetes DNS

Kubernetes Services and Load Balancing

  • Application Gateway for Containers with AKS Overlay Networking and VNet Flow Logs 🌟 - This post delves into the integration of Azure Application Gateway for Containers (AGC) with Azure Kubernetes Service (AKS) when using the overlay network option. It explores how AGC interacts with pods using non-routable IP addresses and examines the feasibility of using VNet Flow Logs to monitor traffic between AGC and AKS.

  • Introduction to Azure Application Gateway for Containers (AGC) - (Related to azure topic)

  • Kubernetes Services and Load Balancing Explained 🌟 - An in-depth exploration of Kubernetes networking, focusing on Services, kube-proxy, and load balancing mechanisms. The article details how pods communicate within a cluster, the role of Services in directing traffic, and managing external access. It covers ClusterIP, NodePort, and LoadBalancer service types, their implementation via iptables, and advanced topics like preserving source IPs, handling terminating endpoints, and integrating with cloud load balancers. The content is illustrated with a practical example of deploying a two-tier application.

  • blog.cloudsigma.com: Kubernetes DNS Service: A Beginners Guide Kubernetes DNS service allows you to contact services with consistent DNS names instead of IP addresses.

TCP Keep Alive Requests

Headless Kubernetes Service

  • medium.com: Headless Kubernetes Service A headless service in Kubernetes can be a useful tool for creating distributed applications. It allows you to directly access the individual pods in a service. This is useful in scenarios where you need to perform complex load-balancing. A headless service does not have a cluster IP assigned to it. Instead of providing a single virtual IP address for the service, a headless service creates a DNS record for each pod associated with the service. These DNS records can then be used to directly address each pod. Heres a high-level overview of how a headless service works:
    • A headless service is created in Kubernetes
    • Pods are associated with the service through labels
    • DNS records are created for each pod associated with the service
    • Clients can use the DNS records to directly access each pod
  • goglides.dev: Headless services in Kubernetes Vs Regular Service: What, Why, and How?

NetworkPolicy

Nginx Ingress Controller

Contour Ingress Controller

Kubernetes Gateway API

Kube-proxy

  • NFTables mode for kube-proxy in Kubernetes 🌟 - This article introduces the new nftables mode for kube-proxy, an alpha feature in Kubernetes 1.29 that is currently in beta and expected to reach General Availability (GA) in version 1.33. The new mode addresses long-standing performance issues associated with the iptables mode, particularly for large Kubernetes clusters with numerous Services. It leverages the capabilities of nftables to improve data plane latency by providing a more scalable and efficient way to handle Service proxying compared to the traditional iptables approach. The article encourages users with recent kernels to try out this new mode.

  • dustinspecker.com: iptables: How Kubernetes Services Direct Traffic to Pods In this article you will learn how Kubernetes's kube-proxy uses iptables to direct traffic to pods randomly. You'll focus on the ClusterIP type of Kubernetes services.

  • arthurchiao.art: Cracking kubernetes node proxy (aka kube-proxy) This post analyzes the Kubernetes node proxy model, and provides 5 demo implementations (within couples of lines of code) of the model, each based on different tech-stacks (userspace/iptables/ipvs/tc-ebpf/sock-ebpf).

Multicloud communication for Kubernetes

Multi-Cluster Kubernetes Networking

Kubernetes Network Policy

Cilium

<script async class="speakerdeck-embed" data-id="9251193501114da199d70b2a679c552f" data-ratio="1.77777777777778" src="//speakerdeck.com/assets/embed.js"></script>

Kubernetes Network Policy Samples

  • ==ahmetb/kubernetes-network-policy-recipes== 🌟 Example recipes for Kubernetes Network Policies that you can just copy paste. This repository contains various use cases of Kubernetes Network Policies and sample YAML files to leverage in your setup. If you ever wondered how to drop/restrict traffic to applications running on Kubernetes, this is for you

Kubernetes Ingress Specification

Xposer Kubernetes Controller To Manage Ingresses

  • Xposer 🌟 A Kubernetes controller to manage (create/update/delete) Kubernetes Ingresses based on the Service
    • Problem: We would like to watch for services running in our cluster; and create Ingresses and generate TLS certificates automatically (optional)
    • Solution: Xposer can watch for all the services running in our cluster; Creates, Updates, Deletes Ingresses and uses certmanager to generate TLS certificates automatically based on some annotations.

Software-Defined IP Address Management (IPAM)

  • IP Address Management (IPAM)
  • fusionlayer.com: Software-Defined IP Address Management (IPAM)
    • Cloud computing and service automation are changing the way in which applications and data are being delivered and consumed. The existing 30-year-old networking model is failing to keep up with the automated service architectures and the Internet of Things (IoT) based on end-to-end automation.
    • To facilitate the migration to cloud-era computing, service providers and data centers must add networking into the automated service workflows. This requires agility and elasticity that traditional networking products are not designed to provide. As IT environments of tomorrow involve a plethora of orchestrators and controllers spinning up services and applications inside shared networks, they all must be managed and provisioned by a unified solution authoritative for all network-related information.

CNI Container Networking Interface

List of existing CNI Plugins (IPAM)

kubernetes sdn solutions

Project Calico

DNS Service with CoreDNS

Kubernetes Node Local DNS Cache

k8gb

VPC Lattice

Images

??? note "Click to expand!"

<center>

[![k8s service types img](images/k8s_service_types_matrix.png)](https://home.robusta.dev/blog/kubernetes-service-vs-loadbalancer-vs-ingress)

</center>

Videos

??? note "Click to expand!"

<center>

<iframe width="560" height="315" src="https://www.youtube.com/embed/T4Z7visMM4E" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/5cNrTU6o3Fw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/80Ew_fsV4rM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/VSn6DPKIhM8?si=pNaN7q9t3UKWaEhK" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

</center>

Tweets

Click to expand!

Kubernetes is an example of what happens when you have an indefinitely complex network stack and no troubleshooting tools in place.

— Jaana Dogan ヤナ ドガン (@rakyll) November 10, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Let's see how many folks here haven't seen this thread on Kubernetes Networking.

Once again, the thread doesn't try to explain the subject matter in great detail but offers a particular learning order instead.

As usual, based on my personal experience 🔽 pic.twitter.com/pxCWJUxj5j

— Ivan Velichko (@iximiuz) November 28, 2021
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

🧵 How does Pod to Pod communication work in Kubernetes?

How does the traffic reach the right Pod?

Let's see 👇 pic.twitter.com/gF2eVWYL4Q

— Daniele Polencic (@danielepolencic) January 31, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

When your apps receive a ton of traffic, how do you scale your Ingress Controller in Kubernetes?

Here is what I do 👇 pic.twitter.com/T6aYurE7Lj

— Daniele Polencic (@danielepolencic) March 2, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Should you use a single Kubernetes Ingress controller or multiple?

On Monday 8PT/5CET Andrea will make a convincing case on why multiple controllers are good for

security
segregating team & resources
isolation

Register here (it's free) https://t.co/62oKodt7tQ pic.twitter.com/DWNy0iTYq6

— Learnk8s (@learnk8s) March 13, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Networking in Kubernetes is arguably the most important piece.

Why?

Because theres not much you can do in a Kubernetes cluster without proper networking.

A thread 🧵

— Michael Levan 👨🏻‍💻 (@TheNJDevOpsGuy) December 27, 2022
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

How do you deal with peaks of traffic in Kubernetes?

You can use an autoscaler, but how should you configure and test it?

Let's dive into it. pic.twitter.com/AxfEgqyEFW

— Daniele Polencic — @danielepolencic@hachyderm.io (@danielepolencic) April 17, 2023
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
- [Control Plane Load Balancing Explained](https://t0.mirantis.com/control-plane-load-balancing-explained-ad3816837cc0) - *(Related to kubernetes topic)*