在Kubernetes集群上安装 Calico cni 的注意事项

开始前的实验环境 Resources controller worker-1 worker-2 OS CentOS 7.9 CentOS 7.9 CentOS 7.9 Storage 20GB 20GB 20GB vCPU 2 2 2 RAM 4GB 4GB 4GB NIC 10.0.0.4 10.0.0.4 10.0.0.4 Kubernetes Version 1.19.10 1.19.10 1.19.10 选择匹配 Kubernetes 版本的 Calico 版本 通常情况下,查看 Calico 所支持的 Kubernetes 版本,可以通过路径 Install Calico ==> Kubernetes ==> System requirements 可以找到自己的 Kubernetes 集群所支持的 Calico 版本。 例如在实验环境中,Kubernetes 1.19 版本所支持的版本有 Calico 3.20,这个时候直接 apply 这个版本提供的资源清单即可 如何开启纯 BGP 模式 默认情况下下,Calico 使用的是 full mesh 和 IPIP, 如果想通过在部署时就修改关闭 IPIP 模式,可以通过修改资源清单中的环境变量来关闭 CALICO_IPV4POOL_IPIP: Never。...

 ·  · 

Kubernetes中的资源限制 - Request&Limit

原作者 Javier Martínez 背景 在学习 Kubernetes 调度时,有两个重要的概念,“request “与 “limit”,而对应的资源就是“内存” 与 “CPU” ,而这两个决定了 Pod 将如何调度;“request “与 “limit” 也是整个调度系统中的基数因子。 什么是 request 和 limit 在 Kubernetes 中,Limit 是容器可以使用的最大资源量,这表示 “容器” 的内存或 CPU 的使用,永远不会超过 Limit 配置的值。 而另一方面,Request 则是为 “容器” 保留的最低资源保障;换句话来说,Request 则是在调度时,容器被允许所需的配置。 图:Kubernetes 中Limit 和 Request 图示 Source:https://sysdig.com/blog/kubernetes-limits-requests/ 如何配置 request 和 limit 下列清单是 Deployment 的部署清单,他将部署一个 redis 与 一个 busybox yaml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 kind: Deployment apiVersion: extensions/v1beta1 … template: spec: containers: - name: redis image: redis:5....

 ·  · 

Awesome kubernetes

Deployment Recommended Cluster Architecture - rancher Hardware recommendations - etcd A simple shell script for backing up etcd v2 and v3 datastores Considerations for large clusters - kubernetes cluster Operating etcd clusters for Kubernetes Recommended performance and scalability practices Binary deploy script pure shell Managing Kubernetes Traffic with F5 NGINX Eraser - Cleaning up Images from Kubernetes Nodes 对于不同规模的 Kubernetes 集群所需要的 etcd 规模推荐 datree: allowing you to scan your k8s configs during development Performance etcd: getting 30% more write/s 蚂蚁集团万级规模 K8s 集群 etcd 高可用建设之路 各组件参数配置调优 万级K8s集群背后etcd稳定性及性能优化实践 K8s 集群稳定性:LIST 请求源码分析、性能评估与大规模基础服务部署调优 Comparing comparing Kubernetes ingress controller Troubleshooting 一次Etcd集群宕机引发的思考 Stern: allows you to tail multiple pods on Kubernetes Diagnosis Kubernetes 自动化诊断工具:k8sgpt-operator ktop: displays useful metrics information about kubernetes cluster Dashboard KDash - A fast and simple dashboard for Kubernetes Security Kubernetes 加固指南 Popeye 扫描实时 Kubernetes 集群并报告已部署资源和配置的潜在问题 Test kube-monkey It randomly deletes Kubernetes (k8s) pods in the cluster encouraging and validating the development of failure-resilient services....

 ·  · 

kube-proxy如何保证规则的一致性

本文是关于Kubernetes service解析的第5章 深入理解Kubernetes service - 你真的理解service吗? 深入理解Kubernetes service - EndpointSlices做了什么? 深入理解Kubernetes service - kube-proxy架构分析 深入理解Kubernetes service - 如何扩展现有的kube-proxy架构 kube-proxy如何保证规则的一致性 所有关于Kubernetes service 部分代码上传至仓库 github.com/cylonchau/kube-haproxy 前景 这里谈 kube-proxy 如何保证规则的一致性以及提升 kube-proxy 性能点的地方,这也是 kubernetes 使用稳定性的一部分。 kube-proxy 如何做到的CRUD kube-proxy 实际上与其他内置 controller 架构是相同的,实际上也属于一个 controller ,但它属于一个 service, endpoints 的可读可写的控制器,node的读控制器。对于CRUD方面,kube-proxy,在设计上分为 增/改 两方面。正如下面代码所示 pkg/proxy/ipvs/proxier.go go 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 func (proxier *Proxier) OnServiceAdd(service *v1.Service) { proxier.OnServiceUpdate(nil, service) } // OnServiceUpdate is called whenever modification of an existing service object is observed....

 ·  · 

扫盲Kubernetes负载均衡 - 从Ingress聊到LB

概述 在之前有一个系列提到了扩展proxier,但可能细心的同学注意到,作为一个外部的LB,市场上存在一些开源的为kubernetes集群提供的LB,这不是舍近求远吗?而 Google工程师 Adam Dunstan 的 文章 [1] 对比了这些LB的区别(中文翻译备份 [2] ),例如: MetalLB:最流行的 负载均衡控制器 PureLB:新产品 (文章作者 Adam Dunstan 参与了 PureLB的开发工作) OpenELB:相对较新的产品,最初该LB仅关注路由方向 文章提出了一个LB实现的基本目标为:必要的简单网络组件,与可扩展的集群操作 启动受控的集群service/应用的外部访问 外部资源的预配置 易于整合自动化的工作流程(CI/CD) 那么这些LB与 kube-proxy 甚至于 IPVS/IPTables 有什么区别呢? 这些LB的核心是为集群service提供一个外部IP,而service功能本身还是由 kube-proxy,IPVS 提供,在这点 MetalLB 介绍中提到了这个问题 In layer 2 mode, all traffic for a service IP goes to one node. From there, kube-proxy spreads the traffic to all the service’s pods. [3] After the packets arrive at the node, kube-proxy is responsible for the final hop of traffic routing, to get the packets to one specific pod in the service....

 ·  ·