Краткое руководство. Настройка узла службы Kubernetes Azure на Azure Stack ХЦИ с помощью PowerShellQuickstart: Set up an Azure Kubernetes Service host on Azure Stack HCI using PowerShell
Область применения: Azure Stack ХЦИ, Windows Server 2019 DatacenterApplies to: Azure Stack HCI, Windows Server 2019 Datacenter
В этом кратком руководстве вы узнаете, как настроить узел службы Azure Kubernetes с помощью PowerShell.In this quickstart, you'll learn how to set up an Azure Kubernetes Service host using PowerShell. Чтобы вместо этого использовать центр администрирования Windows, см. раздел Настройка с помощью центра администрирования Windows.To instead use Windows Admin Center, see Set up with Windows Admin Center.
Перед началом работыBefore you begin
Убедитесь, что у вас есть одно из следующих:Make sure you have one of the following:
- 2-4 узел Azure Stack кластер ХЦИ2-4 node Azure Stack HCI cluster
- Отказоустойчивый кластер Windows Server 2019 DatacenterWindows Server 2019 Datacenter failover cluster
- Windows Server 2019 Datacenter для одного узлаSingle node Windows Server 2019 Datacenter
Прежде чем приступить к работе, убедитесь, что выполнены все необходимые условия на странице требования к системе .Before getting started, make sure you have satisfied all the prerequisites on the system requirements page. Рекомендуется использовать узел 2-4 Azure Stack кластер ХЦИ.We recommend having a 2-4 node Azure Stack HCI cluster. Если у вас нет какого-либо из указанных выше инструкций, следуйте инструкциям на странице регистрации Azure Stack хЦи.If you don't have any of the above, follow instructions on the Azure Stack HCI registration page.
Важно!
При удалении службы Azure Kubernetes на Azure Stack ХЦИ см. статью Удаление службы Kubernetes Azure на Azure Stack хЦи и внимательно следуйте инструкциям.When removing Azure Kubernetes Service on Azure Stack HCI, see Remove Azure Kubernetes Service on Azure Stack HCI and carefully follow the instructions.
Шаг 1. Скачайте и установите модуль PowerShell АкшЦиStep 1: Download and install the AksHci PowerShell module
Скачайте AKS-HCI-Public-Preview-Dec-2020
страницу из службы Azure Kubernetes на странице регистрации Azure Stack хЦи.Download the AKS-HCI-Public-Preview-Dec-2020
from the Azure Kubernetes Service on Azure Stack HCI registration page. ZIP-файл AksHci.Powershell.zip
содержит модуль PowerShell.The zip file AksHci.Powershell.zip
contains the PowerShell module.
Если вы ранее установили службу Kubernetes Azure на Azure Stack ХЦИ с помощью PowerShell или центра администрирования Windows, то для нового модуля PowerShell существует два потока установки:If you have previously installed Azure Kubernetes Service on Azure Stack HCI using PowerShell or Windows Admin Center, there are two installation flows for the new PowerShell module:
- Выполните чистую установку модуля PowerShell, чтобы начать с чистой системы и удалить ранее развернутые рабочие нагрузки.Perform a clean installation of the PowerShell module, so you start with a clean system and your previously deployed workloads are removed. Чтобы выполнить чистую установку, перейдите к шагу 1,1.To perform a clean installation, go to Step 1.1.
- Обновите модуль PowerShell, если хотите, чтобы система и рабочие нагрузки оставались на месте.Upgrade the PowerShell module if you want to keep your system and workloads in place. Чтобы обновить модуль PowerShell, перейдите к шагу 1,2.To upgrade the PowerShell module, go to Step 1.2.
Шаг 1,1. Чистая установка модуля PowerShell для АкшЦиStep 1.1: Clean install of the AksHci PowerShell module
Перед продолжением выполните следующую команду.Run the following command before proceeding.
Uninstall-AksHci
Закройте все окна PowerShell.Close all PowerShell windows. Удалите все существующие каталоги для АкшЦи, АкшЦи. UI, MOC и MSK8sDownloadAgent, расположенные по пути %systemdrive%\program files\windowspowershell\modules
.Delete any existing directories for AksHci, AksHci.UI, MOC, and MSK8sDownloadAgent located in the path %systemdrive%\program files\windowspowershell\modules
. После удаления существующих каталогов можно извлечь содержимое нового ZIP-файла.Once the existing directories are deleted, you can extract the contents of the new zip file. Обязательно извлеките ZIP-файл в нужное расположение ( %systemdrive%\program files\windowspowershell\modules
).Make sure to extract the zip file in the correct location (%systemdrive%\program files\windowspowershell\modules
). Затем выполните следующие команды.Then, run the following commands.
Import-Module AksHci
Закройте все окна PowerShell еще раз и снова откройте административный сеанс, а затем перейдите к шагу 1,3. Проверка обновленного модуля PowerShell.Close all PowerShell windows again and reopen an administrative session and proceed to Step 1.3 - Validate upgraded PowerShell module.
Шаг 1,2. обновление модуля PowerShell для АкшЦиStep 1.2: Upgrade the AksHci PowerShell module
Закройте все окна PowerShell.Close all PowerShell windows. Удалите все существующие каталоги для АкшЦи, АкшЦи. UI, MOC и MSK8sDownloadAgent, расположенные по пути %systemdrive%\program files\windowspowershell\modules
.Delete any existing directories for AksHci, AksHci.UI, MOC, and MSK8sDownloadAgent located in the path %systemdrive%\program files\windowspowershell\modules
. После удаления этих каталогов можно извлечь содержимое нового ZIP-файла.Once these directories are removed, you can extract the contents of the new zip file. Обязательно извлеките ZIP-файл в нужное расположение ( %systemdrive%\program files\windowspowershell\modules
).Make sure to extract the zip file in the correct location (%systemdrive%\program files\windowspowershell\modules
). Затем выполните следующие команды.Then, run the following commands.
Import-Module AksHci
После выполнения приведенных выше команд закройте все окна PowerShell и повторно откройте сеанс администрирования, чтобы проверить обновление модуля PowerShell, как описано ниже, а затем выполните Update-AksHci
команду, как указано далее в документе.After running the above commands, close all PowerShell windows and reopen an administrative session to validate PowerShell module upgrade as detailed below and then run the Update-AksHci
command as instructed later in the document.
Шаг 1,3. Проверка обновленного модуля PowerShellStep 1.3: Validate upgraded PowerShell module
Закройте все окна PowerShell и повторно откройте новый сеанс администрирования, чтобы проверить наличие последней версии модуля PowerShell.Close all PowerShell windows and reopen a new administrative session to check if you have the latest version of the PowerShell module.
Get-Command -Module AksHci
Выходные данные:Output:
CommandType Name Version Source
----------- ---- ------- ------
Alias Initialize-AksHciNode 0.2.12 AksHci
Function Get-AksHciCluster 0.2.12 AksHci
Function Get-AksHciConfig 0.2.12 AksHci
Function Get-AksHciCredential 0.2.12 AksHci
Function Get-AksHciKubernetesVersion 0.2.12 AksHci
Function Get-AksHciLogs 0.2.12 AksHci
Function Get-AksHciUpdates 0.2.12 AksHci
Function Get-AksHciVersion 0.2.12 AksHci
Function Get-AksHciVmSize 0.2.12 AksHci
Function Install-AksHci 0.2.12 AksHci
Function Install-AksHciAdAuth 0.2.12 AksHci
Function Install-AksHciArcOnboarding 0.2.12 AksHci
Function New-AksHciCluster 0.2.12 AksHci
Function Remove-AksHciCluster 0.2.12 AksHci
Function Restart-AksHci 0.2.12 AksHci
Function Set-AksHciClusterNodeCount 0.2.12 AksHci
Function Set-AksHciConfig 0.2.12 AksHci
Function Uninstall-AksHci 0.2.12 AksHci
Function Uninstall-AksHciAdAuth 0.2.12 AksHci
Function Uninstall-AksHciArcOnboarding 0.2.12 AksHci
Function Update-AksHci 0.2.12 AksHci
Function Update-AksHciCluster 0.2.12 AksHci
Шаг 2. Подготовка компьютеров к развертываниюStep 2: Prepare your machine(s) for deployment
Выполните проверки на каждом физическом узле, чтобы узнать, удовлетворяют ли все требования для установки службы Kubernetes Azure на Azure Stack ХЦИ.Run checks on every physical node to see if all the requirements are satisfied to install Azure Kubernetes Service on Azure Stack HCI.
Откройте PowerShell с правами администратора и выполните следующую команду.Open PowerShell as an administrator and run the following command.
Initialize-AksHciNode
После завершения проверки вы увидите, что текст "Готово" отображается зеленым текстом.When the checks are finished, you'll see "Done" displayed in green text.
Шаг 3. Настройка развертыванияStep 3: Configure your deployment
Задайте параметры конфигурации для узла службы Azure Kubernetes.Set the configuration settings for the Azure Kubernetes Service host. При развертывании на 2-4 узле Azure Stack кластере ХЦИ или в отказоустойчивом кластере Windows Server 2019 Datacenter необходимо указать imageDir
cloudConfigLocation
Параметры и.If you're deploying on a 2-4 node Azure Stack HCI cluster or a Windows Server 2019 Datacenter failover cluster, you must specify the imageDir
and cloudConfigLocation
parameters. Для одного узла Windows Server 2019 Datacenter все параметры являются необязательными и устанавливаются в значения по умолчанию.For a single node Windows Server 2019 Datacenter, all parameters are optional and set to their default values. Однако для оптимальной производительности рекомендуется использовать узел 2-4 Azure Stack хЦи развертывание кластера.However, for optimal performance, we recommend using a 2-4 node Azure Stack HCI cluster deployment.
Настройте развертывание с помощью следующей команды.Configure your deployment with the following command.
Set-AksHciConfig [-imageDir <String>]
[-cloudConfigLocation <String>]
[-nodeConfigLocation <String>]
[-vnetName <String>]
[-controlPlaneVmSize <VmSize>]
[-loadBalancerVmSize <VmSize>]
[-sshPublicKey <String>]
[-vipPoolStartIp <String>]
[-vipPoolEndIp <String>]
[-macPoolStart <String>]
[-macPoolEnd <String>]
[-vlanID <int>]
[-kvaLoadBalancerType {unstacked_haproxy, stacked_kube_vip}]
[-kvaControlPlaneEndpoint <String>]
[-proxyServerHTTP <String>]
[-proxyServerHTTPS <String>]
[-proxyServerNoProxy <String>]
[-proxyServerCredential <PSCredential>]
[-cloudServiceCidr <String>]
[-workingDir <String>]
[-version <String>]
[-vnetType <String>]
[-nodeAgentPort <int>]
[-nodeAgentAuthorizerPort <int>]
[-clusterRoleName <String>]
[-cloudLocation <String>]
[-skipHostLimitChecks]
[-insecure]
[-skipUpdates]
[-forceDnsReplication]
ПримерExample
Развертывание в кластере 2-4 узлов с помощью сети DHCP:To deploy on a 2-4 node cluster with DHCP networking:
Set-AksHciConfig -imageDir c:\clusterstorage\volume1\Images -cloudConfigLocation c:\clusterstorage\volume1\Config
Для развертывания с использованием пула виртуальных IP-адресов выполните следующие действия.To deploy with a virtual IP pool:
Set-AksHciConfig -imageDir c:\clusterstorage\volume1\Images -cloudConfigLocation c:\clusterstorage\volume1\Config -vipPoolStartIp 10.0.0.20 -vipPoolEndIp 10.0.0.80
Для развертывания с stacked_kube_vip
подсистемой балансировки нагрузки выполните следующие действия.To deploy with stacked_kube_vip
load balancer:
Set-AksHciConfig -imageDir c:\clusterstorage\volume1\Images -cloudConfigLocation c:\clusterstorage\volume1\Config -kvaLoadBalancerType stacked_kube_vip -kvaControlPlaneEndpoint 10.0.1.10
Для развертывания с помощью прокси-сервера выполните следующие действия.To deploy with a proxy server:
Set-AksHciConfig -imageDir c:\clusterstorage\volume1\Images -cloudConfigLocation c:\clusterstorage\volume1\Config -proxyServerHttp "http://proxy.contoso.com:8888" -proxyServerHttps "http://proxy.contoso.com:8888" -proxyServerNoProxy "localhost,127.0.0.1,.svc,10.96.0.0/12,10.244.0.0/16,10.231.110.0/24,10.68.237.0/24" -proxyServerCredential $credential
Необязательные параметрыOptional parameters
-imageDir
Путь к каталогу, в котором служба Kubernetes Azure на Azure Stack ХЦИ будет хранить свои образы VHD.The path to the directory where Azure Kubernetes Service on Azure Stack HCI will store its VHD images. По умолчанию используется %systemdrive%\AksHciImageStore
для развертываний с одним узлом.Defaults to %systemdrive%\AksHciImageStore
for single node deployments. Для развертываний с несколькими узлами этот параметр должен быть указан.For multi-node deployments, this parameter must be specified. Путь должен указывать на путь к общему хранилищу, например, C:\ClusterStorage\Volume2\ImageStore
или общую папку SMB, например \\FileShare\ImageStore
.The path must point to a shared storage path such as C:\ClusterStorage\Volume2\ImageStore
or an SMB share such as \\FileShare\ImageStore
.
-cloudConfigLocation
Расположение, в котором будет храниться конфигурация облачного агента.The location where the cloud agent will store its configuration. По умолчанию используется %systemdrive%\wssdcloudagent
для развертываний с одним узлом.Defaults to %systemdrive%\wssdcloudagent
for single node deployments. Расположение может быть таким же, как и путь, указанный -imageDir
выше.The location can be the same as the path of -imageDir
above.Для развертываний с несколькими узлами этот параметр должен быть указан. For *multi-node deployments, this parameter must be specified*. Путь должен указывать на путь к общему хранилищу, например, C:\ClusterStorage\Volume2\ImageStore
или общую папку SMB, например \\FileShare\ImageStore
.The path must point to a shared storage path such as C:\ClusterStorage\Volume2\ImageStore
or an SMB share such as \\FileShare\ImageStore
. Расположение должно находиться в общей папке высокой надежности, чтобы хранилище всегда было доступно.The location needs to be on a highly available share so that the storage will always be accessible.
-nodeConfigLocation
Расположение, в котором агенты узла будут хранить свою конфигурацию.The location where the node agents will store their configuration. Каждый узел имеет агент узла, поэтому его конфигурация является локальной для него.Every node has a node agent, so its configuration is local to it. Это расположение должно быть локальным путем.This location must be a local path. По умолчанию принимает значение %systemdrive%\programdata\wssdagent
для всех развертываний.Defaults to %systemdrive%\programdata\wssdagent
for all deployments.
-vnetName
Имя виртуального коммутатора, к которому нужно подключить виртуальные машины.The name of the virtual switch to connect the virtual machines to. Если у вас уже есть внешний коммутатор, следует передать здесь имя параметра.If you already have an external switch on the host, you should pass the name of the switch here. Если этот параметр не существует, он будет создан.The switch will be created if it does not exist.По умолчанию используется имя external. Defaults to “External” name.
-controlPlaneVmSize
Размер виртуальной машины, создаваемой для плоскости управления.The size of the VM to create for the control plane. Чтобы получить список доступных размеров виртуальных машин, выполните команду Get-AksHciVmSize
.To get a list of available VM sizes, run Get-AksHciVmSize
.
-loadBalancerVmSize
Размер виртуальной машины, создаваемой для Load Balancer виртуальных машин.The size of the VM to create for the Load Balancer VMs. Чтобы получить список доступных размеров виртуальных машин, выполните команду Get-AksHciVmSize
.To get a list of available VM sizes, run Get-AksHciVmSize
.
-sshPublicKey
Путь к файлу открытого ключа SSH.Path to an SSH public key file. С помощью этого открытого ключа вы сможете войти на любую виртуальную машину, созданную службой Kubernetes Azure, в развертывании Azure Stack ХЦИ.Using this public key, you will be able to log in to any of the VMs created by the Azure Kubernetes Service on Azure Stack HCI deployment. Если у вас есть собственный открытый ключ SSH, его расположение будет передано здесь.If you have your own SSH public key, you will pass its location here. Если ключ не указан, мы будем искать его %systemdrive%\akshci\.ssh\akshci_rsa.pub
.If no key is provided, we will look for one under %systemdrive%\akshci\.ssh\akshci_rsa.pub
. Если файл не существует, будет создана и использована пара ключей SSH в указанном выше расположении.If the file does not exist, an SSH key pair in the above location will be generated and used.
-vipPoolStartIp
При использовании пулов виртуальных IP-адресов для развертывания этот параметр указывает сетевой запуск пула.When using VIP pools for your deployment, this parameter specifies the network start of the pool. Пулы виртуальных IP-адресов следует использовать для долгосрочных развертываний, чтобы гарантировать согласованность пула.You should use VIP pools for long-lived deployments to guarantee that a pool of IP addresses remain consistent. Это полезно при наличии рабочих нагрузок, которые всегда должны быть доступны.This is useful when you have workloads that always need to be reachable. Значение по умолчанию — none (Отсутствует).Default is none.
-vipPoolEndIp
При использовании пулов виртуальных IP-адресов для развертывания этот параметр указывает сетевой конец пула.When using VIP pools for your deployment, this parameter specifies the network end of the pool. Пулы виртуальных IP-адресов следует использовать для долгосрочных развертываний, чтобы гарантировать согласованность пула.You should use VIP pools for long-lived deployments to guarantee that a pool of IP addresses remain consistent. Это полезно при наличии рабочих нагрузок, которые всегда должны быть доступны.This is useful when you have workloads that always need to be reachable. Значение по умолчанию — none (Отсутствует).Default is none.
-macPoolStart
Он используется для указания начала MAC-адреса пула MAC-адресов, который вы хотите использовать для виртуальной машины узла службы Azure Kubernetes.This is used to specify the start of the MAC address of the MAC pool that you wish to use for the Azure Kubernetes Service host VM. Синтаксис для MAC-адреса требует, чтобы наименьший значащий бит первого байта всегда был равен 0, а первый байт всегда должен быть четным числом (то есть 00, 02, 04, 06...). Типичный MAC-адрес может выглядеть следующим образом: 02:1E: 2B: 78:00:00.The syntax for the MAC address requires that the least significant bit of the first byte should always be 0, and the first byte should always be an even number (that is, 00, 02, 04, 06...). A typical MAC address can look like: 02:1E:2B:78:00:00. Используйте пулы MAC-адресов для долгосрочных развертываний, чтобы назначенные MAC-адреса были одинаковыми.Use MAC pools for long-lived deployments so that MAC addresses assigned are consistent. Это полезно, если есть требование, что виртуальные машины имеют определенные MAC-адреса.This is useful if you have a requirement that the VMs have specific MAC addresses. Значение по умолчанию — none (Отсутствует).Default is none.
-macPoolEnd
Он используется для указания конца MAC-адреса пула MAC-адресов, который вы хотите использовать для виртуальной машины узла службы Azure Kubernetes.This is used to specify the end of the MAC address of the MAC pool that you wish to use for the Azure Kubernetes Service host VM. Синтаксис для MAC-адреса требует, чтобы наименьший значащий бит первого байта всегда был равен 0, а первый байт всегда должен быть четным числом (то есть 00, 02, 04, 06...). Первый байт адреса, переданного в качестве, -macPoolEnd
должен быть таким же, как и первый байт адреса, переданного в качестве -macPoolStart
.The syntax for the MAC address requires that the least significant bit of the first byte should always be 0, and the first byte should always be an even number (that is, 00, 02, 04, 06...). The first byte of the address passed as the -macPoolEnd
should be the same as the first byte of the address passed as the -macPoolStart
. Используйте пулы MAC-адресов для долгосрочных развертываний, чтобы назначенные MAC-адреса были одинаковыми.Use MAC pools for long-lived deployments so that MAC addresses assigned are consistent. Это полезно, если есть требование, что виртуальные машины имеют определенные MAC-адреса.This is useful if you have a requirement that the VMs have specific MAC addresses. Значение по умолчанию — none (Отсутствует).Default is none.
-vlanID
Это можно использовать для указания идентификатора виртуальной локальной сети.This can be used to specify a network VLAN ID. Сетевые адаптеры виртуальной машины Azure Kubernetes Service и кластера Kubernetes будут помечены указанным ИДЕНТИФИКАТОРом виртуальной ЛС.Azure Kubernetes Service host and Kubernetes cluster VM network adapters will be tagged with the provided VLAN ID. Этот параметр следует использовать, если существует конкретный идентификатор виртуальной ЛС, который необходимо пометить для правильного подключения.This should be used if there is a specific VLAN ID that needs to be tagged to get the right connectivity. Значение по умолчанию — none (Отсутствует).Default is none.
-kvaLoadBalancerType
Он принимает значение unstacked_haproxy
или stacked_kube_vip
.This takes in either unstacked_haproxy
or stacked_kube_vip
. unstacked_haproxy
— Это значение по умолчанию, где развернута отдельная виртуальная машина балансировщика нагрузки с HAProxy в качестве конечной точки сервера API узла службы Azure Kubernetes.unstacked_haproxy
is the default where a separate load balancer VM is deployed with HAProxy as the Azure Kubernetes Service host's API server endpoint. stacked_kube_vip
— Это решение подсистемы балансировки нагрузки, кубевипдля узла службы Kubernetes Azure.stacked_kube_vip
is a load balancer solution, Kubevip, for the Azure Kubernetes Service host. Он позволяет указать статический IP-адрес в узле в виде плавающего IP-адреса на узлах плоскости управления для обеспечения высокой доступности сервера API через IP.It allows you to specify a static IP address in the host as a floating IP across the control plane nodes to keep the API server highly available through the IP. Если выбран этот параметр, необходимо указать статический IP-адрес в kvaControlPlaneEndpoint
параметре и не развернуть отдельную виртуальную машину подсистемы балансировки нагрузки.If this option is chosen, you must specify the static IP address in the kvaControlPlaneEndpoint
parameter, and no separate load balancer VM is deployed.
stacked_kube_vip
требует IP-адреса и является более удобным для ресурсов за счет экономии памяти, ЦП и времени развертывания.stacked_kube_vip
requires an IP address and is more resource friendly by saving memory, CPU, and deployment time. Если IP-адрес не используется в качестве плавающего IP-адреса, следует использовать unstacked_haproxy
.If you do not have an IP address to use as the floating IP, you should use unstacked_haproxy
. Для второго варианта требуется виртуальная машина балансировщика нагрузки.The latter option requires a load balancer VM.
-kvaControlPlaneEndpoint
Указывает статический IP-адрес, который будет использоваться в качестве адреса сервера API узла службы Azure Kubernetes, если kvaLoadBalancerType
параметру присвоено значение stacked_kube_vip
.This specifies the static IP address to use as the Azure Kubernetes Service Host API server address when the kvaLoadBalancerType
parameter is set to stacked_kube_vip
. Если stacked_kube_vip
используется, необходимо указать этот параметр.If stacked_kube_vip
is used, this parameter must be specified.
-proxyServerHTTP
Это предоставляет универсальный код ресурса (URI) прокси-сервера, который должен использоваться всеми компонентами, которым требуется доступ к конечным точкам HTTP.This provides a proxy server URI that should be used by all components that need to reach HTTP endpoints. Формат URI включает в себя схему URI, адрес сервера и порт (т https://server.com:8888) . е..The URI format includes the URI schema, server address, and port (that is, https://server.com:8888). Значение по умолчанию — none (Отсутствует).Default is none.
-proxyServerHTTPS
Это предоставляет универсальный код ресурса (URI) прокси-сервера, который должен использоваться всеми компонентами, которым требуется доступ к конечным точкам HTTPS.This provides a proxy server URI that should be used by all components that need to reach HTTPS endpoints. Формат URI включает в себя схему URI, адрес сервера и порт (т https://server.com:8888) . е..The URI format includes the URI schema, server address, and port (that is, https://server.com:8888). Значение по умолчанию — none (Отсутствует).Default is none.
-proxyServerNoProxy
Это строка адресов с разделителями-запятыми, которая будет исключена из учетной записи-посредника.This is a comma-delimited string of addresses that will be exempt from the proxy. Значение по умолчанию — localhost,127.0.0.1,.svc,10.96.0.0/12,10.244.0.0/16
.Default value is localhost,127.0.0.1,.svc,10.96.0.0/12,10.244.0.0/16
. Это исключит трафик localhost (localhost, 127.0.0.1), внутренний трафик службы Kubernetes (SVC), службу Kubernetes CIDR (10.96.0.0/12) и модуль Kubernetes CIDR (10.244.0.0/16) от прокси-сервера.This excludes the localhost traffic (localhost, 127.0.0.1), internal Kubernetes service traffic (.svc), the Kubernetes Service CIDR (10.96.0.0/12), and the Kubernetes POD CIDR (10.244.0.0/16) from the proxy server. Этот параметр можно использовать для добавления дополнительных диапазонов подсети или исключений имен.You can use this parameter to add more subnet ranges or name exemptions. Параметры этого параметра очень важны, так как, если они неправильно настроены, может неожиданно направлять внутренний трафик кластера Kubernetes на прокси-сервер. Это может привести к различным сбоям при сетевом взаимодействии.The settings for this parameter are very important because, if it's not correctly configured, you may unexpectedly route internal Kubernetes cluster traffic to your proxy. This can cause various failures in network communication.
-proxyServerCredential
Это предоставляет имя пользователя и пароль для проверки подлинности на прокси-серверах HTTP и HTTPS.This provides the username and password to authenticate to your HTTP/HTTPS proxy servers. Можно использовать Get-Credential
для создания объекта, PSCredential
передаваемого в этот параметр.You can use Get-Credential
to generate a PSCredential
object to pass to this parameter. Значение по умолчанию — none (Отсутствует).Default is none.
-cloudServiceCidr
Это можно использовать для предоставления статического IP-или сетевого префикса для назначения службе MOC Клаудажент.This can be used to provide a static IP/network prefix to be assigned to the MOC CloudAgent service. Это значение должно быть предоставлено в формате CIDR.This value should be provided using the CIDR format. (Пример: 192.168.1.2/16).(Example: 192.168.1.2/16). Вы можете указать это, чтобы гарантировать, что все важные данные в сети будут всегда доступны, так как IP-адрес не изменится.You may want to specify this to ensure that anything important on the network is always accessible because the IP address will not change. Значение по умолчанию — none (Отсутствует).Default is none.
-workingDir
Это рабочий каталог для модуля, используемого для хранения небольших файлов.This is a working directory for the module to use for storing small files. По умолчанию имеет значение %PROGRAMFILES%\AksHci
и не должно изменяться для большинства развертываний.Defaults to %PROGRAMFILES%\AksHci
and should not be changed for most deployments.Мы не рекомендуем изменять значение по умолчанию. We do not recommend changing the default.
-version
Версия службы Azure Kubernetes на Azure Stack ХЦИ, которую требуется развернуть.The version of Azure Kubernetes Service on Azure Stack HCI that you want to deploy. По умолчанию используется последняя версия.The default is the latest version. Мы не рекомендуем изменять значение по умолчанию.We do not recommend changing the default.
-vnetType
Тип виртуального коммутатора для подключения или создания.The type of virtual switch to connect to or create. По умолчанию используется тип коммутатора external.This defaults to “External” switch type. Мы не рекомендуем изменять значение по умолчанию.We do not recommend changing the default.
-nodeAgentPort
Номер порта TCP/IP, который агенты узла должны прослушивать.The TCP/IP port number that node agents should listen on. Значение по умолчанию — 45000.Defaults to 45000.Мы не рекомендуем изменять значение по умолчанию. We do not recommend changing the default.
-nodeAgentAuthorizerPort
Номер порта TCP/IP, который агенты узла должны использовать для порта авторизации.The TCP/IP port number that node agents should use for their authorization port. Значение по умолчанию — 45001.Defaults to 45001. Мы не рекомендуем изменять значение по умолчанию.We do not recommend changing the default.
-clusterRoleName
Указывает имя, которое будет использоваться при создании облачного агента в качестве универсальной службы в кластере.This specifies the name to use when creating cloud agent as a generic service within the cluster. По умолчанию используется уникальное имя с префиксом CA-и суффиксом GUID (например: "CA-9e6eb299-bc0b-4f00-9fd7-942843820c26").This defaults to a unique name with a prefix of ca- and a guid suffix (for example: “ca-9e6eb299-bc0b-4f00-9fd7-942843820c26”). Мы не рекомендуем изменять значение по умолчанию.We do not recommend changing the default.
-cloudLocation
Этот параметр предоставляет собственное имя управляемого облачного расположения Майкрософт.This parameter provides a custom Microsoft Operated Cloud location name. Имя по умолчанию — "Моклокатион".The default name is "MocLocation". Мы не рекомендуем изменять значение по умолчанию.We do not recommend changing the default.
-skipHostLimitChecks
Запрашивает у скрипта пропуск всех проверок, чтобы подтвердить, что память и место на диске доступны, прежде чем разрешить продолжение развертывания.Requests the script to skip any checks it does to confirm memory and disk space is available before allowing the deployment to proceed. Мы не рекомендуем использовать этот параметр.We do not recommend using this setting.
-insecure
Развертывает службу Kubernetes Azure Azure Stack на таких компонентах ХЦИ, как агент облака и агенты узла в незащищенном режиме (без защищенных TLS-подключений).Deploys Azure Kubernetes Service on Azure Stack HCI components such as cloud agent and node agent(s) in insecure mode (no TLS secured connections).Не рекомендуется использовать небезопасный режим в рабочих средах. We do not recommend using insecure mode in production environments.
-skipUpdates
Используйте этот флаг, если хотите пропустить все доступные обновления.Use this flag if you want to skip any updates available. Мы не рекомендуем использовать этот параметр.We do not recommend using this setting.
-forceDnsReplication
Репликация DNS может занять до часа в некоторых системах.DNS replication can take up to an hour on some systems. Это приведет к снижению развертывания.This will cause the deployment to be slow. Если вы столкнулись с этой проблемой, вы увидите, что Install-AksHci будет задержана в цикле.If you hit this issue, you'll see that the Install-AksHci will be stuck in a loop. Чтобы устранить эту ошибку, попытайтесь использовать этот флаг.To get past this issue, try to use this flag. -forceDnsReplication
Флаг не является гарантированным исправлением.The -forceDnsReplication
flag is not a guaranteed fix. Если логика, соответствующая этому флагу, завершается неудачно, то ошибка будет скрыта и команда будет выполняться, как если бы флаг не был указан.If the logic behind the flag fails, the error will be hidden, and the command will carry on as if the flag was not provided.
Сброс службы Kubernetes Azure в конфигурации Azure Stack ХЦИReset the Azure Kubernetes Service on Azure Stack HCI configuration
Чтобы сбросить службу Azure Kubernetes в конфигурации Azure Stack ХЦИ, выполните следующие команды.To reset the Azure Kubernetes Service on Azure Stack HCI configuration, run the following commands. Выполнение этой команды приведет к сбросу конфигурации к значениям по умолчанию.Running this command on its own will reset the configuration to default values.
Set-AksHciConfig
Шаг 4. Запуск нового развертыванияStep 4: Start a new deployment
После настройки развертывания необходимо запустить развертывание.After you've configured your deployment, you must start deployment. При этом будет установлена служба Azure Kubernetes на Azure Stack ХЦИ Agents/Services и узел службы Azure Kubernetes.This will install the Azure Kubernetes Service on Azure Stack HCI agents/services and the Azure Kubernetes Service host.
Чтобы начать развертывание, выполните следующую команду.To begin deployment, run the following command.
Install-AksHci
Проверка развернутого узла службы Kubernetes AzureVerify your deployed Azure Kubernetes Service host
Чтобы убедиться, что узел службы Azure Kubernetes был развернут, выполните следующую команду.To ensure that your Azure Kubernetes Service host was deployed, run the following command. Вы также сможете получить кластеры Kubernetes, используя ту же команду после развертывания.You will also be able to get Kubernetes clusters using the same command after deploying them.
Get-AksHciCluster
Выходные данные:Output:
Name : clustergroup-management
Version : v1.18.8
Control Planes : 1
Linux Workers : 0
Windows Workers : 0
Phase : provisioned
Ready : True
Шаг 5. доступ к кластерам с помощью kubectlStep 5: Access your clusters using kubectl
Чтобы получить доступ к узлу службы Kubernetes Azure или кластеру Kubernetes с помощью kubectl, выполните следующую команду.To access your Azure Kubernetes Service host or Kubernetes cluster using kubectl, run the following command. Будет использоваться указанный файл kubeconfig кластера в качестве файла kubeconfig по умолчанию для kubectl.This will use the specified cluster's kubeconfig file as the default kubeconfig file for kubectl.
Get-AksHciCredential -clusterName <String>
[-outputLocation <String>]
ПримерExample
Get-AksHciCredential -clusterName clustergroup-management
Обязательные параметрыRequired Parameters
clusterName
Имя кластера.The name of the cluster.
Необязательные параметрыOptional Parameters
outputLocation
Расположение, куда нужно скачать kubeconfig.The location where you want the kubeconfig downloaded. По умолчанию — %USERPROFILE%\.kube
.Default is %USERPROFILE%\.kube
.
Получение журналовGet logs
Чтобы получить журналы из всех модулей Pod, выполните следующую команду.To get logs from your all your pods, run the following command. Эта команда создаст выходную ZIP-папку с именем akshcilogs
в пути C:\wssd\akshcilogs
.This command will create an output zipped folder called akshcilogs
in the path C:\wssd\akshcilogs
.
Get-AksHciLogs
Обновление до последней версии службы Azure Kubernetes на Azure Stack ХЦИUpdate to the latest version of Azure Kubernetes Service on Azure Stack HCI
Чтобы выполнить обновление до последней версии службы Azure Kubernetes на Azure Stack ХЦИ, выполните следующую команду.To update to the latest version of Azure Kubernetes Service on Azure Stack HCI, run the following command. Команда Update работает только в том случае, если установлен выпуск Oct.The update command only works if you have installed the Oct release. Он не будет работать для выпусков, предшествующих выпуску за октябрь.It will not work for releases older than the October release. Эта команда обновления обновляет узел службы Kubernetes Azure и локальную облачную платформу Майкрософт.This update command updates the Azure Kubernetes Service host and the on-premise Microsoft operated cloud platform. В этом предварительном выпуске версия Kubernetes и версия ОС узла AKS остаются неизменными.For this preview release, the Kubernetes version and AKS host OS version still remain the same. Эта команда не обновляет существующие кластеры рабочей нагрузки.This command does not upgrade any existing workload clusters. Новые кластеры рабочей нагрузки, созданные после обновления узла AKS, будут отличаться от существующих кластеров рабочей нагрузки с точки зрения версии ОС Windows и версии Kubernetes.New workload clusters created after updating the AKS host will differ from existing workload clusters in terms of Windows node OS version and Kubernetes version.
Update-AksHci
Рекомендуется обновить кластеры рабочей нагрузки сразу после обновления кластера управления, чтобы предотвратить запуск неподдерживаемых версий ОС Windows Server в кластерах Kubernetes с узлами Windows.We recommend updating workload clusters immediately after updating the management cluster to prevent running unsupported Windows Server OS versions in your Kubernetes clusters with Windows nodes. Чтобы обновить кластер рабочей нагрузки, посетите страницу обновления кластера рабочей нагрузки.To update your workload cluster, visit update your workload cluster.
Перезапуск службы Kubernetes Azure на Azure Stack ХЦИRestart Azure Kubernetes Service on Azure Stack HCI
Перезапуск службы Azure Kubernetes на Azure Stack ХЦИ приведет к удалению всех кластеров Kubernetes, если таковые имеются, и узла службы Azure Kubernetes.Restarting Azure Kubernetes Service on Azure Stack HCI will remove all of your Kubernetes clusters if any, and the Azure Kubernetes Service host. Также будет удалена служба Azure Kubernetes на Azure Stack агенты и службы ХЦИ с узлов.It will also uninstall the Azure Kubernetes Service on Azure Stack HCI agents and services from the nodes. Затем он вернется к исходным шагам процесса установки до тех пор, пока узел не будет создан повторно.It will then go back through the original install process steps until the host is recreated. Служба Azure Kubernetes в конфигурации Azure Stack ХЦИ, настроенной с помощью, Set-AksHciConfig
и Скачанные образы VHDX сохраняются.The Azure Kubernetes Service on Azure Stack HCI configuration that you configured via Set-AksHciConfig
and the downloaded VHDX images are preserved.
Чтобы перезапустить службу Kubernetes Azure на Azure Stack ХЦИ с теми же параметрами конфигурации, выполните следующую команду.To restart Azure Kubernetes Service on Azure Stack HCI with the same configuration settings, run the following command.
Restart-AksHci
Сбросьте параметры конфигурации и переустановите службу Azure Kubernetes на Azure Stack ХЦИReset configuration settings and reinstall Azure Kubernetes Service on Azure Stack HCI
Чтобы переустановить службу Kubernetes Azure на Azure Stack ХЦИ с другими параметрами конфигурации, сначала выполните следующую команду.To reinstall Azure Kubernetes Service on Azure Stack HCI with different configuration settings, run the following command first.
Uninstall-AksHci
После выполнения приведенной выше команды можно изменить параметры конфигурации с помощью следующей команды.After running the above command, you can change the configuration settings with the following command. Параметры остаются такими же, как описано в шаге 3.The parameters remain the same as described in Step 3. Если выполнить эту команду без указанных параметров, параметры будут сброшены к значениям по умолчанию.If you run this command with no specified parameters, the parameters will be reset to their default values.
Set-AksHciConfig
После изменения конфигурации на нужные параметры выполните следующую команду, чтобы переустановить Azure Stack Kubernetes на Azure Stack ХЦИ.After changing the configuration to your desired settings, run the following command to reinstall Azure Stack Kubernetes on Azure Stack HCI.
Install-AksHci
Удаление службы Kubernetes Azure на Azure Stack ХЦИRemove Azure Kubernetes Service on Azure Stack HCI
Чтобы удалить службу Kubernetes Azure на Azure Stack ХЦИ, выполните следующую команду.To remove Azure Kubernetes Service on Azure Stack HCI, run the following command. Если вы используете PowerShell для удаления развертывания центра администрирования Windows, необходимо выполнить команду с -Force
флагом.If you are using PowerShell to uninstall a Windows Admin Center deployment, you must run the command with the -Force
flag.
Uninstall-AksHci
После выполнения приведенной выше команды можно выполнить команду, Install-AksHci
чтобы установить узел службы Azure Kubernetes с той же конфигурацией, что и раньше.After running the above command, you can run the Install-AksHci
command to install the Azure Kubernetes Service host with the same configuration as before. Если вы хотите изменить конфигурацию, запустите с изменениями, которые необходимо Set-AksHciConfig
внести перед выполнением команды install.If you want to change the configuration, run Set-AksHciConfig
with the changes you want to make before running the install command.
Если вы не хотите хранить старую конфигурацию, выполните следующую команду.If you don't want to retain the old configuration, run the following command.
Uninstall-AksHci -Force
Если команды PowerShell выполняются в кластере, где центр администрирования Windows ранее использовался для развертывания, модуль PowerShell проверяет наличие файла конфигурации центра администрирования Windows.If PowerShell commands are run on a cluster where Windows Admin Center was previously used to deploy, the PowerShell module checks the existence of the Windows Admin Center configuration file. Центр администрирования Windows размещает файл конфигурации центра администрирования Windows на всех узлах.Windows Admin Center places the Windows Admin Center configuration file across all nodes. Если вы используете команду удаления и вернитесь в центр администрирования Windows, выполните указанную выше команду удаления с -Force
флагом. Если это не сделано, PowerShell и центр администрирования Windows не будут синхронизированы.If you use the uninstall command and go back to Windows Admin Center, run the above uninstall command with the -Force
flag. If this is not done, PowerShell and Windows Admin Center will be out of sync.