4장. 컴퓨팅 머신 세트 수정
레이블 추가, 인스턴스 유형 변경, 블록 스토리지 변경 등 컴퓨팅 머신 세트를 수정할 수 있습니다.
다른 변경 없이 컴퓨팅 머신 세트를 확장해야 하는 경우 컴퓨팅 머신 세트 수동 확장을 참조하세요.
4.1. CLI를 사용하여 컴퓨팅 머신 세트 수정 링크 복사링크가 클립보드에 복사되었습니다!
CLI를 사용하여 컴퓨팅 머신 세트의 구성을 수정한 다음 클러스터의 머신에 변경 사항을 전파할 수 있습니다.
컴퓨팅 머신 세트 구성을 업데이트하면 해당 세트에서 생성된 머신의 기능을 활성화하거나 속성을 변경할 수 있습니다. 컴퓨팅 머신 세트를 수정하는 경우, 변경 사항은 업데이트된 MachineSet
사용자 정의 리소스(CR)를 저장한 후에 생성된 컴퓨팅 머신에만 적용됩니다. 이러한 변경 사항은 기존 장비에는 영향을 미치지 않습니다.
기본 클라우드 공급자에서 변경한 내용은 Machine
또는 MachineSet
CR에 반영되지 않습니다. 클러스터 관리 인프라에서 인스턴스 구성을 조정하려면 클러스터 측 리소스를 사용합니다.
업데이트된 구성을 반영하는 새 머신으로 기존 머신을 교체하려면 컴퓨팅 머신 세트를 확장하여 복제본 수를 두 배로 늘린 다음 복제본 수를 원래 수로 줄입니다.
다른 변경 없이 컴퓨팅 머신 세트를 확장해야 하는 경우 머신을 삭제할 필요가 없습니다.
기본적으로 OpenShift Container Platform 라우터 포드는 컴퓨팅 머신에 배포됩니다. 라우터는 웹 콘솔을 포함한 일부 클러스터 리소스에 액세스해야 하므로 라우터 포드를 먼저 재배치하지 않는 한 컴퓨팅 머신 세트를 0
으로 확장하지 마세요.
이 절차의 출력 예에서는 AWS 클러스터의 값을 사용합니다.
사전 요구 사항
- OpenShift Container Platform 클러스터는 Machine API를 사용합니다.
-
OpenShift CLI(
oc
)를 사용하여 관리자로 클러스터에 로그인했습니다.
프로세스
다음 명령을 실행하여 클러스터에 있는 컴퓨팅 머신 세트를 나열하세요.
oc get machinesets.machine.openshift.io -n openshift-machine-api
$ oc get machinesets.machine.openshift.io -n openshift-machine-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
NAME DESIRED CURRENT READY AVAILABLE AGE <compute_machine_set_name_1> 1 1 1 1 55m <compute_machine_set_name_2> 1 1 1 1 55m
NAME DESIRED CURRENT READY AVAILABLE AGE <compute_machine_set_name_1> 1 1 1 1 55m <compute_machine_set_name_2> 1 1 1 1 55m
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 다음 명령을 실행하여 컴퓨팅 머신 세트를 편집합니다.
oc edit machinesets.machine.openshift.io <machine_set_name> \ -n openshift-machine-api
$ oc edit machinesets.machine.openshift.io <machine_set_name> \ -n openshift-machine-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 변경 사항을 적용하기 위해 머신 세트를 확장할 때 필요하므로
spec.replicas
필드의 값을 기록해 두세요.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 이 절차의 예에서는
복제본
값이2
인 컴퓨팅 머신 세트를 보여줍니다.
- 원하는 구성 옵션으로 컴퓨팅 머신 세트 CR을 업데이트하고 변경 사항을 저장합니다.
다음 명령을 실행하여 업데이트된 컴퓨팅 머신 세트에서 관리하는 머신을 나열합니다.
oc get machines.machine.openshift.io \ -n openshift-machine-api \ -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
$ oc get machines.machine.openshift.io \ -n openshift-machine-api \ -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow AWS 클러스터에 대한 출력 예
NAME PHASE TYPE REGION ZONE AGE <machine_name_original_1> Running m6i.xlarge us-west-1 us-west-1a 4h <machine_name_original_2> Running m6i.xlarge us-west-1 us-west-1a 4h
NAME PHASE TYPE REGION ZONE AGE <machine_name_original_1> Running m6i.xlarge us-west-1 us-west-1a 4h <machine_name_original_2> Running m6i.xlarge us-west-1 us-west-1a 4h
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 업데이트된 컴퓨팅 머신 세트에서 관리하는 각 머신에 대해 다음 명령을 실행하여
삭제
주석을 설정합니다.oc annotate machine.machine.openshift.io/<machine_name_original_1> \ -n openshift-machine-api \ machine.openshift.io/delete-machine="true"
$ oc annotate machine.machine.openshift.io/<machine_name_original_1> \ -n openshift-machine-api \ machine.openshift.io/delete-machine="true"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 새로운 구성으로 대체 머신을 생성하려면 다음 명령을 실행하여 컴퓨팅 머신 세트를 복제본 수의 두 배로 확장합니다.
oc scale --replicas=4 \ machineset.machine.openshift.io <machine_set_name> \ -n openshift-machine-api
$ oc scale --replicas=4 \
1 machineset.machine.openshift.io <machine_set_name> \ -n openshift-machine-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 원래 예제 값
2
는4
로 두 배가 됩니다.
다음 명령을 실행하여 업데이트된 컴퓨팅 머신 세트에서 관리하는 머신을 나열합니다.
oc get machines.machine.openshift.io \ -n openshift-machine-api \ -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
$ oc get machines.machine.openshift.io \ -n openshift-machine-api \ -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow AWS 클러스터에 대한 출력 예
NAME PHASE TYPE REGION ZONE AGE <machine_name_original_1> Running m6i.xlarge us-west-1 us-west-1a 4h <machine_name_original_2> Running m6i.xlarge us-west-1 us-west-1a 4h <machine_name_updated_1> Provisioned m6i.xlarge us-west-1 us-west-1a 55s <machine_name_updated_2> Provisioning m6i.xlarge us-west-1 us-west-1a 55s
NAME PHASE TYPE REGION ZONE AGE <machine_name_original_1> Running m6i.xlarge us-west-1 us-west-1a 4h <machine_name_original_2> Running m6i.xlarge us-west-1 us-west-1a 4h <machine_name_updated_1> Provisioned m6i.xlarge us-west-1 us-west-1a 55s <machine_name_updated_2> Provisioning m6i.xlarge us-west-1 us-west-1a 55s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 새로운 머신이
실행
단계에 있을 때, 컴퓨팅 머신 세트를 원래 복제본 수로 확장할 수 있습니다.이전 구성으로 생성된 머신을 제거하려면 다음 명령을 실행하여 컴퓨팅 머신 세트를 원래 복제본 수로 확장합니다.
oc scale --replicas=2 \ machineset.machine.openshift.io <machine_set_name> \ -n openshift-machine-api
$ oc scale --replicas=2 \
1 machineset.machine.openshift.io <machine_set_name> \ -n openshift-machine-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 원래 예제 값은
2
입니다.
검증
업데이트된 머신 세트로 생성된 머신이 올바른 구성을 가지고 있는지 확인하려면 다음 명령을 실행하여 새 머신 중 하나에 대한 CR의 관련 필드를 조사하세요.
oc describe machine.machine.openshift.io <machine_name_updated_1> \ -n openshift-machine-api
$ oc describe machine.machine.openshift.io <machine_name_updated_1> \ -n openshift-machine-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 업데이트된 구성이 없는 컴퓨팅 머신이 삭제되었는지 확인하려면 다음 명령을 실행하여 업데이트된 컴퓨팅 머신 세트에서 관리되는 머신을 나열합니다.
oc get machines.machine.openshift.io \ -n openshift-machine-api \ -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
$ oc get machines.machine.openshift.io \ -n openshift-machine-api \ -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow AWS 클러스터에 대한 삭제가 진행되는 동안의 예시 출력
NAME PHASE TYPE REGION ZONE AGE <machine_name_original_1> Deleting m6i.xlarge us-west-1 us-west-1a 4h <machine_name_original_2> Deleting m6i.xlarge us-west-1 us-west-1a 4h <machine_name_updated_1> Running m6i.xlarge us-west-1 us-west-1a 5m41s <machine_name_updated_2> Running m6i.xlarge us-west-1 us-west-1a 5m41s
NAME PHASE TYPE REGION ZONE AGE <machine_name_original_1> Deleting m6i.xlarge us-west-1 us-west-1a 4h <machine_name_original_2> Deleting m6i.xlarge us-west-1 us-west-1a 4h <machine_name_updated_1> Running m6i.xlarge us-west-1 us-west-1a 5m41s <machine_name_updated_2> Running m6i.xlarge us-west-1 us-west-1a 5m41s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow AWS 클러스터에 대한 삭제가 완료되었을 때의 출력 예
NAME PHASE TYPE REGION ZONE AGE <machine_name_updated_1> Running m6i.xlarge us-west-1 us-west-1a 6m30s <machine_name_updated_2> Running m6i.xlarge us-west-1 us-west-1a 6m30s
NAME PHASE TYPE REGION ZONE AGE <machine_name_updated_1> Running m6i.xlarge us-west-1 us-west-1a 6m30s <machine_name_updated_2> Running m6i.xlarge us-west-1 us-west-1a 6m30s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow