SlideShare una empresa de Scribd logo
1 de 50
Descargar para leer sin conexión
Kyle bai
R&D @ inwinSTACK
www.inwinstack.com
Extend the Kubernetes API with CRD and
Custom API Server
Job
R&D @ inwinSTACK
Description
早期在校主要撰寫 java 與 objc 程式語⾔言,並專注於 iOS
Mobile 應⽤用程式開發,具備四年年開發經驗。次要研讀
Hadoop 與 Spark 資料運算框架,以及 Linux 相關技術。
研所與⼯工作期間則專注於 OpenStack、Ceph 與
Kubernetes 等雲原⽣生相關技術開源專案,閒暇之餘會參參加
相關專案社區及貢獻,並利利⽤用部落落格、GitHub 與 GitBook
進⾏行行筆記記錄。
Drink Coffee
Good!
Phone
#7727
Love
Buttocks
kairen(kyle.b@inwinstack.com)
https://kairen.github.io/
About Me
Kyle Bai
Kubernetes
47%
Containers remain the top emerging
technology of interest to users. Among
those currently deploying container
orchestration or platform services on
OpenStack, 47% are using Kubernetes.
Why Kubernetes?
Kubernetes API Server
Extend the Kubernetes with CRD
Extend the Kubernetes with apiserver-builder
Agenda
Today I will talk about
Why Kubernetes?
Kubernetes
Kubernetes 是 Google 開源的容器(Container)分散式管理理系統,是
Google Brog ⼗十幾年年以來來⼤大規模應⽤用容器技術的經驗累積和昇華的⼀一個
重要成果,是建於 Container(OCI容器標準)之上的容器叢集排程系統,
簡稱為K8s( )。
為 CNCF(Cloud Native Computing Foundation) 專案之⼀一。
Stars
25,830+
Commits
52,905+
Contributors
1,331+
Kubernetes Layer
CNCF Members
CNCF Landscape
Container Management Platforms
Preferences
Kubernetes Pros
資源監控
Monitoring
滾動升級
Rolling-update
⾼高可靠性
High-availability
⾃自我修復
Self-healing
雲端⽀支援
Cloud Provider
持久性儲存
Persistent Volumes
組態檔案
Configmap
安全性
Secret
Kubernetes 管理理跨區域與主機的容器節點,提供基本部署、維運、管
理理,以及執⾏行行各項應⽤用程式,並具備多種特性。
Microservices
Kubernetes 架構設計非常適合在微服務(Microservices)軟體架構,透
過多個容器(Container)與負載平衡等來來組成系統。
Kubernetes Distributions
Kubernetes API Server
Kubernetes Architecture(1/2)
Kubernetes 屬於分散式架構系統,主要由兩兩種節點⾓角⾊色組成:
• Masters – 主要提供 API、管理理⼯工作節點與排程等,為主節點。
• Nodes(Minions) – 主要執⾏行行容器應⽤用的節點,上⾯面會執⾏行行許多
容器。
Kubernetes Architecture(2/2)
Kubernetes API driven
Kubernetes API 是以 JSON 作為其主要序列列化模型的 HTTP API,且能夠⽀支
援協定快取區,並⽤用於叢集內部溝通使⽤用。
• 通過 API 完成節點之間溝通進⾏行行 CRUD 操作,或是授權、認證與註冊等。
• Kubernetes 有明確定義與規範 API。⽀支援 OpenAPI。
• 使⽤用 gRPC 進⾏行行 Remote Procedure Call。
• 可擴展的 API。
• CRD(Custom Resource Definitions)
• API server aggregation
• Custom resources and controllers
HTTP API spaces
由於其可擴展性, Kubernetes ⽀支援不同 API 路路徑版本,比如 /api/v1或/apis/
extensions/v1beta1。
API Levels
在 Kubernetes 中,不同版本的 API 意味著不同層級穩定度與⽀支援度:
• Alpha level:在預設下是⼤大多情況禁⽌止使⽤用狀狀態,這些功能有可能隨時在下⼀一
版本被遺棄,因此只適⽤用於測試⽤用,Example: v1alpha1。
• Beta level: 在這級別⼀一般預設會啟⽤用,這表⽰示該功能已經過很好的測試項
⽬目,但是物件內容可能會在後續版本或穩定版本發⽣生變化。Example:
v1beta2。
• Stable level:在這級別表⽰示該功能已經穩定,會很長的時間⼀一直存在。
Example: v1。
API Terminology(1/2)
• Kind:是⼀一個實體(Entity)的類型,每個
Kubernetes 物件都會有⼀一個欄欄位 Kind。
1. 物件表⽰示系統中的⼀一個持久實體,如 Pod
與 Namespace。
2. ⼀一個多種實體的資源集合列列表,如
PodLists, NodeLists。
3. 特殊⽤用途類型⽤用於物件與非持久實體的特
定操作,如 /binding, /status 這些⽤用來來取得
API Group 與 Resource 的錯誤狀狀態。
API Terminology(2/2)
• API Group:是邏輯上相關的種類集合,如 Job 與 CronJob 都屬於批次處理理功能相
關。
• Version: 每個 API Group 存在多個版本,這些版本區分不同穩定度層級,⼀一般功能會
從 v1alpha1 升級到 v1beta1,然後在 v1 成為穩定版本。
• Resource: 資源是透過 HTTP 發送與檢索的系統實體,其以 JSON 來來表⽰示。可以是
單⼀一或者多個資源。
Request Flow and Processing(1/4)
https://github.com/kubernetes/apiserver/blob/master/pkg/server/config.go
• 在 DefaultBuildHandlerChain() 做
操作過濾處理理。
• 透過 Multiplexer 來來依據 HTTP 路路
徑將請求路路由到對應 Handlers。
• 利利⽤用 Routes 來來將 HTTP 路路徑與
Handlers 進⾏行行連接。
• Handlers 獲取 HTTP 請求與上下⽂文
( User, Auth 等),並從儲存中取得
物件實體。
Request Flow and Processing(2/4)
https://www.slideshare.net/sttts/kubernetes-api-deep-dive-into-the-kubeapiserver
Request Flow and Processing(3/4)
https://www.slideshare.net/sttts/kubernetes-api-deep-dive-into-the-kubeapiserver
Request Flow and Processing(4/4)
https://www.slideshare.net/sttts/kubernetes-api-deep-dive-into-the-kubeapiserver
Cluster state in Etcd
Validation and Admission
• Admission:透過驗證叢集的全域約束來來檢查是否建立或更更新 API 物件,在
Kubernetes 中有很多這樣功能。幾個約束範例例:
• NamespaceLifecycle: 如果命名空間不存在,則拒絕該所有請求。
• ResourceQuota:為叢集的當前使⽤用者強制執⾏行行額度限制。
• Validation:檢查傳入的物件(建立與更更新過程)的格式是否符合。例例如:
• 檢查所有的字串串是否是有效的格式。
• 檢查是否有設定⽭矛盾欄欄位。
YAML file to define resource
Example resource:
Extend the Kubernetes with CRD
CustomResourceDefinitions(CRD)
CustomResourceDefinition(CRD) 是 v1.7+ 版本新加入的 Kubernetes API 擴
展機制,⽬目標是無需修改核⼼心程式碼就能對 Kubernetes 進⾏行行擴展,⽽而 CRD 更更
是 ThirdPartyResources(TPR) 的升級版。
• 使⽤用⾃自定義物件進⾏行行擴展 Kubernetes API.
• CRDs 能夠沿⽤用熟係的 UX ⼯工具,ex: kubectl.
• 能夠與 Controllers 進⾏行行結合.
• ⽀支援 SubResources(v1.9).
P.S. TPR 在 v1.8 版本已被遺棄。
How CRD works internally(1/2)
Creating a CRD
How CRD works internally(2/2)
Creating a CustomResource
CRD Example(1/2)
CRD Example(2/2)
Add Controller to Handle events
Operators
Operator 是 CoreOS 開發的框架,⽬目標是簡化複雜有狀狀態應⽤用的管理理,它能
夠達到應⽤用程式的狀狀態事件變化,並利利⽤用控制器來來透過擴展的 Kubernetes API
進⾏行行⾃自動建立、管理理與配置應⽤用程式容器實例例。
Use case - rook.io(1/3)
rook.io: ⼀一款⽀支援檔案系統、區塊儲存與物件儲存服務的雲原⽣生儲存系統。(Ceph 改良版
on Kubenretes)。
Use case - rook.io(2/3)
Use case - rook.io(3/3)
Rook 使⽤用 CRD 來來定義建立 Pool 與
Filesystem 資源,以提供 Rook
operator 存取並建立對應服務。
Use case - TensorFlow(1/3)
https://github.com/tensorflow/k8s
Kubernetes Custom Resource and Operator For TensorFlow jobs.
Use case - TensorFlow(2/3)
Use case - TensorFlow(3/3)
Demo
https://github.com/kairen/crd-examples
Refer projects
• code-generator
• crd-code-generation
• apiextensions-apiserver
• sample-apiserver
• sample-controller
• apimachinery
Extend the Kubernetes API with apiserver-builder
apiserver-builder
apiserver-builder 是⼀一個實作快速建構 Kubernetes apiserver 與⾃自定義資源類
型的⼯工具與函式庫,該⼯工具具備了了以下幾個特性:
• 能夠⼀一次建立新資源類型、控制器、測試函式與⽂文件。
• 能夠建構與執⾏行行於 Standalone, Minikube 與遠端叢集。
• 能夠簡單地從控制器(Controller)來來觀看與更更新 Kubernetes API 資源類型。
• 很簡單的加入新資源與⼦子資源。
• 為⼤大多數欄欄位提供預設值,且能夠被覆蓋。
apiserver-builder cmd
# 初始化
$ cd GOPATH/src/github.com/my-org/my-project
$ apiserver-boot init repo --domain <your-domain>
# 建立資源
$ apiserver-boot create group version resource --group <group> --version <version> --kind <Kind>
# 編譯執⾏行行檔
$ apiserver-boot build executables
$ apiserver-boot build docs
# 在 local 執⾏行行
$ apiserver-boot run local
# 在叢集執⾏行行
$ apiserver-boot run in-cluster --name nameofservicetorun --namespace default --image gcr.io/myrepo/
myimage:mytag
$ kubectl create -f sample/<type>.yaml
apiserver-builder storage operations
Demo
https://github.com/kairen/crd-examples
Refer projects
• apiserver-builder/example
• kube-openapi
• service-catalog
50
有任何問題與想法,可以⼀一起討論唷。
Thank You!!

