클러스터에 대한 노드 풀 관리(Azure Stack HCI 22H2의 AKS)

적용 대상: Azure Stack HCI 22H2의 AKS, Windows Server의 AKS

참고

Azure Stack HCI 23H2의 AKS에서 노드 풀을 관리하는 방법에 대한 자세한 내용은 노드 풀 관리를 참조하세요.

Azure Arc에서 사용하도록 설정된 AKS에서 동일한 구성의 노드는 노드 풀로 그룹화됩니다. 이러한 노드 풀에는 애플리케이션을 실행하는 기본 VM이 포함됩니다. 이 문서에서는 AKS Arc에서 클러스터에 대한 노드 풀을 만들고 관리하는 방법을 보여 줍니다.

참고

이 기능을 사용하면 여러 노드 풀을 만들고 관리하는 방법을 보다 세분화할 수 있습니다. 따라서 만들기, 업데이트 및 삭제 작업에는 별도의 명령이 필요합니다. 이전에는 New-AksHciCluster 또는 Set-AksHciCluster 를 통한 클러스터 작업이 하나의 Windows 노드 풀과 하나의 Linux 노드 풀을 사용하여 클러스터를 만들거나 스케일링하는 유일한 옵션이었습니다. 이 기능은 개별 노드 풀에서 작업을 실행하기 위해 노드 풀 명령 New-AksHciNodePool, Set-AksHciNodePool, Get-AksHciNodePoolRemove-AksHciNodePool 사용해야 하는 노드 풀에 대한 별도의 작업 집합을 노출합니다.

시작하기 전에

버전 1.1.6을 설치하는 것이 좋습니다. PowerShell 모듈이 이미 설치된 경우 다음 명령을 실행하여 버전을 찾습니다.

Get-Command -Module AksHci

PowerShell을 업데이트해야 하는 경우 AKS 호스트 업그레이드의 지침에 따라 업데이트합니다.

AKS 클러스터 만들기

시작하려면 노드 풀이 하나인 AKS 클러스터를 만듭니다. 다음 예제에서는 New-AksHciCluster 명령을 사용하여 1개의 노드가 있는 linuxnodepool이라는 하나의 Linux 노드 풀이 있는 새 Kubernetes 클러스터를 만듭니다. 이전 버전의 AKS를 사용하여 클러스터를 이미 배포했으며 이전 배포를 계속 사용하려는 경우 이 단계를 건너뛸 수 있습니다. 새 노드 풀 명령 집합을 사용하여 기존 클러스터에 더 많은 노드 풀을 추가할 수 있습니다.

New-AksHciCluster -name mycluster -nodePoolName linuxnodepool -nodeCount 1 -osType linux

참고

에 대한 New-AksHciCluster 이전 매개 변수 집합은 여전히 지원됩니다.

노드 풀 추가

이전 단계에서 만든 *'라는 mycluster클러스터에는 단일 노드 풀이 있습니다. New-AksHciNodePool 명령을 사용하여 기존 클러스터에 두 번째 노드 풀을 추가할 수 있습니다. 다음 예제에서는 하나의 노드가 있는 windowsnodepool이라는 Windows 노드 풀을 만듭니다. 노드 풀의 이름이 기존 노드 풀과 동일한 이름이 아닌지 확인합니다.

New-AksHciNodePool -clusterName mycluster -name windowsnodepool -count 1 -osType Windows -osSku Windows2022

노드 풀의 구성 정보 가져오기

노드 풀의 구성 정보를 보려면 Get-AksHciNodePool 명령을 사용합니다.

Get-AksHciNodePool -clusterName mycluster

예제 출력:

ClusterName  : mycluster
NodePoolName : linuxnodepool
Version      : v1.20.7
OsType       : Linux
NodeCount    : 1
VmSize       : Standard_K8S3_v1
Phase        : Deployed

ClusterName  : mycluster
NodePoolName : windowsnodepool
Version      : v1.20.7
OsType       : Windows
NodeCount    : 1
VmSize       : Standard_K8S3_v1
Phase        : Deployed

특정 노드 풀의 구성 정보를 보려면 Get-AksHciNodePool에서 매개 변수를 사용합니다-name.

Get-AksHciNodePool -clusterName mycluster -name linuxnodepool

예제 출력:

ClusterName  : mycluster
NodePoolName : linuxnodepool
Version      : v1.20.7
OsType       : Linux
NodeCount    : 1
VmSize       : Standard_K8S3_v1
Phase        : Deployed
Get-AksHciNodePool -clusterName mycluster -name windowsnodepool

예제 출력:

ClusterName  : mycluster
NodePoolName : windowsnodepool
Version      : v1.20.7
OsType       : Windows
NodeCount    : 1
VmSize       : Standard_K8S3_v1
Phase        : Deployed

참고

