订阅内容

Imagine you're responsible for maintaining an OpenShift cluster on a VMware vSphere environment. Suddenly, some of your VMware ESXi hypervisors fail, and your entire cluster goes down. The downtime costs your organization time and money, not to mention the headache of getting everything back up and running. What if there was a way to eliminate these single points of failure and keep your OpenShift cluster up and running, even in the face of disaster? With a new feature introduced in OpenShift 4.13, you can do just that. Keep reading to learn how this game-changing feature enhances your OpenShift deployment.

Distribute OpenShift nodes across vSphere Data Centers and Clusters

To properly distribute your OpenShift cluster across vSphere data centers and vSphere clusters in a single VMware vCenter, we use OpenShift with regions and zones, and to do that we can now use vSphere Data Centers and Clusters. Here’s how:

  • Regions: A region is defined as a vSphere Data Center that has an attached tag. This tag must be part of the openshift-region tag category.
  • Zones: A zone is defined as a vSphere Cluster that has an attached tag. Like regions, the tag used for zones must be part of the openshift-zone tag category.

To map OpenShift regions and zones to vSphere Data Centers and Clusters, you create in OpenShift a failure domain, which groups vSphere resources.

For example, let’s say you want to define the regions “dc-east”, “dc-west”, and “dc-north” as the vSphere Data Centers “datacenter1”, “datacenter2”, and “datacenter3”, and then have in them the zones  “east-1a”, “west-1a”, and “north-1a” respectively.

Then, in each vSphere data center you want your failure domain to remain within the vSphere clusters named “cluster1” in each vSphere data center.

Let’s see this graphically:

4.13 Blog

You want to distribute your master and worker nodes in 3 failure domains, called “dc-east-1”, “dc-west-1”, and “dc-north-1”, that represent the above constructs.

Adding the configuration

Now we need some way to associate these vSphere Data Center and Cluster names to OpenShift regions and zones in vSphere, for which we will use vCenter tags with a vmware tool called “govc”:

# Create the tag categories
govc tags.category.create -d "OpenShift region" openshift-region
govc tags.category.create -d "OpenShift zone" openshift-zone
# Create the region tags
govc tags.create -c openshift-region dc-east
govc tags.create -c openshift-region dc-west
govc tags.create -c openshift-region dc-north
# Create the zone tags
govc tags.create -c openshift-zone east-1a
govc tags.create -c openshift-zone west-1a
govc tags.create -c openshift-zone north-1a
# Attach the region tags to vCenter datacenters
govc tags.attach -c openshift-region dc-east /datacenter1
govc tags.attach -c openshift-region dc-west /datacenter2
govc tags.attach -c openshift-region dc-north /datacenter3
# Attach the zone tags to vCenter clusters
govc tags.attach -c openshift-zone east-1a /datacenter1/cluster1
govc tags.attach -c openshift-zone west-1a /datacenter2/cluster1
govc tags.attach -c openshift-zone north-1a /datacenter3/cluster1

 

And once that’s done, define your logical failure domains in your install-config.yaml file:

apiVersion: v1                                                                                                                                                                                 
baseDomain: devcluster.openshift.com                                                                                                                                                      
metadata:                                                                                                                                                                                    
name: mycluster
controlPlane:                                                                                                                                                                                
name: master                                                                                                                                                                                
replicas: 3
platform:
  vsphere:
    zones:
    - "dc-east-1"
    - "dc-west-1"
    - "dc-north-1"                                                                                                                                                                                  
compute:                                                                                                                                                                                      
- name: worker                                                                                                                                                                                
replicas: 3
platform:
  vsphere:
    zones:
    - "dc-east-1"
    - "dc-west-1"
    - "dc-north-1"                                                                                                                                                                                    
platform:
vSphere:
  vcenters: []
  failureDomains:
    - name: dc-east-1
      region: dc-east
      zone: east-1a
      server: myvcenter.devcluster.openshift.com
      topology:
        datacenter: datacenter1
        computeCluster: /datacenter1/cluster1
        networks:
          - my-port-group-in-dc1
        datastore: /datacenter1/datastore/share1
    - name: dc-west-1
      region: dc-west
      zone: west-1a
      server: myvcenter.devcluster.openshift.com
      topology:
        datacenter: datacenter2
        computeCluster: /datacenter2/cluster1
        networks:
          - my-port-group-in-dc2
        datastore: /datacenter2/datastore/share1
    - name: dc-north-1
      region: dc-north
      zone: north-1a
      server: myvcenter.devcluster.openshift.com
      topology:
        datacenter: datacenter3
        computeCluster: /datacenter3/cluster1
        networks:
          - my-port-group-in-dc3
        datastore: /datacenter3/datastore/share1

 

In Summary

By using regions and zones, you distribute OpenShift nodes across multiple VMware vSphere clusters and datacenters in a single VMware vCenter, reducing the risk of downtime in the event of a failure. With this feature, you can be sure your OpenShift cluster is highly available and more resilient, providing peace of mind for you and your organization. Keep reading to learn how to implement this feature and improve your OpenShift deployment on VMware vSphere.


关于作者

UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Original series icon

原创节目

关于企业技术领域的创客和领导者们有趣的故事