Más contenido relacionado

La actualidad más candente

開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽Will Huang
 
Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊Miles Chou
 
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)Will Huang
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer TalkLarry Cai
 
Bd paa s - big-data platform as a service
Bd paa s - big-data platform as a serviceBd paa s - big-data platform as a service
Bd paa s - big-data platform as a serviceinwin stack
 
Docker 基礎介紹與實戰
Docker 基礎介紹與實戰Docker 基礎介紹與實戰
Docker 基礎介紹與實戰Bo-Yi Wu
 
AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)Will Huang
 
Cloudstack dev/user sharing
Cloudstack dev/user sharingCloudstack dev/user sharing
Cloudstack dev/user sharinggavin_lee
 
Angular 4 網站開發最佳實務 (Modern Web 2017)
Angular 4 網站開發最佳實務 (Modern Web 2017)Angular 4 網站開發最佳實務 (Modern Web 2017)
Angular 4 網站開發最佳實務 (Modern Web 2017)Will Huang
 
Docker 淺入淺出
Docker 淺入淺出Docker 淺入淺出
Docker 淺入淺出Miles Chou
 
AWS EC2 for beginner
AWS EC2 for beginnerAWS EC2 for beginner
AWS EC2 for beginnerazole Lai
 
Docker tutorial
Docker tutorialDocker tutorial
Docker tutorialazole Lai
 
