This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.4장. 머신 세트 수정
레이블 추가, 인스턴스 유형 변경 또는 블록 스토리지 변경과 같은 머신 세트를 수정할 수 있습니다.
RHV(Red Hat Virtualization)에서는 머신 세트를 변경하여 다른 스토리지 도메인에서 새 노드를 프로비저닝할 수도 있습니다.
다른 변경없이 머신 세트를 확장해야하는 경우 머신 세트 수동 스케일링을 참조하십시오.
4.1. CLI를 사용하여 머신 세트 수정 링크 복사링크가 클립보드에 복사되었습니다!
머신 세트를 수정하면 업데이트된 MachineSet
CR(사용자 정의 리소스)을 저장한 후 생성된 머신에만 변경 사항이 적용됩니다. 변경 사항은 기존 머신에는 영향을 미치지 않습니다. 머신 세트를 스케일링하여 업데이트된 구성을 반영하는 기존 머신을 새 머신으로 교체할 수 있습니다.
다른 변경을 수행하지 않고 머신 세트를 스케일링해야 하는 경우 머신을 삭제할 필요가 없습니다.
기본적으로 OpenShift Container Platform 라우터 Pod는 머신에 배포됩니다. 라우터는 웹 콘솔을 포함한 일부 클러스터 리소스에 액세스해야 하므로 먼저 라우터 Pod를 재배치하지 않는 한 머신 세트를 0
으로 스케일링하지 마십시오.
사전 요구 사항
- OpenShift Container Platform 클러스터는 Machine API를 사용합니다.
-
OpenShift CLI(
oc
)를 사용하여 관리자로 클러스터에 로그인했습니다.
절차
머신 세트를 편집합니다.
oc edit machineset <machine_set_name> -n openshift-machine-api
$ oc edit machineset <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
- 이 절차의 예제에서는
replicas
값이2
인 머신 세트를 보여줍니다.
- 원하는 구성 옵션으로 머신 세트 CR을 업데이트하고 변경 사항을 저장합니다.
다음 명령을 실행하여 업데이트된 머신 세트에서 관리하는 머신을 나열합니다.
oc get -n openshift-machine-api machines -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
$ oc get -n openshift-machine-api machines -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
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_name_original_1> \ -n openshift-machine-api \ machine.openshift.io/delete-machine="true"
$ oc annotate machine/<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_set_name> \ -n openshift-machine-api
$ oc scale --replicas=4 \
1 machineset <machine_set_name> \ -n openshift-machine-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 원래 예제 값
2
는4
로 두 배가됩니다.
다음 명령을 실행하여 업데이트된 머신 세트에서 관리하는 머신을 나열합니다.
oc get -n openshift-machine-api machines -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
$ oc get -n openshift-machine-api machines -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
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 새 머신이
Running
단계에 있는 경우 머신 세트를 원래 복제본 수로 확장할 수 있습니다.다음 명령을 실행하여 머신 세트를 원래 복제본 수로 확장합니다.
oc scale --replicas=2 \ machineset <machine_set_name> \ -n openshift-machine-api
$ oc scale --replicas=2 \
1 machineset <machine_set_name> \ -n openshift-machine-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 원래 예제 값인
2
입니다.
검증
업데이트된 구성이 없는 머신이 삭제되었는지 확인하려면 다음 명령을 실행하여 업데이트된 머신 세트에서 관리하는 머신을 나열합니다.
oc get -n openshift-machine-api machines -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
$ oc get -n openshift-machine-api machines -l machine.openshift.io/cluster-api-machineset=<machine_set_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 삭제가 진행되는 동안 출력 예
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 삭제가 완료되면 출력 예
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 업데이트된 머신 세트로 생성된 머신에 올바른 구성이 있는지 확인하려면 다음 명령을 실행하여 새 머신 중 하나에 대해 CR의 관련 필드를 검사합니다.
oc describe machine <machine_name_updated_1> -n openshift-machine-api
$ oc describe machine <machine_name_updated_1> -n openshift-machine-api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow