AKS Node확장
사용자나 서비스에 따른 Node(VM Machine)의 사양을 업그레이드할 필요가 있습니다. 기존 사용중인 Node를 모두 새로운 사양의 Node로 변경하는 방법
아래와 같은 Node사양에서 Standard_DS2_v2 사양변경 방법
- kubectl get nodes
aks-ingress7e99-34991942-vmss000000 Ready agent 21m v1.26.6
aks-system-43441963-vmss000000 Ready agent 155d v1.26.6
aks-usera23a-72571917-vmss000000 Ready agent 3h15m v1.26.6
aks-worker28f2-31758233-vmss000000 Ready agent 3h21m v1.26.6
aks-worker28f2-31758233-vmss000001 Ready agent 3h21m v1.26.6- 우선 업그레이드할 Node를 선택하여 cordon 명령을 통해서 더이상 스케줄링 되지 않도록 안전하게 지정합니다.
kubectl cordon aks-ingress7e99-34991942-vmss000000 aks-system-43441963-vmss000000 이렇게 두개 설정하면 더이상 스케줄링 되지 않습니다.
- 아래 설정된 nodepool의 사양을 변경하면 새로운 노드를 추가합니다.
locals {
node_pools = {
user = {
name = "user"
mode = "User"
kubernetes_cluster_id = module.aks.aks_id
vm_size = "Standard_DS2_v2"
enable_auto_scaling = true
node_count = 2
min_count = 2
max_count = 5
vnet_subnet_id = local.vnet_private_subnet_2_id
# Add temporary_name_for_rotation for properties that require it
temporary_name_for_rotation = "user"
}
ingress = {
name = "ingress"
mode = "System"
kubernetes_cluster_id = module.aks.aks_id
vm_size = "Standard_DS2_v2"
enable_auto_scaling = true
node_count = 1
min_count = 1
max_count = 5
vnet_subnet_id = local.vnet_private_subnet_3_id
# Add temporary_name_for_rotation for properties that require it
temporary_name_for_rotation = "ingress"
}
worker = {
name = "worker"
mode = "User"
kubernetes_cluster_id = module.aks.aks_id
vm_size = "Standard_DS2_v2" // "Standard_D3_v2"
enable_auto_scaling = true
node_count = 2
min_count = 2
max_count = 5
vnet_subnet_id = local.vnet_private_subnet_3_id
# Add temporary_name_for_rotation for properties that require it
temporary_name_for_rotation = "worker"
}
}
}
make aks- drain 명령을 통해서 기존의 삭제할 node의 pod을 다른곳으로 이동하게 합니다. 아래와 같이 명렁어를 사용하며 옵션에 daemonset은 제외합니다.
kubectl drain aks-ingress7e99-34991942-vmss000000 aks-system-43441963-vmss000000 --ignore-daemonsets --delete-local-data