Openshift 3.11的14大新功能詳解

聶健是大魏的紅帽同事,本文已獲得授權轉載,歡迎讀者閱讀他的技術blog:https://www.cnblogs.com/ericnie/

詳細請參考

https://docs.openshift.com/container-platform/3.11/release_notes/ocp_3_11_release_notes.html

注: Technology Preview的特徵不建議在生產環境中使用。

1 Operator

1.1 Operator生命週期管理(Technology Preview)

功能主要側重於協助集羣管理員安裝,升級和針對集羣中運行的Operator進行授權

  • 包含預製的operator並支持安裝新的operator
  • 支持operator的滾動升級
  • 支持對operator的RBAC授權

參考:

https://docs.openshift.com/container-platform/3.11/install_config/installing-operator-framework.html#installing-operator-framework

1.2 Operator SDK

提供基於代碼構建Operator,以及命令行用於構建,測試發佈Operator的開發工具

功能如下:

  • 提供工具快速的將應用邏輯打包成爲Operator
  • 節省客戶構建代碼和Kubernetes API交互的開銷
  • 支持在本地和遠程進行端到端的測試
  • 可以被Couchbase,MongoDB,Redis和其他使用

參考

https://docs.okd.io/latest/operators/osdk-getting-started.html

2 Broker

2.1 和ansible galaxy集成的Automation Broker

自動化Broker管理在AnsiblePlaybook Bundle中定義的應用,Openshift 3.11包含了針對從OCP Automation Broker發佈到Ansible Galaxy的APB源的發現和運行支持。

參考

https://docs.openshift.com/container-platform/3.11/architecture/service_catalog/ansible_service_broker.html#arch-ansible-service-broker

2.2 支持認證的Registry的Broker

RedHat 容器的Catalog從registry.access.redhat.com遷移到registry.redhat.io.registry.redhat.io需要針對訪問OCP的鏡像和內容進行認證。

OCP 3.11增加了針對認證registry的支持,broker使用cluster-wide作爲registry認證的缺省設置,可以在inventory文件中定義oreg_auth_user和 oreg_auth_password.

2.3 服務目錄命名空間的Broker

服務目錄增加了基於命名空間的Broker, 你可以註冊服務目錄的Broker爲集羣範圍的ClusterServiceBroker或者命名空間範圍的ServiceBroker類型,基於broker的範圍,確定是對整個集羣有效還是對特定的命名空間有效。

3 安裝和升級

3.1 升級過程中檢查過期的認證

在升級OCP3.11的過程中,需要檢查openshift_certificate_expiry_warnining_days,同時加入了openshift_certificate_expiry_fail_on_warn,決定上述參數是否正確。

3.2 支持Ansible 2.6

Openshift-ansible需要ansible2.6,無論是在OCP 3.11的安裝還是從3.10升級的過程中。

運行playbook最小的Ansible版本需要2.6.x,Ansible 2.7目前不支持。

3.3 需要註冊服務的認證密碼

OCP需要註冊服務認證的密碼,鏡像和元數據可以從認證的註冊服務,registry,redhat.io中拉取。

openshift_deployment_type == ‘openshift-enterprise’oreg_url==’registry.redhat.io’或者不定義

的時候,註冊認證需要在安裝和升級前配置,oreg_auth_user和 oreg_auth_password定義在inventory文件中。

參考

https://docs.openshift.com/container-platform/3.11/dev_guide/managing_images.html#private-registries

3.4 客戶的安裝過程記日誌

Ansible配置目前缺省支持OCP的安裝日誌記錄功能。日誌路徑定義在ansible配置參數log_path中,用戶必須在/usr/share/ansible/openshift-ansible目錄下運行playbook

4 存儲

4.1 容器存儲接口(Technology Preview)

CSI允許OCP使用支持CSI接口的後端存儲。參考

https://docs.openshift.com/container-platform/3.11/install_config/persistent_storage/persistent_storage_csi.html#install-config-persistent-storage-persistent-storage-csi

4.2 本地臨時存儲的保護(Technology Preview)

可以控制你的節點上的本地臨時存儲的使用,從而保護用戶耗盡本地存儲的資源。

此特徵缺省不啓用,啓用後OCP使用臨時存儲以存放信息。參考

https://docs.openshift.com/container-platform/3.11/install_config/configuring_ephemeral.html#install-config-configuring-ephemeral-storage

4.3 使用Openstack Manila供應PV(Technology Preview)

OCP可以使用OpenstackManila共享的文件系統服務供應的PV

4.4 PV Resize

基於OCP的GlusterFS支持在線的擴展PV。在建立Storage class時指定allowVolumeExpansion值爲true,過程如下:

  • PVC使用了storage class並提交一個claim
  • PVC指定一個新增加的空間
  • 底層的PV擴展