docker intro
docker introdocker intro
docker introkoji lin
 
KSDG BaaS Intro
KSDG BaaS IntroKSDG BaaS Intro
KSDG BaaS Introericpi Bi
 
從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用謝 宗穎
 
實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)
實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)
實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)Will Huang
 
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)Will Huang
 
Continuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIContinuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIChu-Siang Lai
 

La actualidad más candente (20)

開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽
 
Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊
 
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer Talk
 
Bd paa s - big-data platform as a service
Bd paa s - big-data platform as a serviceBd paa s - big-data platform as a service
Bd paa s - big-data platform as a service
 
Docker 基礎介紹與實戰
Docker 基礎介紹與實戰Docker 基礎介紹與實戰
Docker 基礎介紹與實戰
 
AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)
 
Cloudstack dev/user sharing
Cloudstack dev/user sharingCloudstack dev/user sharing
Cloudstack dev/user sharing
 
Angular 4 網站開發最佳實務 (Modern Web 2017)
Angular 4 網站開發最佳實務 (Modern Web 2017)Angular 4 網站開發最佳實務 (Modern Web 2017)
Angular 4 網站開發最佳實務 (Modern Web 2017)
 
Docker 淺入淺出
Docker 淺入淺出Docker 淺入淺出
Docker 淺入淺出
 
AWS EC2 for beginner
AWS EC2 for beginnerAWS EC2 for beginner
AWS EC2 for beginner
 
Docker tutorial
Docker tutorialDocker tutorial
Docker tutorial
 
docker intro
docker introdocker intro
docker intro
 
微服務自己動手做
微服務自己動手做微服務自己動手做
微服務自己動手做
 
Docker Build
Docker BuildDocker Build
Docker Build
 
KSDG BaaS Intro
KSDG BaaS IntroKSDG BaaS Intro
KSDG BaaS Intro
 
從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用
 
實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)
實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)
實現 Angular, Docker 與 Kubernetes 持續部署 (NG+2020)
 
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
 
Continuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIContinuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CI
 

Similar a Extend the Kubernetes API with CRD and Custom API Server

Langchain and Azure ML and Open AI
Langchain and Azure ML and Open AILangchain and Azure ML and Open AI
Langchain and Azure ML and Open AIKo Ko
 
ASP.Net WebAPI經驗分享
ASP.Net WebAPI經驗分享ASP.Net WebAPI經驗分享
ASP.Net WebAPI經驗分享國昭 張
 
開放原始碼 Ch2.5 app - oss - 3rd party api(ver 1.0)
開放原始碼 Ch2.5   app - oss - 3rd party api(ver 1.0) 開放原始碼 Ch2.5   app - oss - 3rd party api(ver 1.0)
開放原始碼 Ch2.5 app - oss - 3rd party api(ver 1.0) My own sweet home!
 
Train.IO 【第六期-OpenStack 二三事】
Train.IO 【第六期-OpenStack 二三事】Train.IO 【第六期-OpenStack 二三事】
Train.IO 【第六期-OpenStack 二三事】inwin stack
 
Introduction to K8S Big Data SIG
Introduction to K8S Big Data SIGIntroduction to K8S Big Data SIG
Introduction to K8S Big Data SIGJazz Yao-Tsung Wang
 
Angular js twmvc#17
Angular js twmvc#17Angular js twmvc#17
Angular js twmvc#17twMVC
 
北護大/FHIR 開發簡介與應用
北護大/FHIR 開發簡介與應用北護大/FHIR 開發簡介與應用
北護大/FHIR 開發簡介與應用Lorex L. Yang
 
Ceph customize ap is for programmatic access with python
Ceph customize ap is for programmatic access with pythonCeph customize ap is for programmatic access with python
Ceph customize ap is for programmatic access with pythonBo-Yu Chen
 
Hyper: 让Pod以VM为边界
Hyper: 让Pod以VM为边界Hyper: 让Pod以VM为边界
Hyper: 让Pod以VM为边界Xu Wang
 
容器式基礎架構介紹
容器式基礎架構介紹容器式基礎架構介紹
容器式基礎架構介紹Philip Zheng
 
Rest与面向资源的web开发
Rest与面向资源的web开发Rest与面向资源的web开发
Rest与面向资源的web开发topgeek
 
51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundryHong Cai
 
4. Go 工程化实践-0124-v2.pdf
4. Go 工程化实践-0124-v2.pdf4. Go 工程化实践-0124-v2.pdf
4. Go 工程化实践-0124-v2.pdfssuserd6c7621
 
99cloud openstack ci
99cloud openstack ci99cloud openstack ci
99cloud openstack ciLiang Bo
 
Windows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, KubernetesWindows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, KubernetesWill Huang
 
Artifacts management with CI and CD
Artifacts management with CI and CDArtifacts management with CI and CD
Artifacts management with CI and CDChen-Tien Tsai
 
[QCon 2016] 基于云平台的docker多租户安全
[QCon 2016] 基于云平台的docker多租户安全[QCon 2016] 基于云平台的docker多租户安全
[QCon 2016] 基于云平台的docker多租户安全Zhimin Tang
 
Elastic stack day-1
Elastic stack day-1Elastic stack day-1
Elastic stack day-1YI-CHING WU
 
探索 API 開發的挑戰與解決之道 | .NET Conf 2023 Taiwan
探索 API 開發的挑戰與解決之道 | .NET Conf 2023 Taiwan探索 API 開發的挑戰與解決之道 | .NET Conf 2023 Taiwan
探索 API 開發的挑戰與解決之道 | .NET Conf 2023 TaiwanAlan Tsai
 
企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養Philip Zheng
 

Similar a Extend the Kubernetes API with CRD and Custom API Server (20)

Langchain and Azure ML and Open AI
Langchain and Azure ML and Open AILangchain and Azure ML and Open AI
Langchain and Azure ML and Open AI
 
ASP.Net WebAPI經驗分享
ASP.Net WebAPI經驗分享ASP.Net WebAPI經驗分享
ASP.Net WebAPI經驗分享
 
開放原始碼 Ch2.5 app - oss - 3rd party api(ver 1.0)
開放原始碼 Ch2.5   app - oss - 3rd party api(ver 1.0) 開放原始碼 Ch2.5   app - oss - 3rd party api(ver 1.0)
開放原始碼 Ch2.5 app - oss - 3rd party api(ver 1.0)
 
Train.IO 【第六期-OpenStack 二三事】
Train.IO 【第六期-OpenStack 二三事】Train.IO 【第六期-OpenStack 二三事】
Train.IO 【第六期-OpenStack 二三事】
 
Introduction to K8S Big Data SIG
Introduction to K8S Big Data SIGIntroduction to K8S Big Data SIG
Introduction to K8S Big Data SIG
 
Angular js twmvc#17
Angular js twmvc#17Angular js twmvc#17
Angular js twmvc#17
 
北護大/FHIR 開發簡介與應用
北護大/FHIR 開發簡介與應用北護大/FHIR 開發簡介與應用
北護大/FHIR 開發簡介與應用
 
Ceph customize ap is for programmatic access with python
Ceph customize ap is for programmatic access with pythonCeph customize ap is for programmatic access with python
Ceph customize ap is for programmatic access with python
 
Hyper: 让Pod以VM为边界
Hyper: 让Pod以VM为边界Hyper: 让Pod以VM为边界
Hyper: 让Pod以VM为边界
 
容器式基礎架構介紹
容器式基礎架構介紹容器式基礎架構介紹
容器式基礎架構介紹
 
Rest与面向资源的web开发
Rest与面向资源的web开发Rest与面向资源的web开发
Rest与面向资源的web开发
 
51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry
 
4. Go 工程化实践-0124-v2.pdf
4. Go 工程化实践-0124-v2.pdf4. Go 工程化实践-0124-v2.pdf
4. Go 工程化实践-0124-v2.pdf
 
99cloud openstack ci
99cloud openstack ci99cloud openstack ci
99cloud openstack ci
 
Windows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, KubernetesWindows Container 101: dotNET, Container, Kubernetes
Windows Container 101: dotNET, Container, Kubernetes
 
Artifacts management with CI and CD
Artifacts management with CI and CDArtifacts management with CI and CD
Artifacts management with CI and CD
 
[QCon 2016] 基于云平台的docker多租户安全
[QCon 2016] 基于云平台的docker多租户安全[QCon 2016] 基于云平台的docker多租户安全
[QCon 2016] 基于云平台的docker多租户安全
 
Elastic stack day-1
Elastic stack day-1Elastic stack day-1
Elastic stack day-1
 
探索 API 開發的挑戰與解決之道 | .NET Conf 2023 Taiwan
探索 API 開發的挑戰與解決之道 | .NET Conf 2023 Taiwan探索 API 開發的挑戰與解決之道 | .NET Conf 2023 Taiwan
探索 API 開發的挑戰與解決之道 | .NET Conf 2023 Taiwan
 
企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養企業導入容器經驗分享與開源技能培養
企業導入容器經驗分享與開源技能培養
 

Más de inwin stack

Migrating to Cloud Native Solutions
Migrating to Cloud Native SolutionsMigrating to Cloud Native Solutions
Migrating to Cloud Native Solutionsinwin stack
 
Cloud Native 下的應用網路設計
Cloud Native 下的應用網路設計Cloud Native 下的應用網路設計
Cloud Native 下的應用網路設計inwin stack
 
當電子發票遇見 Google Cloud Function
當電子發票遇見 Google Cloud Function當電子發票遇見 Google Cloud Function
當電子發票遇見 Google Cloud Functioninwin stack
 
運用高效、敏捷全新平台極速落實雲原生開發
運用高效、敏捷全新平台極速落實雲原生開發運用高效、敏捷全新平台極速落實雲原生開發
運用高效、敏捷全新平台極速落實雲原生開發inwin stack
 
The last mile of digital transformation AI大眾化:數位轉型的最後一哩
The last mile of digital transformation AI大眾化:數位轉型的最後一哩The last mile of digital transformation AI大眾化:數位轉型的最後一哩
The last mile of digital transformation AI大眾化:數位轉型的最後一哩inwin stack
 
整合Cloud Foundry 和 Kubernetes 技術打造企業級雲應用平台解決方案
整合Cloud Foundry 和 Kubernetes 技術打造企業級雲應用平台解決方案整合Cloud Foundry 和 Kubernetes 技術打造企業級雲應用平台解決方案
整合Cloud Foundry 和 Kubernetes 技術打造企業級雲應用平台解決方案inwin stack
 
An Open, Open source way to enable your Cloud Native Journey
An Open, Open source way to enable your Cloud Native JourneyAn Open, Open source way to enable your Cloud Native Journey
An Open, Open source way to enable your Cloud Native Journeyinwin stack
 
維運Kubernetes的兩三事
維運Kubernetes的兩三事維運Kubernetes的兩三事
維運Kubernetes的兩三事inwin stack
 
Serverless framework on kubernetes
Serverless framework on kubernetesServerless framework on kubernetes
Serverless framework on kubernetesinwin stack
 
Web後端技術的演變
Web後端技術的演變Web後端技術的演變
Web後端技術的演變inwin stack
 
以 Kubernetes 部屬 Spark 大數據計算環境
以 Kubernetes 部屬 Spark 大數據計算環境以 Kubernetes 部屬 Spark 大數據計算環境
以 Kubernetes 部屬 Spark 大數據計算環境inwin stack
 
Setup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes FederationSetup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes Federationinwin stack
 
基於 K8S 開發的 FaaS 專案 - riff
基於 K8S 開發的 FaaS 專案 - riff基於 K8S 開發的 FaaS 專案 - riff
基於 K8S 開發的 FaaS 專案 - riffinwin stack
 
使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster 使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster inwin stack
 
利用K8S實現高可靠應用
利用K8S實現高可靠應用利用K8S實現高可靠應用
利用K8S實現高可靠應用inwin stack
 
Integrate Kubernetes into CORD(Central Office Re-architected as a Datacenter)
Integrate Kubernetes into CORD(Central Office Re-architected as a Datacenter)Integrate Kubernetes into CORD(Central Office Re-architected as a Datacenter)
Integrate Kubernetes into CORD(Central Office Re-architected as a Datacenter)inwin stack
 
Distributed tensorflow on kubernetes
Distributed tensorflow on kubernetesDistributed tensorflow on kubernetes
Distributed tensorflow on kubernetesinwin stack
 
Virtualization inside kubernetes
Virtualization inside kubernetesVirtualization inside kubernetes
Virtualization inside kubernetesinwin stack
 
利用K8S實現高可靠應用
利用K8S實現高可靠應用利用K8S實現高可靠應用
利用K8S實現高可靠應用inwin stack
 
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
Build the Blockchain as service (BaaS) Using Ethereum on KubernetesBuild the Blockchain as service (BaaS) Using Ethereum on Kubernetes
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetesinwin stack
 

Más de inwin stack (20)

Migrating to Cloud Native Solutions
Migrating to Cloud Native SolutionsMigrating to Cloud Native Solutions
Migrating to Cloud Native Solutions
 
Cloud Native 下的應用網路設計
Cloud Native 下的應用網路設計Cloud Native 下的應用網路設計
Cloud Native 下的應用網路設計
 
當電子發票遇見 Google Cloud Function
當電子發票遇見 Google Cloud Function當電子發票遇見 Google Cloud Function
當電子發票遇見 Google Cloud Function
 
運用高效、敏捷全新平台極速落實雲原生開發
運用高效、敏捷全新平台極速落實雲原生開發運用高效、敏捷全新平台極速落實雲原生開發
運用高效、敏捷全新平台極速落實雲原生開發
 
The last mile of digital transformation AI大眾化:數位轉型的最後一哩
The last mile of digital transformation AI大眾化:數位轉型的最後一哩The last mile of digital transformation AI大眾化:數位轉型的最後一哩
The last mile of digital transformation AI大眾化:數位轉型的最後一哩
 
整合Cloud Foundry 和 Kubernetes 技術打造企業級雲應用平台解決方案
整合Cloud Foundry 和 Kubernetes 技術打造企業級雲應用平台解決方案整合Cloud Foundry 和 Kubernetes 技術打造企業級雲應用平台解決方案
整合Cloud Foundry 和 Kubernetes 技術打造企業級雲應用平台解決方案
 
An Open, Open source way to enable your Cloud Native Journey
An Open, Open source way to enable your Cloud Native JourneyAn Open, Open source way to enable your Cloud Native Journey
An Open, Open source way to enable your Cloud Native Journey
 
維運Kubernetes的兩三事
維運Kubernetes的兩三事維運Kubernetes的兩三事
維運Kubernetes的兩三事
 
Serverless framework on kubernetes
Serverless framework on kubernetesServerless framework on kubernetes
Serverless framework on kubernetes
 
Web後端技術的演變
Web後端技術的演變Web後端技術的演變
Web後端技術的演變
 
以 Kubernetes 部屬 Spark 大數據計算環境
以 Kubernetes 部屬 Spark 大數據計算環境以 Kubernetes 部屬 Spark 大數據計算環境
以 Kubernetes 部屬 Spark 大數據計算環境
 
Setup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes FederationSetup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes Federation
 
基於 K8S 開發的 FaaS 專案 - riff
基於 K8S 開發的 FaaS 專案 - riff基於 K8S 開發的 FaaS 專案 - riff
基於 K8S 開發的 FaaS 專案 - riff
 
使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster 使用 Prometheus 監控 Kubernetes Cluster
使用 Prometheus 監控 Kubernetes Cluster
 
利用K8S實現高可靠應用
利用K8S實現高可靠應用利用K8S實現高可靠應用
利用K8S實現高可靠應用
 
Integrate Kubernetes into CORD(Central Office Re-architected as a Datacenter)
Integrate Kubernetes into CORD(Central Office Re-architected as a Datacenter)Integrate Kubernetes into CORD(Central Office Re-architected as a Datacenter)
Integrate Kubernetes into CORD(Central Office Re-architected as a Datacenter)
 
Distributed tensorflow on kubernetes
Distributed tensorflow on kubernetesDistributed tensorflow on kubernetes
Distributed tensorflow on kubernetes
 
Virtualization inside kubernetes
Virtualization inside kubernetesVirtualization inside kubernetes
Virtualization inside kubernetes
 
利用K8S實現高可靠應用
利用K8S實現高可靠應用利用K8S實現高可靠應用
利用K8S實現高可靠應用
 
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
Build the Blockchain as service (BaaS) Using Ethereum on KubernetesBuild the Blockchain as service (BaaS) Using Ethereum on Kubernetes
Build the Blockchain as service (BaaS) Using Ethereum on Kubernetes
 

Último

20220113_product_day copy.pdf20220113_product_day copy.pdf
20220113_product_day copy.pdf20220113_product_day copy.pdf20220113_product_day copy.pdf20220113_product_day copy.pdf
20220113_product_day copy.pdf20220113_product_day copy.pdfJamie (Taka) Wang
 
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptxSymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptxNCU MCL
 
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】黑客 接单【TG/微信qoqoqdqd】
 
20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf
20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf
20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdfJamie (Taka) Wang
 
20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf
20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf
20200606_insight_Ignition.pdf20200606_insight_Ignition.pdfJamie (Taka) Wang
 
20200607_insight_sync.pdf20200607_insight_sync.pdf
20200607_insight_sync.pdf20200607_insight_sync.pdf20200607_insight_sync.pdf20200607_insight_sync.pdf
20200607_insight_sync.pdf20200607_insight_sync.pdfJamie (Taka) Wang
 
20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf
20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf
20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdfJamie (Taka) Wang
 
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptxSymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptxNCU MCL
 
20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf
20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf
20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdfJamie (Taka) Wang
 
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptxNCU MCL
 
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptxNCU MCL
 
20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf
20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf
20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdfJamie (Taka) Wang
 
20200808自營電商平台策略討論20200808自營電商平台策略討論_v1.pdf
20200808自營電商平台策略討論20200808自營電商平台策略討論_v1.pdf20200808自營電商平台策略討論20200808自營電商平台策略討論_v1.pdf
20200808自營電商平台策略討論20200808自營電商平台策略討論_v1.pdfJamie (Taka) Wang
 
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptxNCU MCL
 
20200429_01_software_v8.pdf20200429_01_software_v8.pdf20200429_01_software_v8...
20200429_01_software_v8.pdf20200429_01_software_v8.pdf20200429_01_software_v8...20200429_01_software_v8.pdf20200429_01_software_v8.pdf20200429_01_software_v8...
20200429_01_software_v8.pdf20200429_01_software_v8.pdf20200429_01_software_v8...Jamie (Taka) Wang
 
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptxNCU MCL
 
20200727_Insight workstation A1 plus 測試報告.pdf20200727_Insight workstation A1 ...
20200727_Insight workstation A1 plus 測試報告.pdf20200727_Insight workstation A1 ...20200727_Insight workstation A1 plus 測試報告.pdf20200727_Insight workstation A1 ...
20200727_Insight workstation A1 plus 測試報告.pdf20200727_Insight workstation A1 ...Jamie (Taka) Wang
 

Último (17)

20220113_product_day copy.pdf20220113_product_day copy.pdf
20220113_product_day copy.pdf20220113_product_day copy.pdf20220113_product_day copy.pdf20220113_product_day copy.pdf
20220113_product_day copy.pdf20220113_product_day copy.pdf
 
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptxSymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
 
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
 
20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf
20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf
20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf20200429_03_ec_v8.pdf
 
20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf
20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf
20200606_insight_Ignition.pdf20200606_insight_Ignition.pdf
 
20200607_insight_sync.pdf20200607_insight_sync.pdf
20200607_insight_sync.pdf20200607_insight_sync.pdf20200607_insight_sync.pdf20200607_insight_sync.pdf
20200607_insight_sync.pdf20200607_insight_sync.pdf
 
20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf
20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf
20200427_02_hardware_v3.pdf20200427_02_hardware_v3.pdf
 
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptxSymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
 
20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf
20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf
20200602_insight_business_plan_3.pdf20200602_insight_business_plan_3.pdf
 
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
 
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
 
20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf
20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf
20210105_量產技轉.pdf20210105_量產技轉.pdf20210105_量產技轉.pdf
 
20200808自營電商平台策略討論20200808自營電商平台策略討論_v1.pdf
20200808自營電商平台策略討論20200808自營電商平台策略討論_v1.pdf20200808自營電商平台策略討論20200808自營電商平台策略討論_v1.pdf
20200808自營電商平台策略討論20200808自營電商平台策略討論_v1.pdf
 
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
 
