5.2.2. Azure 上 Windows MachineSet 对象的 YAML 示例


此 YAML 示例定义了一个在 Microsoft Azure 上运行的 Windows MachineSet 对象,Windows Machine Config Operator(WMCO)可以响应。

apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
  labels:
    machine.openshift.io/cluster-api-cluster: <infrastructure_id> 
1

  name: <windows_machine_set_name> 
2

  namespace: openshift-machine-api
spec:
  replicas: 1
  selector:
    matchLabels:
      machine.openshift.io/cluster-api-cluster: <infrastructure_id> 
3

      machine.openshift.io/cluster-api-machineset: <windows_machine_set_name> 
4

  template:
    metadata:
      labels:
        machine.openshift.io/cluster-api-cluster: <infrastructure_id> 
5

        machine.openshift.io/cluster-api-machine-role: worker
        machine.openshift.io/cluster-api-machine-type: worker
        machine.openshift.io/cluster-api-machineset: <windows_machine_set_name> 
6

        machine.openshift.io/os-id: Windows 
7

    spec:
      metadata:
        labels:
          node-role.kubernetes.io/worker: "" 
8

      providerSpec:
        value:
          apiVersion: azureproviderconfig.openshift.io/v1beta1
          credentialsSecret:
            name: azure-cloud-credentials
            namespace: openshift-machine-api
          image: 
9

            offer: WindowsServer
            publisher: MicrosoftWindowsServer
            resourceID: ""
            sku: 2019-Datacenter-with-Containers
            version: latest
          kind: AzureMachineProviderSpec
          location: <location> 
10

          managedIdentity: <infrastructure_id>-identity 
11

          networkResourceGroup: <infrastructure_id>-rg 
12

          osDisk:
            diskSizeGB: 128
            managedDisk:
              storageAccountType: Premium_LRS
            osType: Windows
          publicIP: false
          resourceGroup: <infrastructure_id>-rg 
13

          subnet: <infrastructure_id>-worker-subnet
          userDataSecret:
            name: windows-user-data 
14

            namespace: openshift-machine-api
          vmSize: Standard_D2s_v3
          vnet: <infrastructure_id>-vnet 
15

          zone: "<zone>" 
16
Copy to Clipboard
1 3 5 11 12 13 15
指定基于置备集群时所设置的集群 ID 的基础架构 ID。您可以运行以下命令来获取基础架构 ID:
$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
Copy to Clipboard
2 4 6
指定 Windows 机器集名称。Azure 上的 Windows 机器名称不能超过 15 个字符。因此,由于机器名称的生成方式,机器集名称不能超过 9 个字符。
7
将机器配置为 Windows 机器。
8
将 Windows 节点配置为计算机器。
9
指定一个 WindowsServer 镜像,它定义了 2019-Datacenter-with-Containers SKU,并带有版本 17763.1457.2009030514 或更早版本。
10
指定 Azure 区域,如 centralus
14
由 WMCO 配置第一个 Windows 机器时创建的。之后,所有后续机器组都可以使用 windows-user-data
16
指定您所在地区(region)内要放置机器的区域 (zone) 。确保您的地区支持您指定的区域。
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat