5.29-kubernetes learning

news2024/11/26 10:36:26

文章目录

  • Home
  • Get Started
  • The kubernetes network model

First of all ,we should understand the layout of this official website page.
在这里插入图片描述

Home

The Home chapter is that the official website has manuals for different versions of k8s ,and then generally shows the version that is now supported ,
the specific version expiration date can only be viewed by entering the version release page, as shown below.
在这里插入图片描述
在这里插入图片描述

This means that users can get bug fixes and security updates on the latest minor before upgrading to the new version. In addition, maintaining the last three minor release branches ensures that the Kubernetes community can focus on a small number allowing for better management and maintenance of the Kubernetes project.
在这里插入图片描述
When a version of the Kubernetes project passes the end of life point, it will still be available, but it will no longer be officially supported and updated. This means that if you continue to use an outdated version of Kubernetes, you won’t get new bug fixes, security updates, or new features. In addition, the community no longer accepts bug reports or feedback on outdated versions. Therefore, it is not recommended to use an outdated Kubernetes version in a production environment but should upgrade to the latest version as soon as possible for better performance, security, and reliability.

Get Started

this part mainly tells us how to install an environment for Kubernetes。
And there is a tool called minikube, which can help us to run a Kubernetes locally, minikube runs an all-in-one or a multi-node local Kubernetes cluster on your personal computer (including Windows, macOS and Linux PCs) so that you can try out Kubernetes, or for daily development work.
First of all , we entered the minikube official website and carried out the installation according to the tutorial. On the way , we encountered the problem of user account permission,which is finally solved successfully through the following code ,
在这里插入图片描述
and then completed the installation , as shown in the figure .
在这里插入图片描述
Since we have not installed kubectl, so we use minikube’s kubectl
在这里插入图片描述
And then we try to use some basic command by using kubectl to control the kubenetes .
get all the pod 's information

kubectl get pods -A 

在这里插入图片描述
get the information of kubenetes cluster
在这里插入图片描述

get the information of all the nodes
在这里插入图片描述
Get information about all namespaces
在这里插入图片描述
View the service information in the current namespace .
在这里插入图片描述
After many attempts, I think we should first understand how many objects there are in kubenetes and what are the relationships among them , so that our minds will be clearer when we operate these commands and work.
A Service is an abstract Kubernetes object that provides access to a set of Pods. A Service can combine multiple Pods together and provide them with a unified entry point that automatically balances the request load across multiple Pods on the back end by accessing the IP address and port of the Service, thus achieving high availability and fault tolerance.
Pod is the smallest deployable unit in Kubernetes, consisting of one or more containers that share the same network namespace and storage volume. Pods can be created, started, deleted, and recreated, and are automatically scheduled to nodes in the cluster.
Deployment is a controller that manages the number of Pod copies and updates. Deployment can automatically create and manage copies of one or more Pods and can scale and roll over updates as needed. Deployment can ensure Pod availability and reliability by managing replica sets, and Service can provide services by accessing the Pod managed by Deployment.
在这里插入图片描述

From my prospective, when deploying a project to Kubernetes, Deployment, Service, and Ingress are typically used to manage the deployment and access to the application. Deployment is used to manage the Pod for the application, Service is used to provide network access to the application, and Ingress is used to manage access to external traffic. You can also use ConfigMap and Secret to manage your application’s configuration information and sensitive data, and PersistentVolume and PersistentVolumeClaim to manage your application’s persistent storage.

The kubernetes network model

We know that Kubernetes has a variety of network models, such as Pod network, Service network, container network, network policy, Ingress network, and so on, and each network model is actually a standard, just like the interface, there are many different implementations of an interface, in our work, The Azure platform we use, the concrete implementation of the Pod network model is the Kubenet network model, and these models are a layer of interfaces, but inherit the Pod network parent interface, and the plug-in is the final implementation of these interfaces.
在这里插入图片描述
As we know , Kubenet plug-ins is the implementation of the Kubenet network model , and the Kubenet network model is the one of the Pod network model .
In kubernetes, each Pod has a unique IP address. These IP addresses can be dynamically assigned by CNI plug-ins in the Kubernetes cluster or statically assigned by other network plug-ins .
Pod networking is typically implemented through the Container Network Interface (CNI) specification, which is intended to provide a pluggable, extensible interface to a network plug-in.

Since we create the Kubernetes in Azure, Azure provide us with lots of plug-ins .Among these plug-ins, Kubenet is often used in our work.Based on this plug-in, let’s learn how network allocation and pod implementation integrate.
在这里插入图片描述