에서 New-AksHciCluster 새 매개 변수 집합을 사용하여 클러스터를 배포한 다음 를 실행 Get-AksHciCluster 하여 클러스터 정보를 가져오는 경우 출력의 필드 WindowsNodeCountLinuxNodeCount 는 를 반환 0합니다. 각 노드 풀의 정확한 노드 수를 얻으려면 지정된 클러스터 이름과 함께 명령을 Get-AksHciNodePool 사용합니다.

노드 풀 크기 조정

노드 풀에서 노드 수를 늘리거나 축소할 수 있습니다.

노드 풀의 노드 수를 조정하려면 Set-AksHciNodePool 명령을 사용합니다. 다음 예제에서는 클러스터에서 라는 linuxnodepoolmycluster 노드 풀의 노드 수를 3으로 조정합니다.

Set-AksHciNodePool -clusterName mycluster -name linuxnodepool -count 3

컨트롤 플레인 노드 크기 조정

컨트롤 플레인 노드 관리는 변경되지 않았습니다. 생성, 크기 조정 및 제거되는 방법은 동일하게 유지됩니다. 값을 제공하지 않으면 New-AksHciCluster 명령을 매개 변수 controlPlaneNodeCountcontrolPlaneVmSize 기본값 1 및 Standard_A4_V2 사용하여 컨트롤 플레인 노드를 배포합니다.

애플리케이션의 워크로드 수요가 변경되면 컨트롤 플레인 노드의 크기를 조정해야 할 수 있습니다. 컨트롤 플레인 노드의 크기를 조정하려면 Set-AksHciCluster 명령을 사용합니다. 다음 예제에서는 이전 단계에서 만든 클러스터에서 mycluster 컨트롤 플레인 노드의 크기를 3으로 조정합니다.

Set-AksHciCluster -name mycluster -controlPlaneNodeCount 3

노드 풀 삭제

노드 풀을 삭제해야 하는 경우 Remove-AksHciNodePool 명령을 사용합니다. 다음 예제에서는 클러스터에서 이라는 windowsnodepool 노드 풀을 제거합니다 mycluster .

Remove-AksHciNodePool -clusterName mycluster -name windowsnodepool

노드 풀에 대한 taint 지정

노드 풀을 만들 때 해당 노드 풀에 taint를 추가할 수 있습니다. taint를 추가하면 해당 노드 풀 내의 모든 노드도 해당 taint를 가져옵니다. taint 및 tolerations에 대한 자세한 내용은 Kubernetes Taints 및 Tolerations를 참조하세요.

노드 풀 taint 설정

taint를 사용하여 노드 풀을 만들려면 New-AksHciNodePool을 사용합니다. 이름을 taintnp지정하고 매개 변수를 -taints 사용하여 taint에 대해 를 지정 sku=gpu:noSchedule 합니다.

New-AksHciNodePool -clusterName mycluster -name taintnp -count 1 -osType linux -taints sku=gpu:NoSchedule

참고

노드 풀을 만드는 동안 노드 풀에 대해서만 taint를 설정할 수 있습니다.

다음 명령을 실행하여 노드 풀이 지정된 taint와 함께 성공적으로 배포되었는지 확인합니다.

Get-AksHciNodePool -clusterName mycluster -name taintnp

출력

Status       : {Phase, Details}
ClusterName  : mycluster
NodePoolName : taintnp
Version      : v1.20.7-kvapkg.1
OsType       : Linux
NodeCount    : 1
VmSize       : Standard_K8S3_v1
Phase        : Deployed
Taints       : {sku=gpu:NoSchedule}

이전 단계에서는 노드 풀을 만들 때 sku=gpu:NoSchedule taint를 적용했습니다. 다음 기본 예제 YAML 매니페스트는 toleration을 사용하여 Kubernetes 스케줄러가 해당 노드 풀의 노드에서 NGINX Pod를 실행할 수 있도록 허용합니다.

라는 nginx-toleration.yaml파일을 만들고 다음 텍스트에 정보를 복사합니다.

apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
  - image: mcr.microsoft.com/oss/nginx/nginx:1.15.9-alpine
    name: mypod
    resources:
      requests:
        cpu: 100m
        memory: 128Mi
      limits:
        cpu: 1
        memory: 2G
  tolerations:
  - key: "sku"
    operator: "Equal"
    value: "gpu"
    effect: "NoSchedule"

그런 다음, 다음 명령을 사용하여 Pod를 예약합니다.

kubectl apply -f nginx-toleration.yaml

Pod가 배포되었는지 확인하려면 다음 명령을 실행합니다.

kubectl describe pod mypod
[...]
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
                 sku=gpu:NoSchedule
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  32s   default-scheduler  Successfully assigned default/mypod to moc-lk4iodl7h2y
  Normal  Pulling    30s   kubelet            Pulling image "mcr.microsoft.com/oss/nginx/nginx:1.15.9-alpine"
  Normal  Pulled     26s   kubelet            Successfully pulled image "mcr.microsoft.com/oss/nginx/nginx:1.15.9-alpine" in 4.529046457s
  Normal  Created    26s   kubelet            Created container mypod

다음 단계