VMM API에는 kubectl
CLI를 사용합니다.
서비스 엔드포인트
VMM API의 API 엔드포인트는 https://MANAGEMENT_API_SERVER_ENDPOINT/apis/virtualmachine.gdc.goog/v1
입니다. 여기서 MANAGEMENT_API_SERVER_ENDPOINT
은 관리 API 서버의 엔드포인트입니다.
검색 문서
kubectl proxy
명령어를 사용하여 로컬 머신에서 API 서버로의 프록시를 엽니다. 여기에서 다음 URL(http://127.0.0.1:8001/apis/virtualmachine.gdc.goog/v1
)의 검색 문서에 액세스할 수 있습니다.
VM KRM의 예
다음 VirtualMachineImageImport
파일은 영구 디스크에서 디스크 이미지를 만드는 방법을 보여줍니다. VirtualMachineDisk
목록에서 영구 디스크를 선택하고 이를 선택하여 이미지를 만들고 소스의 size
매개변수를 가져옵니다. 동일한 예가 커스텀 이미지 만들기 페이지에 있습니다.
apiVersion: virtualmachine.gdc.goog/v1
kind: VirtualMachineImageImport
metadata:
name: VM_IMAGE_IMPORT_NAME
# Name of the VM image you want to import.
spec:
source:
diskRef:
name: DISK_NAME
# Name of the source disk that you will use to create your image.
imageMetadata:
name: IMAGE_NAME
# Name of your created VM image.
operatingSystem: OS_NAME
# Name of the image OS. Select one of the following four options: ubuntu-2004, windows-2019, rhel-8, or rocky-linux-8.
minimumDiskSize: MINIMUM_DISK_SIZE
# Disk size in the VM image. It must be greater than or equal to the source disk size. An example value is 20G.