kubenet is one of the default networking models in AKS, which uses Linux Bridge and iptables tools to implement container networking. Specifically, kubenet creates a bridge device on each node, and then connects the Pod’s network interface to that bridge device. Each Pod is assigned a unique IP address, which is assigned by the subnet pool in the Kubernetes cluster. All containers in Pod share the same network namespace and network interface, so they will share the same IP address and network configuration.
在这里插入图片描述
Specifically, kubenet operates in AKS as follows:
1.Select kubenet as the network model when creating the Kubernetes cluster.
2.Start kubenet’s agent, kubelet, on each node, which starts kubenet’s network management component, kube-proxy, and listens for changes to the Kubernetes API Server.
3.When Kubernetes API Server receives a Pod creation request, it will store the Pod network information to etcd, including the Pod IP address, network namespace and other information.
4.kubenet’s agent, kubelet, listens for a Pod creation request and creates a network namespace and a veth pair on the node based on the Pod’s network information. And connect one end of the veth pair to the node’s bridge device and the other end to the Pod’s network namespace.
5.kubenet assigns each Pod a unique IP address, which is assigned by the subnet pool in the Kubernetes cluster. kubenet will configure these IP addresses to one end of the veth pair so that all containers in the Pod can communicate over this IP address.
6.kube-proxy generates iptables rules based on the Service and Endpoint information in the Kubernetes API Server to realize service discovery and load balancing.
7.When a Pod is deleted, kubenet releases the IP address and network resources occupied by the Pod and deletes network configurations such as the Pod’s network namespace and veth pair.
在这里插入图片描述
And the point we should know is that kubenet assigns IP addresses within the cluster, not within the Azure virtual network and subnet. IP addresses used by kubenet in AKS are assigned by the subnet pool in the Kubernetes cluster. These IP addresses are assigned specifically for the container network and do not affect the IP addresses in the Azure virtual network and subnet.

By default in AKS, kubenet assigns 
IP addresses to Pods using a Container subnet, 
which is created in the Azure virtual network and
 subnet where AKS nodes reside.

If you assign an existing subnet to AKS, the container subnet within AKS will use that subnet’s IP address pool to assign IP addresses to pods, allowing the container to communicate with other resources in Azure. But if you don’t assign subnets to AKS, the pool of IP addresses for the container subnets that AKS automatically creates won’t be able to communicate with other resources in Azure.
To conclude, in AKS, if you assign an Azure virtual network subnet to the AKS, the created Service assigns an Endpoint IP address to each Pod under the Service, The Endpoint IP address is assigned from the IP address pool of the container subnet. Therefore, it assigns IP addresses using the IP address pool of the Azure virtual network subnet.
The Endpoint IP address can only be used for communication between containers, but cannot be used for communication with Azure resources. Because the container subnet uses the IP address pool of a subnet in the Azure virtual network to assign IP addresses, the Endpoint IP address belongs to the IP address in the Azure virtual network. However, it can only communicate between containers, and cannot be directly used to communicate with Azure resources.
If you need Pods in a Service to communicate with Azure resources, you can use a NodePort or LoadBalancer Service to expose the Service to the Azure virtual network. The NodePort type exposes a Service on each node and assigns a random port to the Service for external access. LoadBalancer creates a load balancer on the Azure virtual network and exposes the Service to the public IP address of the load balancer for external access. This way, you can communicate with Azure resources through the Service’s public IP address.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/587410.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

chatgpt赋能python:Python中单词排序的方法—从入门到精通

Python中单词排序的方法—从入门到精通 Python是一门很流行的编程语言,它是一门被广泛使用的高级编程语言,为开发者提供了丰富的工具和库,在处理字符串、文本信息时也有着广泛的应用。本文主要介绍在Python中进行单词排序的方法。 什么是单…

python pycharm的安装教程

pycharm安装教程,超详细_皮小孩ls的博客-CSDN博客目录 前言 python的安装教程: 1.下载地址: 2. 安装 1)customize installation 勾选 use 2).默认 . 3). 选择安装位置 4).耐心等待&…

【CSSpart4--盒子模型】

CSSpart4--盒子模型 网页布局的三大核心:盒子模型,浮动,定位网页布局的过程(本质):盒子模型的组成四部分:边框,内容,内边距,外边距 一 、盒子边框border:1.1 …

Queue 队列的实现与应用

目录 1.概念2.常用的队列方法2.1 方法2.2 代码 3.自己实现队列3.1 构造MyQueue3.2 入队列offer()3.3 出队列poll()3.4 获得队头peek()3.5 是否为空isEmpty()3.6 获得队列大小size() 4.循环队列4.1 概念4.2 解析4.3 如何判断队列满4.4 代码(保留一个位置实现&#xf…

vue+nodejs校园二手物品交易市场网站_xa1i4

。为满足如今日益复杂的管理需求,各类管理系统程序也在不断改进。本课题所设计的校园二手交易市场,使用vue框架,Mysql数据库、nodejs语言进行开发,它的优点代码不能从浏览器查看,保密性非常好,比其他的管理…

轻松实现动态人脸识别,AidLux加速智慧城市场景化应用落地

随着AI技术进入全新发展阶段,智能物联网(AIoT)的渗透率进一步加深,应用场景不断拓展,人脸识别也迅速走进了人们的日常生活,在手机解锁、公司考勤、支付验证、天网抓捕在逃嫌犯等场景中发挥着重要作用。 人脸…

dataV教程-浅用dataV

一别多日,好久没有和大家相见了。其一的原因是因为公司的项目,其二就是因为太懒了。现在给大家浅浅的介绍一下这个好用的大屏展示框架吧。如果后续有深入的话,我会出一个详解版本的。 一、dataV介绍 前言:由于当前的大数据时代,…

Github标星60K!mall前台商城系统正式发布,支持完整订单流程!

之前有很多小伙伴问我,mall项目有没有前台商城系统,可见大家对mall项目的前台商城系统还是非常期待的。最近抽空把前台商城系统的功能给完善了,目前已经可以支持完整的订单流程。我已经把前台商城系统开源了,项目地址也放在文末了…

重磅发布!面向装备制造业服务化转型白皮书(私信获取)

《面向装备制造业服务化转型白皮书》 关于白皮书 《面向装备制造业服务化转型白皮书》通过调研160余家装备制造企业的服务化路径及模式,研讨支持企业开展服务型制造的系统化方案,希望为装备制造业服务化转型,探索切实有效的路径以供参考。 …

【MySQL】- 02 MySQL explain执行

目录 1.使用explain语句去查看分析结果2.MYSQL中的组合索引3.使用慢查询分析(实用)4.MYISAM和INNODB的锁定explain用法详解关于MySQL执行计划的局限性:备注: 1.使用explain语句去查看分析结果 如explain select * from test1 whe…

nSoftware IPWorks 2022 C++ Crack

nSoftware IPWorks 2022 C最全面的互联网组件套件,PKI 代理远程签署代码和文档,无需暴露您的私钥,一种安全的自托管解决方案,可使用集中存储的密钥实现远程代码和文档签名,随附的 PKCS#11 驱动程序允许与 Jarsigner、S…

小航助学题库蓝桥杯stem科技素养模拟练习试卷(中级第2套)(含题库教师学生账号)

需要在线模拟训练的题库账号请点击 小航助学编程在线模拟试卷系统(含题库答题软件账号)_程序猿下山的博客-CSDN博客 25. 2020 年 7 月 23 日,中国的火星探测器“天问一号“发射,开始了前往火星的 旅程。作为中国首个完全自主研发…

Vue之条件渲染

1. if分支结构 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta http-equiv"X-UA-Compatible" content"IEedge"><meta name"viewport" content"widthdevice-widt…

【分享】如何国内免费使用ChatGPT4教程

一、ChatGPT-3使用 1、ChatGPT用法总结&#xff1a; 自动化文本生成&#xff1a;可以用GPT生成文章、新闻、文本摘要&#xff0c;甚至小说、诗歌等文学作品。语音生成&#xff1a;结合语音合成技术&#xff0c;GPT可以生成自然流畅的语音&#xff0c;可以用于语音助手、交互式…

Python学习——数据排序及分箱pd.cut\pd.qcut

文章目录 1 排序1.1 按照索引排序 df.sort_index1.2 按照值进行排序 df.sort_values1.3 数值型数据快速排序 df.nlargest 2 分箱&#xff08;离散化&#xff09;2.1 pd.cut2.1.1 均匀切分,等距分箱2.1.2 指定切分点切分 2.2 pd.qcut 1 排序 dataFrame进行排序时&#xff0c;可…

最全面的WMS系统选购指南:从功能到价格一网打尽

WMS&#xff08;仓库管理系统&#xff09;是一款能够提高仓储和物流企业效率的重要工具&#xff0c;并且能够帮助客户更好地管理他们的供应链网络。但是市面上有很多不同的WMS系统&#xff0c;如何选出最适合自己的系统呢&#xff1f;下面将为您介绍全面的WMS系统选购指南。 功…

软件工程师,不懂点设计模式怎么行

设计模式的圣经 提起设计模式&#xff0c;就不得不提《设计模式——可复用面向对象软件的基础》这本经典著作。1995年&#xff0c;GOF&#xff08;Gang Of Four&#xff09;&#xff0c;也就是Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides这四个人&#xff0c;合…

感谢你们为科技创新和社会进步做出的贡献

感谢你们为科技创新和社会进步做出的贡献 近日中国科技发展事件 据中国载人航天工程办公室消息&#xff0c;北京时间2023年5月30日6时42分&#xff0c;神舟十六号载人飞行任务航天员乘组出征仪式在酒泉卫星发射中心问天阁圆梦园广场举行。6时44分&#xff0c;中国载人航天工程…

Linux:虚拟网卡技术tun/tap

一、介绍 Linux中的TAP网络接口详解是Linux网络管理中的很重要的一部分&#xff0c;它可以用来建立虚拟网络&#xff0c;模拟网络&#xff0c;管理网络流量以及实现安全网络功能等。本文将介绍TAP网络接口的基本原理、如何使用它进行网络管理、与以太网的区别&#x…

在 I/O 看未来 | Flutter 和 Dart 最新进展

作者 / Google 开发者框架和语言 (含 Flutter、Dart 和 Go) 产品经理/用户体验总监 Tim Sneath 今年的 Google I/O 大会在位于加利福尼亚州山景城的总部附近举办&#xff0c;我们怀着无比激动的心情面向全球直播了这场盛会&#xff01; 就在三个多月前&#xff0c;我们在肯尼亚…