6

Kubernetes APIServer Route 架构设计源码阅读 | 云原生社区

 3 years ago
source link: https://cloudnative.to/blog/kubernetes-apiserver-route/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

大家好,我是杨鼎睿,这一次给大家带来的是 API Server 的源码阅读。包括之前的 etcd 源码阅读,整个 API Server 共 109 张源码及源码图,文章最后有 API Server 系列目录。欢迎大家的阅读。

本文研究了 Route 部分的源码,配备源码进行进一步理解,可以加深理解,增强相关设计能力。

APIServerHandler

Overview

下图为 APIServerHandler 核心组件间关联。主要分为 Restful 和 NonRestful 两部分,director 优先使用 Restful 部分,如果处理成功,则退出,不执行 NonRestful 部分;如果 Restful 部分没有目标功能,则执行 NonRestful 部分。FullHandlerChain 用于 HTTP 处理入口点,链接了中间件功能,并将请求引导至 Director 进行处理。

routes-api-server-handler-serve.svg

下面为 APIServer 默认的 HandlerChain 构建过程

image.png

[3] API Server


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK