Kubernetes v1.2 進展
Tim Hockin在最近一次的Bay Area Kubernetes Meetup #5上分享了即將發布的v1.2的新增特性以及后續的計劃[1]。
1External Services
Kubernetes已經提供了三種類型的Service:
ClusterIP: 為服務分配虛擬地址,且該地址僅在cluster內部可訪問
NodePort: 在ClusterIP基礎上將服務綁定到主機的指定端口上
LoadBalancer: 在NodePort基礎上調用cloud provider創建負載均衡器
然而,有的時候,Pod需要訪問Kubernetes外部的一些服務(比如已有的數據庫服務等),這個時候怎么辦呢?當然就是External Service了。
External Service的創建也比較簡單:
創建一個不帶Selector的Service
創建與Service同名的Endpoint,并在Endpoint中指定外部服務的IP和端口。
2Ingress (L7)
Ingress[2]的引入是為了解決Service的兩個問題:
Services面向的是L3/L4,然而很多服務都是L7的
Service分配的虛擬IP只能在Cluster內部訪問
有了Ingress,你就可以很方便的創建基于HTTP/HTTPS的負載均衡了。但是注意要自己部署并啟動Ingress Controller(通常部署為Kubernetes的一個Pod)。Ingress Controller主要要實現三個功能:
監控Ingress變化
為Ingress分配IP
為Ingress作負載均衡
Status:BETA in v1.2
3ConfigMaps
在容器中,應用的配置通常都是通過volume或者環境變量實現,但他們的一大缺點就是配置變更比較麻煩。ConfigMaps就是來解決應用的配置問題,使得這些配置可以通過API來管理,并以Volume或者環境變量的方式自動更新到Pod中。
Status: GA in v1.2
4Deployments
Deployments引入是為了集中管理RC的變化,并在server-side實現(RC是client-side的)。通過kubectl edit或者kubectl apply可以更方便的管理。
Status: BETA in v1.2
5Jobs
Jobs為了解決批處理和大數據處理的應用中run-to-completion的問題。
Status: GA in v1.2
6HorizontalPodAutoscalers
RC和deployments僅僅保證了服務的狀態是可用的(保證Pod的個數),但未考慮Pod的實際資源使用情況。HorizontalPodAutoscalers可以根據資源的使用情況(當前僅實現了CPU利用率)對Pod自動伸縮。
Status: GA in v1.2
7DaemonSets
DaemonSets可以保證Pod在每個node(或選定的nodes)上只有一個實例。
DaemonSets的一個典型用例是cAdvisor,在每個node上只需要啟動一個就可以了。
Status: BETA in v1.2
8PersistentVolumes
在v1.2中,PersistentVolumes增加了auto-provisioning特性(alpha)。
9Network Plugins
CNI是推薦的network plugin
10近期的計劃
還有一些正在做但不會在v1.2中包括的feature:
Cron (scheduled jobs)
Custom metrics
“Apply” a config (even more declarative)
Interactive containers
Bandwidth shaping
Third-party API objects
Scalability: 1000 nodes, 100+ pods/node
Performance
Machine-generated Go clients (less deps!)
Volume usage stats
Multi-zone (AZ) support
Multi-scheduler support
Node affinity and anti-affinity
Multi-cluster federation
API federation
More volume types
Private Docker registry
External DNS integration
Volume classes and auto-provisioning
Node fencing
DiY Cloud Provider plugins
More container runtimes (e.g. Hyper)
Better auth{n,z}
Network policy (microsegmentation) [3]
Big data integrations
Device scheduling (e.g. GPUs)
參考連接:
[1] https://speakerdeck.com/thockin/news-from-the-front-v1-dot-2
[2] https://github.com/kubernetes/kubernetes/blob/master/docs/user-guide/ingress.md
[3] https://docs.google.com/document/d/1_w77-zG_Xj0zYvEMfQZTQ-wPP4kXkpGD8smVtW_qqWM/edit
稿源:云計算微信號
來自: http://www.oschina.net//news/70686/kubernetes-1-2-progress