Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Service Fabric 托管群集中的每个节点类型都受虚拟机规模集的支持。 这使你能够将虚拟机规模集扩展添加到 Service Fabric 托管群集节点类型。 扩展是小型应用程序,用于在 Azure VM 上提供部署后配置和自动化。 Azure 平台可承载许多扩展,涵盖 VM 配置、监视、安全性和实用工具应用程序。 发布者将某个应用程序封装为扩展程序,并简化安装过程。 你只需提供必需的参数。
添加虚拟机规模集扩展
可以使用 Add-AzServiceFabricManagedNodeTypeVMExtension PowerShell 命令将虚拟机规模集扩展添加到 Service Fabric 托管群集节点类型。
或者,可以在 Azure 资源管理器模板的 Service Fabric 托管群集节点类型上添加虚拟机规模集扩展,例如:
{
"type": "Microsoft.ServiceFabric/managedclusters/nodetypes",
"apiVersion": "[variables('sfApiVersion')]",
"name": "[concat(parameters('clusterName'), '/', parameters('nodeTypeName'))]",
"dependsOn": [
"[concat('Microsoft.ServiceFabric/managedclusters/', parameters('clusterName'))]"
],
"location": "[resourceGroup().location]",
"properties": {
"isPrimary": true,
...
"vmExtensions": [
{
"name": "KvExtension",
"properties": {
"publisher": "Microsoft.Azure.KeyVault",
"type": "KeyVaultForWindows",
"typeHandlerVersion": "3.0",
"autoUpgradeMinorVersion": true,
"settings": {
"secretsManagementSettings": {
"observedCertificates": [
...
]
}
}
}
}
]
}
}
有关配置 Service Fabric 托管群集节点类型的详细信息,请参阅托管群集节点类型。
如何在 Service Fabric 运行时之前进行预配
要在 Service Fabric 运行时启动之前预配扩展,可以根据需要将setupOrder参数与每个扩展的扩展属性中的值BeforeSFRuntime结合使用。 这样,可以在运行时和应用程序开始在节点上运行之前设置环境和依赖项。 有关说明,请参阅以下示例:
注释
必须注意,如果标记为BeforeSFRuntime的扩展失败,它将阻止 Service Fabric 运行时启动。 因此,从 Service Fabric 角度来看,节点将关闭。 因此,必须保持这些扩展配置正确,并及时解决可能出现的任何问题,以确保群集中的节点的运行状况。
要求
使用 Service Fabric API 版本 2023-09-01-preview 或更高版本。
ARM 模板示例:
{
"type": "Microsoft.ServiceFabric/managedclusters/nodetypes",
"apiVersion": "2023-09-01-preview",
"name": "[concat(parameters('clusterName'), '/', parameters('nodeTypeName'))]",
"properties": {
"isPrimary": true,
...
"vmExtensions": [
{
"name": "KvExtension",
"properties": {
"setupOrder": [
"BeforeSFRuntime"
],
"provisionAfterExtensions" [ "GenevaMonitoringExtension" ],
"publisher": "Microsoft.Azure.KeyVault",
"type": "KeyVaultForWindows",
"typeHandlerVersion": "3.0",
"autoUpgradeMinorVersion": true,
"settings": {
"secretsManagementSettings": {
"observedCertificates": [
...
]
}
}
}
},
{
"name": "GenevaMonitoringExtension",
"properties": {
"setupOrder": [
"BeforeSFRuntime"
],
"autoUpgradeMinorVersion": true,
"enableAutomaticUpgrade": true,
"publisher": "Microsoft.Azure.Geneva",
"type": "GenevaMonitoring",
"typeHandlerVersion": "2.40",
"settings": {
"configurations": [
{
"ServiceArguments": {
...
},
"UserArguments": {
...
}
}
]
}
}
}
]
}
}
注释
AzureDiskEncryption (ADE) 扩展的特殊处理:ADE 需要在 Service Fabric 运行时之前运行,以确保磁盘在重置映像操作后解密,从而允许 Service Fabric 运行时使用它启动。 即使扩展未用BeforeSFRuntime显式标记,它也会在运行时之前运行。 但请注意,建议在主机上启用加密,而不是使用 ADE 扩展。 有关详细说明,请参阅在主机上启用加密。
后续步骤
若要详细了解 Service Fabric 托管群集,请参阅: