01. K8s扩展功能解析

2020-03-01 50浏览

  • 1.Kubernetes 1.7 Expansibility Feature © 2017 Rancher Labs, Inc .
  • 2.Rancher Labs简介 5,000 GitHub >20 millionstars downloads GA March 2016 © 2017 Rancher Labs, Inc. 100+ enterprise customers • Rancher Labs成立于2014年,总部位于加州 的Cupertino,同时在亚利桑那州的Phoenix和 中国设立研发中心 • 核心团队曾创立Cloud.com,并推出了 CloudStack,历经从VM到容器的完整技术演 进过程 • Rancher Server和Agent镜像在Docker Hub上 的下载次数已经超过4000万次,全球Rancher 的活动部署超过10,000个
  • 3.Rancher 与 Kubernetes • Rancher提供Kubernetes分发版 • Rancher是Kubernetes社区的活 跃成员 • Rancher目前支持Kubernetes 1.6.6 • Rancher Kubernetes分发版 Rancher提供官方认证和支持的分发 版,紧跟上游Kubernetes项目 Rancher基础架构服务 存储、网络、负载平衡、安全,等等 Rancher计划在Rancher 1.6.6版 本支持Kubernetes 1.7.0 © 2017 Rancher Labs, Inc. 3
  • 4.Rancher 与 Kubernetes Management Plane - Policy Management Cluster Operations User Management Lifecycle Management User Interface Application Catalog Monitoring Logging api api master master Infrastructure Services Infrastructure Services (Networking, Storage, DNS, Load Balancer, Security) © 2017 Rancher Labs, Inc.
  • 5.Kubernetes 1.7的扩展特性 • • • • • API aggregation(beta) CustomResourceDefinitions(beta) Support for extensible admission controllers Pluggable cloud providers Container runtime interface (CRI) enhancements © 2017 Rancher Labs, Inc.
  • 6.CustomResourceDefinition(CRD) • What CRD provides • Very flexible way to extend managed resource into a current Kubernetes cluster • Auto-generated API in Kubernetes API server • Customized resource controller to implement your business logic of managed resource • Natural Kubernetes experience for operating your own resource with Kubernetes RBAC and authentication. • What it comes from • From ThirdPartyResource in Kubernetes 1.6 • Create CRD with spec in Kubernetes 1.7 © 2017 Rancher Labs, Inc.
  • 7.Example of CRD and Resource Item my-crontab.yaml © 2017 Rancher Labs, Inc.
  • 8.How Does The Controller Work Resource status added deleted creating Reconcile resource status to spec Resource Item stoped running ResourceSpec:running controllers API Server ETCD Kubernetes Core © 2017 Rancher Labs, Inc. list/watch resource change
  • 9.API Aggregation • What API aggregation provides • Extended with additional APIs • Build your own API server • Requirements of aggregation layer • Running Kubernetes 1.7 Cluster • Enable apiserver flags © 2017 Rancher Labs, Inc.
  • 10.Setup an Extension API Server • Use apiserver-builder to build your own API server •https://github.com/Kubernetes-incubator/apiserver-builder• Download and install the latest version of apiserver-builder • Create project path in your GOPATH • Go into your project path and init your project ‘your-domain’ would be like your private tenant name. • Then initialize your own resource group, version and kind. • Your API server could be build and run now • Build as an image and run in a cluster © 2017 Rancher Labs, Inc.
  • 11.API Server Aggregation Architecture Expose service & registry API API Server Extend API Server Service Instance-1 Instance-2 ETCD Kubernetes Core © 2017 Rancher Labs, Inc. Instance-3 ETCD/ Other Storage
  • 12.Thanks! Yuxing 2017-8-5 © 2017 Rancher Labs, Inc .