이 문서에서는 Google Kubernetes Engine(GKE) Autopilot 클러스터에서 고유한 하드웨어 요구사항이 있는 워크로드를 실행하기 위해 특정 컴퓨팅 클래스를 선택하는 방법을 보여줍니다. 이 문서를 읽기 전에 GKE Autopilot의 컴퓨팅 클래스 개념을 숙지하세요.
Autopilot 컴퓨팅 클래스 개요
Autopilot은 특정 하드웨어 요구사항이 있는 워크로드를 실행하도록 설계된 컴퓨팅 클래스를 제공합니다. 이러한 컴퓨팅 클래스는 머신러닝 및 AI 작업과 같은 워크로드나 트래픽이 많은 실시간 데이터베이스를 실행하는 데 유용합니다.
이 컴퓨팅 클래스는 Compute Engine 머신 시리즈의 하위 집합이며 기본 Autopilot 범용 컴퓨팅 클래스 이상의 유연성을 제공합니다.
예를 들어 Scale-Out 클래스는 동시 멀티 스레딩을 사용 중지하여 각 vCPU가 하나의 물리적 코어가 됩니다.
개별 포드 요구사항에 따라 일반 Autopilot 포드 또는 Spot 포드를 구성하여 이러한 컴퓨팅 클래스가 지원되는 노드를 요청할 수 있습니다. 또한 해당 아키텍처를 지원하는 컴퓨팅 클래스에서 ARM과 같은 특정 CPU 아키텍처를 요청할 수도 있습니다.
컴퓨팅 클래스를 선택할 때는 선택한 클래스의 최소 및 최대 리소스 요청을 기준으로 포드에 대한 리소스 요청을 지정해야 합니다. 요청이 최솟값보다 적으면 Autopilot이 자동으로 요청을 확장합니다. 하지만 요청이 최댓값보다 크면 Autopilot은 포드를 배포하지 않고 오류 메시지를 표시합니다.
CPU 아키텍처 선택
일부 컴퓨팅 클래스는 여러 CPU 아키텍처를 지원합니다. 예를 들어 Scale-Out 클래스는 Arm 및 x86 아키텍처를 모두 지원합니다. 특정 아키텍처를 요청하지 않으면 Autopilot이 지정된 컴퓨팅 클래스의 기본 아키텍처가 있는 노드를 프로비저닝합니다. 포드가 다른 아키텍처를 사용해야 하는 경우 노드 선택기 또는 노드 어피니티 규칙에서 컴퓨팅 클래스 요청과 함께 해당 아키텍처를 요청합니다. 요청한 컴퓨팅 클래스는 지정된 CPU 아키텍처를 지원해야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-11-25(UTC)"],[],[],null,["# Choose compute classes for Autopilot Pods\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview)\n\n*** ** * ** ***\n\nThis document shows you how to select specific compute classes to run workloads that\nhave unique hardware requirements in your Google Kubernetes Engine (GKE)\nAutopilot clusters. Before reading this document,\nensure that you're familiar with the concept\nof [compute classes in GKE Autopilot](/kubernetes-engine/docs/concepts/autopilot-compute-classes).\n\nOverview of Autopilot compute classes\n-------------------------------------\n\nAutopilot offers *compute classes* that are designed to run\nworkloads that have specific hardware requirements. These compute classes are\nuseful for workloads such as machine learning and AI tasks, or running real-time\nhigh traffic databases.\n\nThese compute classes are a subset of the Compute Engine\n[machine series](/compute/docs/machine-types#machine_type_comparison), and offer\nflexibility beyond the default Autopilot general-purpose compute class.\nFor example, the `Scale-Out` class turns off simultaneous multi-threading so that each\nvCPU is one physical core.\n\nBased on your individual Pod needs, you can configure your regular\nAutopilot Pods or your Spot Pods to request nodes backed by\nthese compute classes. You can also request specific CPU architecture, such as\n[Arm](https://www.arm.com/architecture), in compute classes that\nsupport that architecture.\n\nBefore you begin\n----------------\n\nBefore you start, make sure that you have performed the following tasks:\n\n- Enable the Google Kubernetes Engine API.\n[Enable Google Kubernetes Engine API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n- If you want to use the Google Cloud CLI for this task, [install](/sdk/docs/install) and then [initialize](/sdk/docs/initializing) the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running `gcloud components update`. **Note:** For existing gcloud CLI installations, make sure to set the `compute/region` [property](/sdk/docs/properties#setting_properties). If you use primarily zonal clusters, set the `compute/zone` instead. By setting a default location, you can avoid errors in the gcloud CLI like the following: `One of [--zone, --region] must be supplied: Please specify location`. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.\n\n\u003c!-- --\u003e\n\n- [Ensure that you have a GKE Autopilot cluster](/kubernetes-engine/docs/how-to/creating-an-autopilot-cluster) running GKE version 1.24.1-gke.1400 or later.\n\nRequest a compute class in your Autopilot Pod\n---------------------------------------------\n\nTo tell Autopilot to place your Pods on a specific compute class, specify the `cloud.google.com/compute-class` label in a [nodeSelector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) or a [node affinity rule](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity), such as in the following examples:\n\n### nodeSelector\n\n```yaml\n apiVersion: apps/v1\n kind: Deployment\n metadata:\n name: hello-app\n spec:\n replicas: 3\n selector:\n matchLabels:\n app: hello-app\n template:\n metadata:\n labels:\n app: hello-app\n spec:\n nodeSelector:\n cloud.google.com/compute-class: \"\u003cvar translate=\"no\"\u003eCOMPUTE_CLASS\u003c/var\u003e\"\n containers:\n - name: hello-app\n image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0\n resources:\n requests:\n cpu: \"2000m\"\n memory: \"2Gi\"\n \n```\n\nReplace \u003cvar translate=\"no\"\u003eCOMPUTE_CLASS\u003c/var\u003e with the name of the [compute class](/kubernetes-engine/docs/concepts/autopilot-compute-classes#when-to-use)\nbased on your use case, such as `Scale-Out`. If you select `Accelerator`,\nyou must also specify a compatible GPU. For instructions, see [Deploy GPU workloads in Autopilot](/kubernetes-engine/docs/how-to/autopilot-gpus). If\nyou select `Performance`, you can optionally select a Compute Engine machine\nseries in the node selector. If you don't specify a machine series, GKE uses the\nC4 machine series depending on [regional\navailability](/compute/docs/regions-zones#available). For instructions, see [Run CPU-intensive workloads with optimal\nperformance](/kubernetes-engine/docs/how-to/performance-pods).\n\n### nodeAffinity\n\n```yaml\n apiVersion: apps/v1\n kind: Deployment\n metadata:\n name: hello-app\n spec:\n replicas: 3\n selector:\n matchLabels:\n app: hello-app\n template:\n metadata:\n labels:\n app: hello-app\n spec:\n terminationGracePeriodSeconds: 25\n containers:\n - name: hello-app\n image: us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0\n resources:\n requests:\n cpu: \"2000m\"\n memory: \"2Gi\"\n ephemeral-storage: \"1Gi\"\n affinity:\n nodeAffinity:\n requiredDuringSchedulingIgnoredDuringExecution:\n nodeSelectorTerms:\n - matchExpressions:\n - key: cloud.google.com/compute-class\n operator: In\n values:\n - \"\u003cvar translate=\"no\"\u003eCOMPUTE_CLASS\u003c/var\u003e\"\n \n```\n\nReplace \u003cvar translate=\"no\"\u003eCOMPUTE_CLASS\u003c/var\u003e with the name of the\n[compute\nclass](/kubernetes-engine/docs/concepts/autopilot-compute-classes#when-to-use) based on your use case, such as `Scale-Out`. If you select\n`Accelerator`, you must also specify a compatible GPU. For instructions, see [Deploy GPU workloads in Autopilot](/kubernetes-engine/docs/how-to/autopilot-gpus).\nIf you select `Performance`, you can optionally select a\nCompute Engine machine series in the node selector. If you don't specify a machine series, GKE uses the C4\nmachine series depending on [regional\navailability](/compute/docs/regions-zones#available). For instructions, see [Run CPU-intensive workloads with\noptimal performance](/kubernetes-engine/docs/how-to/performance-pods).\n\nYou can also request specific compute classes for your Spot Pods.\n\n### Specify resource requests\n\nWhen you choose a compute class, make sure that you specify resource requests\nfor your Pods based on the\n[Minimum and maximum resource requests](/kubernetes-engine/docs/concepts/autopilot-resource-requests#min-max-requests)\nfor your selected class. If your requests are less than the minimum,\nAutopilot automatically scales your requests up. However, if your\nrequests are greater than the maximum, Autopilot does not deploy your\nPods and displays an error message.\n\nChoose a CPU architecture\n-------------------------\n\nSome compute classes support multiple CPU architectures. For example, the\n`Scale-Out` class supports both Arm and x86 architectures. If you\ndon't request a specific architecture, Autopilot provisions nodes that\nhave the default architecture of the specified compute class. If your Pods need\nto use a different architecture, request that architecture in your node selector\nor node affinity rule, alongside your compute class request. The compute class\nthat you request must support the CPU architecture you specify.\n\nFor instructions, refer to\n[Deploy Autopilot Pods on Arm architecture](/kubernetes-engine/docs/how-to/autopilot-arm-workloads).\n\nWhat's next\n-----------\n\n- [Learn more about Autopilot cluster architecture](/kubernetes-engine/docs/concepts/autopilot-architecture).\n- [Learn about the lifecycle of Pods](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/).\n- [Learn about the available Autopilot compute classes](/kubernetes-engine/docs/concepts/autopilot-compute-classes).\n- [Read about the default, minimum, and maximum resource requests for each\n platform](/kubernetes-engine/docs/concepts/autopilot-resource-requests)."]]