20200429_01_software_v8.pdf20200429_01_software_v8.pdf20200429_01_software_v8...
20200429_01_software_v8.pdf20200429_01_software_v8.pdf20200429_01_software_v8...20200429_01_software_v8.pdf20200429_01_software_v8.pdf20200429_01_software_v8...
20200429_01_software_v8.pdf20200429_01_software_v8.pdf20200429_01_software_v8...
 
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
 
20200727_Insight workstation A1 plus 測試報告.pdf20200727_Insight workstation A1 ...
20200727_Insight workstation A1 plus 測試報告.pdf20200727_Insight workstation A1 ...20200727_Insight workstation A1 plus 測試報告.pdf20200727_Insight workstation A1 ...
20200727_Insight workstation A1 plus 測試報告.pdf20200727_Insight workstation A1 ...
 

Extend the Kubernetes API with CRD and Custom API Server

  • 1. Kyle bai R&D @ inwinSTACK www.inwinstack.com Extend the Kubernetes API with CRD and Custom API Server
  • 2. Job R&D @ inwinSTACK Description 早期在校主要撰寫 java 與 objc 程式語⾔言,並專注於 iOS Mobile 應⽤用程式開發,具備四年年開發經驗。次要研讀 Hadoop 與 Spark 資料運算框架,以及 Linux 相關技術。 研所與⼯工作期間則專注於 OpenStack、Ceph 與 Kubernetes 等雲原⽣生相關技術開源專案,閒暇之餘會參參加 相關專案社區及貢獻,並利利⽤用部落落格、GitHub 與 GitBook 進⾏行行筆記記錄。 Drink Coffee Good! Phone #7727 Love Buttocks kairen(kyle.b@inwinstack.com) https://kairen.github.io/ About Me Kyle Bai
  • 3. Kubernetes 47% Containers remain the top emerging technology of interest to users. Among those currently deploying container orchestration or platform services on OpenStack, 47% are using Kubernetes. Why Kubernetes? Kubernetes API Server Extend the Kubernetes with CRD Extend the Kubernetes with apiserver-builder Agenda Today I will talk about
  • 5. Kubernetes Kubernetes 是 Google 開源的容器(Container)分散式管理理系統,是 Google Brog ⼗十幾年年以來來⼤大規模應⽤用容器技術的經驗累積和昇華的⼀一個 重要成果,是建於 Container(OCI容器標準)之上的容器叢集排程系統, 簡稱為K8s( )。 為 CNCF(Cloud Native Computing Foundation) 專案之⼀一。 Stars 25,830+ Commits 52,905+ Contributors 1,331+
  • 10. Kubernetes Pros 資源監控 Monitoring 滾動升級 Rolling-update ⾼高可靠性 High-availability ⾃自我修復 Self-healing 雲端⽀支援 Cloud Provider 持久性儲存 Persistent Volumes 組態檔案 Configmap 安全性 Secret Kubernetes 管理理跨區域與主機的容器節點,提供基本部署、維運、管 理理,以及執⾏行行各項應⽤用程式,並具備多種特性。
  • 14. Kubernetes Architecture(1/2) Kubernetes 屬於分散式架構系統,主要由兩兩種節點⾓角⾊色組成: • Masters – 主要提供 API、管理理⼯工作節點與排程等,為主節點。 • Nodes(Minions) – 主要執⾏行行容器應⽤用的節點,上⾯面會執⾏行行許多 容器。
  • 16. Kubernetes API driven Kubernetes API 是以 JSON 作為其主要序列列化模型的 HTTP API,且能夠⽀支 援協定快取區,並⽤用於叢集內部溝通使⽤用。 • 通過 API 完成節點之間溝通進⾏行行 CRUD 操作,或是授權、認證與註冊等。 • Kubernetes 有明確定義與規範 API。⽀支援 OpenAPI。 • 使⽤用 gRPC 進⾏行行 Remote Procedure Call。 • 可擴展的 API。 • CRD(Custom Resource Definitions) • API server aggregation • Custom resources and controllers
  • 17. HTTP API spaces 由於其可擴展性, Kubernetes ⽀支援不同 API 路路徑版本,比如 /api/v1或/apis/ extensions/v1beta1。
  • 18. API Levels 在 Kubernetes 中,不同版本的 API 意味著不同層級穩定度與⽀支援度: • Alpha level:在預設下是⼤大多情況禁⽌止使⽤用狀狀態,這些功能有可能隨時在下⼀一 版本被遺棄,因此只適⽤用於測試⽤用,Example: v1alpha1。 • Beta level: 在這級別⼀一般預設會啟⽤用,這表⽰示該功能已經過很好的測試項 ⽬目,但是物件內容可能會在後續版本或穩定版本發⽣生變化。Example: v1beta2。 • Stable level:在這級別表⽰示該功能已經穩定,會很長的時間⼀一直存在。 Example: v1。
  • 19. API Terminology(1/2) • Kind:是⼀一個實體(Entity)的類型,每個 Kubernetes 物件都會有⼀一個欄欄位 Kind。 1. 物件表⽰示系統中的⼀一個持久實體,如 Pod 與 Namespace。 2. ⼀一個多種實體的資源集合列列表,如 PodLists, NodeLists。 3. 特殊⽤用途類型⽤用於物件與非持久實體的特 定操作,如 /binding, /status 這些⽤用來來取得 API Group 與 Resource 的錯誤狀狀態。
  • 20. API Terminology(2/2) • API Group:是邏輯上相關的種類集合,如 Job 與 CronJob 都屬於批次處理理功能相 關。 • Version: 每個 API Group 存在多個版本,這些版本區分不同穩定度層級,⼀一般功能會 從 v1alpha1 升級到 v1beta1,然後在 v1 成為穩定版本。 • Resource: 資源是透過 HTTP 發送與檢索的系統實體,其以 JSON 來來表⽰示。可以是 單⼀一或者多個資源。
  • 21. Request Flow and Processing(1/4) https://github.com/kubernetes/apiserver/blob/master/pkg/server/config.go • 在 DefaultBuildHandlerChain() 做 操作過濾處理理。 • 透過 Multiplexer 來來依據 HTTP 路路 徑將請求路路由到對應 Handlers。 • 利利⽤用 Routes 來來將 HTTP 路路徑與 Handlers 進⾏行行連接。 • Handlers 獲取 HTTP 請求與上下⽂文 ( User, Auth 等),並從儲存中取得 物件實體。
  • 22. Request Flow and Processing(2/4) https://www.slideshare.net/sttts/kubernetes-api-deep-dive-into-the-kubeapiserver
  • 23. Request Flow and Processing(3/4) https://www.slideshare.net/sttts/kubernetes-api-deep-dive-into-the-kubeapiserver
  • 24. Request Flow and Processing(4/4) https://www.slideshare.net/sttts/kubernetes-api-deep-dive-into-the-kubeapiserver
  • 26. Validation and Admission • Admission:透過驗證叢集的全域約束來來檢查是否建立或更更新 API 物件,在 Kubernetes 中有很多這樣功能。幾個約束範例例: • NamespaceLifecycle: 如果命名空間不存在,則拒絕該所有請求。 • ResourceQuota:為叢集的當前使⽤用者強制執⾏行行額度限制。 • Validation:檢查傳入的物件(建立與更更新過程)的格式是否符合。例例如: • 檢查所有的字串串是否是有效的格式。 • 檢查是否有設定⽭矛盾欄欄位。
  • 27. YAML file to define resource Example resource:
  • 29. CustomResourceDefinitions(CRD) CustomResourceDefinition(CRD) 是 v1.7+ 版本新加入的 Kubernetes API 擴 展機制,⽬目標是無需修改核⼼心程式碼就能對 Kubernetes 進⾏行行擴展,⽽而 CRD 更更 是 ThirdPartyResources(TPR) 的升級版。 • 使⽤用⾃自定義物件進⾏行行擴展 Kubernetes API. • CRDs 能夠沿⽤用熟係的 UX ⼯工具,ex: kubectl. • 能夠與 Controllers 進⾏行行結合. • ⽀支援 SubResources(v1.9). P.S. TPR 在 v1.8 版本已被遺棄。
  • 30. How CRD works internally(1/2) Creating a CRD
  • 31. How CRD works internally(2/2) Creating a CustomResource
  • 34. Add Controller to Handle events
  • 35. Operators Operator 是 CoreOS 開發的框架,⽬目標是簡化複雜有狀狀態應⽤用的管理理,它能 夠達到應⽤用程式的狀狀態事件變化,並利利⽤用控制器來來透過擴展的 Kubernetes API 進⾏行行⾃自動建立、管理理與配置應⽤用程式容器實例例。
  • 36. Use case - rook.io(1/3) rook.io: ⼀一款⽀支援檔案系統、區塊儲存與物件儲存服務的雲原⽣生儲存系統。(Ceph 改良版 on Kubenretes)。
  • 37. Use case - rook.io(2/3)
  • 38. Use case - rook.io(3/3) Rook 使⽤用 CRD 來來定義建立 Pool 與 Filesystem 資源,以提供 Rook operator 存取並建立對應服務。
  • 39. Use case - TensorFlow(1/3) https://github.com/tensorflow/k8s Kubernetes Custom Resource and Operator For TensorFlow jobs.
  • 40. Use case - TensorFlow(2/3)
  • 41. Use case - TensorFlow(3/3)
  • 43. Refer projects • code-generator • crd-code-generation • apiextensions-apiserver • sample-apiserver • sample-controller • apimachinery
  • 44. Extend the Kubernetes API with apiserver-builder
  • 45. apiserver-builder apiserver-builder 是⼀一個實作快速建構 Kubernetes apiserver 與⾃自定義資源類 型的⼯工具與函式庫,該⼯工具具備了了以下幾個特性: • 能夠⼀一次建立新資源類型、控制器、測試函式與⽂文件。 • 能夠建構與執⾏行行於 Standalone, Minikube 與遠端叢集。 • 能夠簡單地從控制器(Controller)來來觀看與更更新 Kubernetes API 資源類型。 • 很簡單的加入新資源與⼦子資源。 • 為⼤大多數欄欄位提供預設值,且能夠被覆蓋。
  • 46. apiserver-builder cmd # 初始化 $ cd GOPATH/src/github.com/my-org/my-project $ apiserver-boot init repo --domain <your-domain> # 建立資源 $ apiserver-boot create group version resource --group <group> --version <version> --kind <Kind> # 編譯執⾏行行檔 $ apiserver-boot build executables $ apiserver-boot build docs # 在 local 執⾏行行 $ apiserver-boot run local # 在叢集執⾏行行 $ apiserver-boot run in-cluster --name nameofservicetorun --namespace default --image gcr.io/myrepo/ myimage:mytag $ kubectl create -f sample/<type>.yaml
  • 49. Refer projects • apiserver-builder/example • kube-openapi • service-catalog