K8s Source Analysis----The apigroupversion of Apiserver

Source: Internet
Author: User
Tags k8s
K8s Source Analysis----The apigroupversion of Apiserver

Reproduced in this article from my own space: http://user.qzone.qq.com/29185807/blog/1458892866

The previous 3 articles, mainly according to the program processing process to jump analysis. After these process jump analysis, the dark clouds finally see day.

We peel away the unimportant parts and go straight to the main frame. apigroupversion

In master, the initialization of API V1

Generates a default apigroupversion

Here's 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 Two, the main work flow

K8s.io\kubernetes\pkg\apiserver\apiserver.go

Main process

Following the main process, the decomposition steps

1. Initialize Installer


2, New WebService


3. Start Registration




Insert a mapping structure.


Insert a Restscope interface.

We continue to



Continue skipping some of the code


To this all process.

We're going to track the process of getting.




From this process plus the previous 3 articles, then the main processing process, has been more clear. So the rest is the analysis of the implementations of these interfaces such as Mapper,codec,typer,creater,convertor,linker.


Hao Haohua

QQ Crescent moon Lonely Road length 29185807

March 25, 2016

(Copyright statement: This article for the author original, if you need to reprint, please notify me, and indicate the source and author.) Reproduced without authorization, reserve the right to pursue its infringement. )


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.