類似於GCE-PD,AWS-EBS,Azure Disk,Cinder塊存儲和Ceph RBD要求Pod在使用這些擴展後存儲空間前文件系統的擴展已經完成,Kubernetes會自動將這些需要用到擴展後存儲的Pod進行重啓。

Network attached文件系統,比如GlusterFS和Azure File, 不要求重啓Pod, 這些系統不需要統一的文件系統擴容。參考

https://docs.openshift.com/container-platform/3.11/dev_guide/expanding_persistent_volumes.html#expanding_persistent_volumes

4.5 基於租戶的存儲快照(Technology Preview)

租戶可以使用底層存儲技術對他們的應用數據進行快照,並從快照中恢復他們的數據,你可以只用外部的provisioner訪問EBS,GCE pDisk和hostPath。租戶必須停止和手工重啓他們的Pod。

5 擴展

5.1 Cluster Limits

更新了集羣的指南,針對高密度集羣,API server因爲每秒查詢數的限制(QPS)導致過載,修改/etc/origin/master/master-config.yaml 可以將QPSs設置成2倍或者4倍。

參考:

https://docs.openshift.com/container-platform/3.11/scaling_performance/host_practices.html#scaling-performance-capacity-host-practices-master

5.2 擴展集羣監控的Operator

OCP通過後端的cluster-monitoring-operator收集和存儲監控指標,在OCP 3.11中,集羣中缺省通過node-role.kubernetes.io/infra=true的參數支持,可以通過在inventory file中定義 openshift_cluster_monitoring_operator_node_selector 選擇相應的節點。

參考

https://docs.openshift.com/container-platform/3.11/scaling_performance/scaling_cluster_monitoring.html#scaling-performance-cluster-monitoring

6 監控和日誌

6.1 Prometheus cluster monitoring

OCP支持PrometheusCluster Monitoring並且目前已經加入到集羣功能中。

  • 基於Prometheus查詢和獲取集羣指標
  • 從預定義的告警中獲取通知,幫助通知客戶採取行動或者定位問題。
  • 查看預安裝的Grafana dashboard,展現etcd,cluster state和集羣健康信息等。參考

https://docs.openshift.com/container-platform/3.11/install_config/prometheus_cluster_monitoring.html#prometheus-cluster-monitoring

6.2 ELASTICSEARCH 5和KIBANA 5

Elasticsearch 5和kibana5已經支持,kibana的dashboard可以保存並在用戶間共享,es5 能更好利用資源同時性能增強。

7 開發體驗

7.1 CLI plug-ins(TechonologyPreview)

又稱爲plug-ins或二進制擴展,允許你擴展oc的命令和完成新的功能。

7.2 配置構建觸發器不用立刻觸發構建

支持在觸發構建前進行多個images stream的改動,當添加ImageChangeTrigger到BuildConfig中,可以設置paused屬性爲true,保證build不會立刻被觸發。參考

https://docs.openshift.com/container-platform/3.11/dev_guide/builds/triggering_builds.html#image-change-trigger

7.3 更靈活的使用configmap提供構建配置

有些場景需要密碼輸入或者其他配置信息輸入纔可以構建(build),目前可以通過input secrets和input ConfigMaps支持。參考

https://docs.openshift.com/container-platform/3.11/dev_guide/builds/build_inputs.html#dev-guide-build-inputs

7.4 KUBECTL

之前在master系統上支持kubectl,現在可以直接在oc client downloads中下載。

參考

https://access.redhat.com/downloads/content/290

8 註冊服務

8.1 Redhat註冊服務的配置

之前所有通過redhat container catalog的鏡像放在registry.access.redhat.com中,現在遷移到registry.redhat.io,新的地址在訪問鏡像的時候需要認證。參考:

https://docs.openshift.com/container-platform/3.11/architecture/infrastructure_components/image_registry.html#architecture-infrastructure-components-image-registry

9 Quay

9.1 RedHat Quay註冊

如果需要企業級的鏡像倉庫,你可以採用Quay作爲公有云服務或者安裝在你本地數據中心或者雲環境上的軟件,Quay包含的高級功能包括跨地域複製,鏡像掃描,鏡像回滾等。參考:

https://docs.openshift.com/container-platform/3.11/architecture/infrastructure_components/image_registry.html#architecture-infrastructure-components-image-registry

10 網絡

10.1 基於kuryr實現openstack和ocp更好的集成(TechnologyPreview)

10.2 Router(HAPROXY)增強

Table 2. Router (HAProxy) enhancements

Feature

Feature enhancements

Command syntax

HTTP/2

Implements HAProxy router HTTP/2 support (terminating at the router).

$ oc set env dc/router ROUTER_ENABLE_HTTP2=true

Performance

Increases the number of threads that can be used by HAProxy to serve more routes.

Scale down the default router and create a new router using two threads:2. $ oc scale dc/router --replicas=0$ oc adm router myrouter --threads=2 --images='openshift3/ose-haproxy-router:v3.x'Set a new thread count (for, example 7) for the HAProxy router:$ oc set env dc/myrouter ROUTER_THREADS=7

Dynamic changes

Implements changes to the HAProxy router without requiring a full router reload.

$ oc set env dc/router ROUTER_HAPROXY_CONFIG_MANAGER=true

Client SSL/TLS cert validation

Enables mTLS for route support of older clients/services that do not support SNI, but where certificate verification is a requirement.

$ oc adm router myrouter --mutual-tls-auth=optional --mutual-tls-auth-ca=/root/ca.pem --images="$image"

Logs captured by aggregated logging/EFK

Collects access logs so that Operators can see them.

Create a router with an rsyslog container:$ oc adm router myrouter --extended-logging --images='xxxx'Set the log level:$ oc set env dc/myrouter ROUTER_LOG_LEVEL=debugCheck the access logs in the rsyslog container:$ oc logs -f myrouter-x-xxxxx -c syslog

  1. Scale down the default router and create a new router using two threads:

2. $ oc scale dc/router --replicas=0 $ oc adm router myrouter --threads=2 --images='openshift3/ose-haproxy-router:v3.x'

  1. Set a new thread count (for, example 7) for the HAProxy router:

$ oc set env dc/myrouter ROUTER_THREADS=7Dynamic changesImplements changes to the HAProxy router without requiring a full router reload.$ oc set env dc/router ROUTER_HAPROXY_CONFIG_MANAGER=trueClient SSL/TLS cert validationEnables mTLS for route support of older clients/services that do not support SNI, but where certificate verification is a requirement.$ oc adm router myrouter --mutual-tls-auth=optional --mutual-tls-auth-ca=/root/ca.pem --images="$image"Logs captured by aggregated logging/EFKCollects access logs so that Operators can see them.

  1. Create a router with an rsyslog container:

$ oc adm router myrouter --extended-logging --images='xxxx'

  1. Set the log level:

$ oc set env dc/myrouter ROUTER_LOG_LEVEL=debug

  1. Check the access logs in the rsyslog container:

$ oc logs -f myrouter-x-xxxxx -c syslog

10.3 命名空間範圍的Egress IP的HA

針對項目/命名空間的Egress IP添加了基本的活動/備份HA,這樣一個命名空間可以在不同的集羣節點上部署多個egress IP

  1. Add two or more egress IPs to its netnamespace:

$ oc patch netnamespace myproject -p'{"egressIPs":["10.0.0.1","10.0.0.2"]}'

  1. Add the first egress IP to a node in the cluster:

# oc patch hostsubnet node1 -p '{"egressIPs":["10.0.0.1"]}'

  1. Add the second egress IP to a different node in the cluster:

# oc patch hostsubnet node2 -p'{"egressIPs":["10.0.0.2"]}'

參考

https://docs.openshift.com/container-platform/3.11/admin_guide/managing_networking.html#enabling-static-ips-for-external-project-traffic

10.4 命名空間Egress IP完全自動化

Egress IP支持完全自動化HA選項,項目可以自動分配Egress ip到集羣內的節點,這樣IP就可以從一個失敗的節點遷移到一個健康的節點。

步驟如下:

  1. Patch one of the cluster nodes with the egressCIDRs:

# oc patch hostsubnet node1 -p'{"egressCIDRs":["10.0.0.0/24"]}'

  1. Create a project/namespace and add a single egress IP to its netnamespace:

# oc patch netnamespace myproject -p'{"egressIPs":["10.0.0.1"]}'

10.5 可以配置的VXLAN端口

OCP SDN 覆蓋VXLAN端口目前支持配置(缺省是4789),配置方法如下:

  1. Modify the VXLAN port in master-config.yaml with the new port number (for example, 4889 instead of 4789):

vxlanPort: 4889

  1. Delete clusternetwork and restart the master API and controller:

$ oc delete clusternetwork default

$ master-restart api controllers

  1. Restart all SDN pods in the openshift-sdn project:

$ oc delete pod -n openshift-sdn -l app=sdn

  1. Allow the new port on the firewall on all nodes:

# iptables -i OS_FIREWALL_ALLOW -p udp -m state --stateNEW -m udp --dport 4889 -j ACCEPT

11 Master

11.1 Pod優先級

