이 페이지에서는 AWS IAM 인스턴스 프로필의 정의, AWS용 GKE에서 중요한 이유, 인스턴스 프로필을 업데이트하는 방법을 설명합니다.
AWS IAM 인스턴스 프로필은 무엇인가요?
인스턴스 프로필은 AWS와 관련된 개념입니다. Amazon EC2 인스턴스가 다양한 AWS 리소스에 액세스하기 위해 사용하는 일련의 사용자 인증 정보입니다.
보다 구체적으로, 인스턴스 프로필은 EC2 인스턴스에 연결할 수 있는 IAM 역할에 대한 일종의 컨테이너입니다. 인스턴스 프로필은 EC2 인스턴스에 대한 권한을 부여하여 인스턴스가 정의된 권한 하에서 다양한 AWS 서비스와 상호작용할 수 있게 합니다. 자세한 내용은 인스턴스 프로필 사용을 참조하세요.
AWS용 GKE에서 인스턴스 프로필이 어떻게 사용되나요?
AWS용 GKE 클러스터에서 각 컨트롤 플레인과 각 노드 풀은 고유한 AWS 인스턴스 프로필과 연결됩니다. AWS용 GKE의 인스턴스 프로필은 두 가지 목적을 제공합니다.
인스턴스 프로필은 AWS용 GKE에 AWS 리소스 관리에 필요한 권한을 부여합니다. 예를 들어 워크로드 수요에 따라 EC2 인스턴스를 추가하거나 삭제하여 클러스터를 확장하는 데 필요한 권한을 클러스터 자동 확장 처리에 부여합니다.
인스턴스 프로필은 EC2 인스턴스에 Google Cloud 서비스에 대한 액세스 권한을 부여합니다.
예를 들어 AWS 머신에서 실행되는 kubelet은 containerd에 이미지 가져오기 사용자 인증 정보를 제공하기 위해 특정 권한이 필요합니다. 이러한 사용자 인증 정보는 Google 비공개 Artifact Registry 또는 Container Registry에서 이미지를 액세스하고 가져오기 위해 필요합니다. AWS용 GKE에서 클러스터와 연결된 EC2 인스턴스 프로필은 Google의 머신 서비스 에이전트(예: 노드 풀 머신 서비스 에이전트 또는 제어 영역 머신 서비스 에이전트)를 가장하도록 구성됩니다. 이러한 가장을 통해 클러스터의 EC2 인스턴스가 Google Artifact Registry 또는 Container Registry에 자동으로 인증을 수행할 수 있습니다.
인스턴스 프로필 업데이트
인스턴스 프로필을 업데이트하면 특정 권한을 사용해서 AWS에서 새 인스턴스 프로필을 만들고 이를 AWS용 GKE 클러스터 또는 노드 풀에 연결합니다.
클러스터 또는 노드 풀의 인스턴스 프로필을 올바르게 업데이트하려면 다음 단계를 수행합니다.
Amazon EC2 인스턴스에 대해 IAM 인스턴스 프로필을 만들고 필요한 IAM 역할을 인스턴스 프로필에 추가합니다. 자세한 내용은 인스턴스 프로필 사용을 참조하세요.
Google Cloud CLI에서 다음 명령어를 실행하여 AWS용 GKE 클러스터 또는 노드 풀에 새 인스턴스 프로필을 연결합니다.
NEW_INSTANCE_PROFILE_NAME: 사용자가 만든 새 AWS 인스턴스 프로필의 이름입니다.
이 명령어는 인스턴스 프로필 업데이트와 관련된 플래그만 표시하지만 update 명령어를 실행하기 위해 추가 플래그를 제공해야 합니다. 자세한 내용은 AWS 클러스터 매개변수 업데이트 또는 노드 풀 업데이트를 참조하세요.
잘못된 업데이트 방법
클러스터 오류를 일으키기 쉽기 때문에 인스턴스 프로필을 잘못 업데이트하는 방법을 이해하는 것이 중요합니다.
인스턴스 프로필을 업데이트하는 잘못된 방법은 AWS 관리 콘솔 또는 AWS CLI를 사용해서 기존 인스턴스 프로필을 직접 수정하는 것입니다. 이러한 변경사항은 AWS 리소스와 AWS용 GKE의 상호작용을 중단시킬 수 있습니다. AWS용 GKE는 인스턴스 프로필이 처음 클러스터 또는 노드 풀에 연결되었을 때와 동일하게 유지될 것으로 예상합니다. AWS용 GKE 관리 도구 외부에서 이를 변경하면 인스턴스 프로필에 있는 IAM 역할의 ID와 불일치가 발생할 수 있습니다. 이러한 불일치로 인해 클러스터 오류가 발생할 수 있습니다.
이전 섹션에 설명된 방식을 사용하면 AWS용 GKE와 AWS의 통합을 중단하지 않으면서 업데이트를 수행할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-01(UTC)"],[],[],null,["# Update AWS IAM instance profile\n\nThis page explains what an AWS IAM instance profile is, why it's important in\nthe context of GKE on AWS, and how to update the instance profile.\n\nWhat is an AWS IAM instance profile?\n------------------------------------\n\nAn instance profile is an AWS-specific concept. It consists of a set of\ncredentials that an Amazon EC2 instance uses to access various AWS resources.\nMore specifically, an instance profile is a kind of container for an IAM role\nthat can be attached to an EC2 instance. An instance profile confers permissions\nto the EC2 instance, allowing the instance to interact with various AWS services\nunder the defined permissions. For more information, see\n[Using instance profiles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html).\n\nHow are instance profiles used in GKE on AWS?\n---------------------------------------------\n\nEach control plane and each node pool within a GKE on AWS cluster\nis associated with a unique AWS instance profile. Instance profiles in\nGKE on AWS serve a dual purpose:\n\n1. An instance profile grants GKE on AWS the permissions needed to manage AWS resources. For example, they give the cluster autoscaler the necessary permissions to scale the cluster by adding or removing EC2 instances based on workload demands.\n2. An instance profile grants EC2 instances access to Google Cloud services. For example the `kubelet`, running on an AWS machine, requires specific permissions to supply image pull credentials to `containerd`. These credentials are necessary for accessing and pulling images from Google's private Artifact Registry or from Container Registry. In the context of GKE on AWS, the EC2 instance profile associated with the cluster is configured to impersonate Google's Machine Service Agents (such as the Node Pool Machine Service Agent or the Control Plane Machine Service Agent). This impersonation allows the cluster's EC2 instances to automatically authenticate with Google's Artifact Registry or Container Registry.\n\nUpdate instance profile\n-----------------------\n\nUpdating the instance profile involves creating a new instance profile in AWS\nwith specific permissions, and then associating it with your\nGKE on AWS cluster or node pool.\n\nTo correctly update the instance profile for your cluster or node pool, follow\nthese steps:\n\n1. Create an IAM instance profile for your Amazon EC2 instances and add the IAM role you need to the instance profile. For details, see [Using instance profiles](https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-create-iam-instance-profile.html).\n2. Link the new instance profile to your GKE on AWS cluster or node\n pool by running the following command in your Google Cloud CLI:\n\n ### Link profile to cluster\n\n gcloud container aws clusters update \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --update-instance-profile \\\n --instance-profile-name \u003cvar translate=\"no\"\u003eNEW_INSTANCE_PROFILE_NAME\u003c/var\u003e \\\n ...\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your cluster\n - \u003cvar translate=\"no\"\u003eNEW_INSTANCE_PROFILE_NAME\u003c/var\u003e: the name of the new AWS instance profile you created\n\n ### Link profile to node pool\n\n gcloud container aws node-pools update \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e \\\n --update-instance-profile \\\n --instance-profile-name \u003cvar translate=\"no\"\u003eNEW_INSTANCE_PROFILE_NAME\u003c/var\u003e \\\n ...\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: the name of your node pool\n - \u003cvar translate=\"no\"\u003eNEW_INSTANCE_PROFILE_NAME\u003c/var\u003e: the name of the new AWS instance profile you created\n\n These commands show only the relevant flags for updating the instance\n profile, but you need to provide additional flags in order to run the\n `update` command. For details, see\n [Update your AWS cluster parameters](/kubernetes-engine/multi-cloud/docs/aws/how-to/update-cluster) or\n [Update a node pool](/kubernetes-engine/multi-cloud/docs/aws/how-to/update-node-pool).\n\n### The incorrect update method\n\nUnderstanding the wrong way to update an instance profile is important, because\nit's an easy mistake to make that can cause cluster failures.\n\nThe wrong way to update an instance profile is to directly modify an existing\ninstance profile using the AWS Management Console or AWS CLI. Such changes can\ndisrupt GKE on AWS interaction with AWS resources. GKE on AWS\nexpects instance profiles to remain as they were when first linked to the\ncluster or node pool. Altering them outside of GKE on AWS's management\ntools can create a mismatch with the ID of the IAM role that's in the instance\nprofile. This mismatch can create a cluster failure.\n\nThe approach described in the preceding section ensures that updates are made\nwithout disrupting GKE on AWS's integration with AWS."]]