"original" k8s source analysis----Apiserver apigroupversion
Reproduced in this article from my own space: http://user.qzone.qq.com/29185807/blog/1458892866
the previous 3 articles, mainly based on the program processing process to jump analysis. Through the jump analysis of these processes, the dark clouds are finally seen.
We peel off the unimportant parts and go directly to the main frame.
apigroupversion
In master, the initialization of the API V1
A default apigroupversion is generated.
Below is the most important data structure in the entire framework.
I. Main data structure
1, Mapper, the most important thing is the inside of the Restmapping function (in K8s.io\kubernetes\pkg\api\meta )
2, Codec, is mainly a coding, decoding the interface (in K8s.io\kubernetes\pkg\runtime )
3, Typer (in K8s.io\kubernetes\pkg\runtime )
4, creater (in K8s.io\kubernetes\pkg\runtime )
5, Convertor, conversion between different versions (in K8s.io\kubernetes\pkg\runtime )
6, Linker (in K8s.io\kubernetes\pkg\runtime )
7, the remaining temporarily do not do analysis
Second, the main work flow
K8s.io\kubernetes\pkg\apiserver \ Apiserver.go
Main process
According to the main process, the decomposition steps
1. Initialize Installer
2. New WebService
3. Start Registration
Insert a mapping structure
Plug in a Restscope interface
We continue to
Continue to skip some of the code
To this all process.
We'll trace it back in. Get processing process
From this process plus the previous 3 articles, the main processing process has been more clear. Then the rest is mapper,codec,typer,creater,convertor,linker and so on the implementation of these interfaces analysis.
Hao Haohua
QQ Crescent 29185807
March 25, 2016
"Original" k8s source analysis----Apiserver apigroupversion