支持Pod優先級的定義,Pod優先意味着某個Pod相對於其他Pod的重要性,Podpreemption允許集羣在符合條件的節點上優先調度高優先級別的Pod,Pod優先級影響調度順序和因爲資源不夠消亡的順序。參考

https://docs.openshift.com/container-platform/3.11/admin_guide/scheduling/priority_preemption.html#admin-guide-priority-preemption

11.2 Descheduler(Technology Preview)

Descheduler將pod從不滿足條件的節點遷移到新的節點,Pod遷移的原因包括:

  • 一些節點超過負荷
  • 原有的調度策略條件並不滿足,比如新的label添加到節點,pod/node的親和性條件不再滿足。
  • 一些節點失敗,Pod遷移到其他節點
  • 新的節點加入集羣。

參考

https://docs.openshift.com/container-platform/3.11/admin_guide/scheduling/descheduler.html#admin-guide-descheduler

11.3 Podman( Technology Preview)

Podman是一個無需daemon的CLI/API用於管理,運行,Debug OCI容器和Pod.

11.4 節點問題檢測器(Technology Preview)

節點問題檢測器監控節點的健康並把這些問題發送到API Server,他是一個daemon進程以一個DaemonSet運行在每一個節點上,他檢測節點問題並使得有問題的節點不再調度,當你啓動節點問題檢測器,需要指定一個進行廣播的端口,節點問題檢測器允許你裝載子daemon進程用於數據收集,目前有3個子daemon,發現的問題歸類爲NodeCondition

  • Kernel Monitor:基於journald的核心日誌監控並且通過模式匹配發現問題
  • AbrtAdaptor:從journald中監控節點的內核問題和應用crash
  • CustomerPluginMonitor: 允許你定義任何條件,返回0,1

參考:

https://docs.openshift.com/container-platform/3.11/admin_guide/node_problem_detector.html#admin-guide-node-problem-detector

11.5 集羣自動擴展(只支持AWS)

支持配置auto-scaler提供在aws上基於工作負載進行自動擴展的功能。

12 Web管理控制檯

12.1 集羣管理控制檯

OCP 3.11包含了集羣管理的控制檯。

用戶可以基於他們的角色和技術背景可以選擇管理控制檯

  • 管理員有CaaS的經驗並且對Kubernetes比較熟悉,可以選擇Cluster Console
  • 應用開發人員有PaaS的經驗,同時有Openshift的基礎知識.可選擇Application Console.

12.2 節點可見

OCP針對集羣節點的管理和分析有一些擴展功能,包括:

  • 節點的狀態事件的分析
  • 在每個節點上運行node-exporter的DaemonSet,收取一些預定義的指標
  • 指標基於RBAC進行權限保護
  • 只要有cluster-reader權限就可以看到指標

12.3 容器即服務

可以查看,編輯和刪除下面的Kubernetes對象

  • Networking
    • Routes and ingress
  • Storage
    • PVs and PV claims
    • Storage classes
  • Admin
    • Projects and namespaces
    • Nodes
    • Roles and RoleBindings
    • CustomResourceDefinition (CRD)

12.4 訪問控制管理

OCP 3.11提供了集羣RBAC權限和rolebindings的圖形化界面,允許你

  • 基於角色找到用戶和服務賬號
  • 查看集羣範圍內或者命名空間內的binding
  • 可視化查看角色和對象

項目管理員可以自己管理命名空間內的角色和bindings.

12.5 集羣事件流

集羣事件流主要提供以下指標:

  • 任何人訪問任何命名空間的事件
  • 所有的項目查看者訪問的命名空間
  • 基於對象類型和種類的過濾

13 安全

13.1 Github Enterprise 填加作爲認證提供方

Github Enterprise目前可以作爲認證提供方,OAuth使用OCP和GitHub或者GitHub Enterprise的令牌交換,可以使用OCP和Github的集成功能連接到GitHub或者GitHub Enteprise.

13.2 支持windows SSPI連接(Technology Preview)

Oc的安全支持提供商目前允許windows的單點登錄,如果你在OCP中使用GSSAPI-enable的代理連接到Active Directory Server,在使用oc命令行的時候,可以自動的從加入域的windows主機獲取認證信息。

參考

https://docs.openshift.com/container-platform/3.11/install_config/configuring_authentication.html#GitHub

14 微服務

14.1 Redhat openshift servicemesh(technology preview)

Redhat openshift service mesh針對服務網絡提供了洞察和操作的控制,提供一個統一的方式去連接,安全和監控微服務應用。

基於開源的Istio項目,RedhatOpenshift Service Mesh無縫集成了現有的分佈式應用,不需要服務代碼層面的任何改動。

參考

https://docs.openshift.com/container-platform/3.11/servicemesh-install/servicemesh-install.html#product-overview

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章