首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Openshift 3.11的14大新功能详解

Openshift 3.11的14大新功能详解

作者头像
魏新宇
发布2018-12-13 09:53:38
4.2K0
发布2018-12-13 09:53:38
举报

聂健是大魏的红帽同事,本文已获得授权转载,欢迎读者阅读他的技术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

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-11-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 大魏分享 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1 Operator
    • 1.1 Operator生命周期管理(Technology Preview)
      • 1.2 Operator SDK
      • 2 Broker
        • 2.1 和ansible galaxy集成的Automation Broker
          • 2.2 支持认证的Registry的Broker
            • 2.3 服务目录命名空间的Broker
            • 3 安装和升级
              • 3.1 升级过程中检查过期的认证
                • 3.2 支持Ansible 2.6
                  • 3.3 需要注册服务的认证密码
                    • 3.4 客户的安装过程记日志
                    • 4 存储
                      • 4.1 容器存储接口(Technology Preview)
                        • 4.2 本地临时存储的保护(Technology Preview)
                          • 4.3 使用Openstack Manila供应PV(Technology Preview)
                            • 4.4 PV Resize
                              • 4.5 基于租户的存储快照(Technology Preview)
                              • 5 扩展
                                • 5.1 Cluster Limits
                                  • 5.2 扩展集群监控的Operator
                                  • 6 监控和日志
                                    • 6.1 Prometheus cluster monitoring
                                      • 6.2 ELASTICSEARCH 5和KIBANA 5
                                      • 7 开发体验
                                        • 7.1 CLI plug-ins(TechonologyPreview)
                                          • 7.2 配置构建触发器不用立刻触发构建
                                            • 7.3 更灵活的使用configmap提供构建配置
                                              • 7.4 KUBECTL
                                              • 8 注册服务
                                                • 8.1 Redhat注册服务的配置
                                                • 9 Quay
                                                  • 9.1 RedHat Quay注册
                                                  • 10 网络
                                                    • 10.1 基于kuryr实现openstack和ocp更好的集成(TechnologyPreview)
                                                      • 10.2 Router(HAPROXY)增强
                                                        • 10.3 命名空间范围的Egress IP的HA
                                                          • 10.4 命名空间Egress IP完全自动化
                                                            • 10.5 可以配置的VXLAN端口
                                                            • 11 Master
                                                              • 11.1 Pod优先级
                                                                • 11.2 Descheduler(Technology Preview)
                                                                  • 11.3 Podman( Technology Preview)
                                                                    • 11.4 节点问题检测器(Technology Preview)
                                                                      • 11.5 集群自动扩展(只支持AWS)
                                                                      • 12 Web管理控制台
                                                                        • 12.1 集群管理控制台
                                                                          • 12.2 节点可见
                                                                            • 12.3 容器即服务
                                                                              • 12.4 访问控制管理
                                                                                • 12.5 集群事件流
                                                                                • 13 安全
                                                                                  • 13.1 Github Enterprise 填加作为认证提供方
                                                                                    • 13.2 支持windows SSPI连接(Technology Preview)
                                                                                    • 14 微服务
                                                                                      • 14.1 Redhat openshift servicemesh(technology preview)
                                                                                      相关产品与服务
                                                                                      容器服务
                                                                                      腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
                                                                                      领券
                                                                                      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档