没有合适的资源?快使用搜索试试~ 我知道了~
首页Diving Deep Into Kubernetes Networking.pdf
Diving Deep Into Kubernetes Networking.pdf
需积分: 10 17 下载量 44 浏览量
更新于2023-03-16
评论
收藏 1.16MB PDF 举报
Diving Deep Into Kubernetes Networking,对k8s网络深入介绍,掌握k8s网络原理
资源详情
资源评论
资源推荐

Diving Deep
into Kubernetes
Networking
AUTHORS
Adrian Goins
Alena Prokharchyk
Murali Paluru

JANUARY 2019
TABLE OF CONTENTS
DIVING DEEP INTO KUBERNETES NETWORKING
TABLE OF CONTENTS
Introduction ............................................................................................................ 1
Goals of This Book ..................................................................................................................... 1
How This Book is Organized ..................................................................................................1
An Introduction to Networking with Docker ..............................................2
Docker Networking Types ......................................................................................................2
Container-to-Container Communication ........................................................................8
Container Communication Between Hosts................................................................... 9
Interlude: Netfilter and iptables rules ..........................................................10
An Introduction to Kubernetes Networking ............................................. 11
Pod Networking ......................................................................................................................12
Network Policy ........................................................................................................................15
Container Networking Interface ......................................................................................20
Networking with Flannel ..................................................................................21
Running Flannel with Kubernetes ..................................................................................... 21
Flannel Backends ....................................................................................................................21
Networking with Calico ...................................................................................23
Architecture ............................................................................................................................. 23
Install Calico with Kubernetes .......................................................................................... 23
Using BGP for Route Announcements ...........................................................................26
Using IP-in-IP ........................................................................................................................... 29
Combining Flannel and Calico (Canal) .......................................................30
Load Balancers and Ingress Controllers ....................................................31
The Benefits of Load Balancers .........................................................................................31
Load Balancing in Kubernetes ..........................................................................................35
Conclusion ............................................................................................................ 40
Introduction ............................................................................................................ 1
Goals of This Book ..................................................................................................................... 1
How This Book is Organized ..................................................................................................1
An Introduction to Networking with Docker ..............................................2
Docker Networking Types ......................................................................................................2
Container-to-Container Communication ........................................................................8
Container Communication Between Hosts................................................................... 9
Interlude: Netfilter and iptables rules ..........................................................10
An Introduction to Kubernetes Networking ............................................. 11
Pod Networking ......................................................................................................................12
Network Policy ........................................................................................................................15
Container Networking Interface ......................................................................................20
Networking with Flannel ..................................................................................21
Running Flannel with Kubernetes ..................................................................................... 21
Flannel Backends ....................................................................................................................21
Networking with Calico ...................................................................................23
Architecture ............................................................................................................................. 23
Install Calico with Kubernetes .......................................................................................... 23
Using BGP for Route Announcements ...........................................................................26
Using IP-in-IP ........................................................................................................................... 29
Combining Flannel and Calico (Canal) .......................................................30
Load Balancers and Ingress Controllers ....................................................31
The Benefits of Load Balancers .........................................................................................31
Load Balancing in Kubernetes ..........................................................................................35
Conclusion ............................................................................................................ 40

1
JANUARY 2019
INTrOduCTION
DIVING DEEP INTO KUBERNETES NETWORKING
Introduction
Kubernetes has evolved into a strategic platform for deploying and scaling
applications in data centers and the cloud. It provides built-in abstractions for
efficiently deploying, scaling, and managing applications. Kubernetes also addresses
concerns such as storage, networking, load balancing, and multi-cloud deployments.
Networking is a critical component for the success of a Kubernetes implementation.
Network components in a Kubernetes cluster control interaction at multiple layers,
from communication between containers running on different hosts to exposing
services to clients outside of a cluster. The requirements within each environment
are different, so before we choose which solution is the most appropriate, we have to
understand how networking works within Kubernetes and what benefits each solution
provides.
GOALS OF THIS BOOK
This book introduces various networking concepts related to Kubernetes that an operator, developer, or decision maker might
find useful. Networking is a complex topic and even more so when it comes to a distributed system like Kubernetes. It is essential
to understand the technology, the tooling, and the available choices. These choices affect an organization's ability to scale the
infrastructure and the applications running on top of it.
The reader is expected to have a basic understanding of containers, Kubernetes, and operating system fundamentals.
HOW THIS BOOK IS OrGANIZEd
In this book, we cover Kubernetes networking from the basics to the advanced topics. We start by explaining Docker container
networking, as Docker is a fundamental component of Kubernetes. We then introduce Kubernetes networking, its unique model
and how it seamlessly scales. In doing so, we explain the abstractions that enable Kubernetes to communicate effectively between
applications. We touch upon the Container Network Interface (CNI) specification and how it relates to Kubernetes, and finally,
we do a deep dive into some of the more popular CNI plugins for Kubernetes such as Calico, Flannel and Canal. We discuss load
balancing, DNS and how to expose applications to the outside world.
This book is based on the
Networking Master Class online
meetup that is available on
YouTube.
This eBook covers Kubernetes
networking concepts, but we do
not intend for it to be a detailed
explanation of Kubernetes in its
entirety. For more information
on Kubernetes, we recommend
reading the Kubernetes
documentation or enrolling in a
training program from a CNCF-
certified training provider.
This book is based on the
Networking Master Class online
meetup that is available on
YouTube.
This eBook covers Kubernetes
networking concepts, but we do
not intend for it to be a detailed
explanation of Kubernetes in its
entirety. For more information
on Kubernetes, we recommend
reading the Kubernetes
documentation or enrolling in a
training program from a CNCF-
certified training provider.

2
JANUARY 2019
AN INTrOduCTION TO NETWOrKING WITH dOCKEr
DIVING DEEP INTO KUBERNETES NETWORKING
dOCKEr NETWOrKING TYPES
When a Docker container launches, the Docker engine assigns it a network
interface with an IP address, a default gateway, and other components, such as a
routing table and DNS services. By default, all addresses come from the same pool,
and all containers on the same host can communicate with one another. We can
change this by defining the network to which the container should connect, either
by creating a custom user-defined network or by using a network provider plugin.
The network providers are pluggable using drivers. We connect a Docker container
to a particular network by using the --net switch when launching it.
The following command launches a container from the busybox image and joins it
to the host network. This container prints its IP address and then exits.
docker run --rm --net=host busybox ip addr
Docker offers five network types, each with a different capacity for communication
with other network entities.
A. Host Networking: The container shares the same IP address and network namespace as that of the host. Services
running inside of this container have the same network capabilities as services running directly on the host.
B. Bridge Networking: The container runs in a private network internal to the host. Communication is open to other
containers in the same network. Communication with services outside of the host goes through network address
translation (NAT) before exiting the host. (This is the default mode of networking when the --net option isn't specified)
C. Custom bridge network: This is the same as Bridge Networking but uses a bridge explicitly created for this (and other)
containers. An example of how to use this would be a container that runs on an exclusive "database" bridge network.
Another container can have an interface on the default bridge and the database bridge, enabling it to communicate with
both networks.
D. Container-defined Networking: A container can share the address and network configuration of another container. This
type enables process isolation between containers, where each container runs one service but where services can still
communicate with one another on the localhost address.
E. No networking: This option disables all networking for the container.
An Introduction
to Networking
with Docker
Docker follows a unique
approach to networking
that is very different from
the Kubernetes approach.
Understanding how
Docker works help later in
understanding the Kubernetes
model, since Docker containers
are the fundamental unit of
deployment in Kubernetes.
An Introduction
to Networking
with Docker
Docker follows a unique
approach to networking
that is very different from
the Kubernetes approach.
Understanding how
Docker works help later in
understanding the Kubernetes
model, since Docker containers
are the fundamental unit of
deployment in Kubernetes.
Host Networking
The host mode of networking allows the Docker container to share the same IP address
as that of the host and disables the network isolation otherwise provided by network
namespaces. The container’s network stack is mapped directly to the host’s network
stack. All interfaces and addresses on the host are visible within the container, and all
communication possible to or from the host is possible to or from the container.
If you run the command ip addr on a host (or ifconfig -a if your host doesn’t have the ip
command available), you will see information about the network interfaces.
Container
eth0

3
JANUARY 2019
AN INTrOduCTION TO NETWOrKING WITH dOCKEr
DIVING DEEP INTO KUBERNETES NETWORKING
If you run the same command from a container using host networking, you will see the same information.
剩余41页未读,继续阅读








以下是一个简单的极限运动主题网页代码模板,你可以根据自己的需求进行修改和完善:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>极限运动主题网页</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
</body>
</html>
```
在上面的代码模板中,包含了一个简单的页面结构,包括一个导航栏、一个大图轮播、多个内容块和一个页脚。你可以根据自己的实际需求进行修改和扩展。同时,你也需要自己编写对应的样式文件(style.css),以及在需要的地方插入图片等资源。
极限运动,尽情挑战自我!
了解更多










ahouz
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
最新资源
- 基于51单片机的usb键盘设计与实现(1).doc
- 基于plc的楼宇恒压供水系统学位论文.doc
- 基于VC--的五子棋程序设计与实现毕业设计.doc
- 我国软件和信息技术服务业的发展现状及存在的问题.pdf
- 电子商务环境下的会计电算化研究.doc
- 市政道路施工组织设计方案#1_公路桥梁隧道施工组织设计.doc
- 软件工程网上书店管理系统详细课程设计报告很经典.doc
- 基于PLC的小区供水系统设计课程设计(论文).doc
- 基于ssm+mysql的高校自习室预约系统源码数据库论文.docx
- 抗生素发酵生产自动化可研报告.doc
- 基于delphi7.0的学生信息管理系统.doc
- Redmine用户手册
- SSM+Vue猎头公司管理系统答辩PPT.pptx
- ChatGPT的提示艺术-制作清晰有效提示的指南中文版
- 电商数据分析案例.doc
- 全国机动车缉查布控系统互联网模拟测试系统专业知识讲座.ppt
- 本科毕业论文---基于at89s52单片机的直流数控恒流源设计正文.doc
- 内蒙古大学892部分程序设计题
- 本科毕业论文---电子商务.doc
- 学习电子商务基础与应用PPT课件第8章网络促销.ppt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论0