이 페이지에서는 Google Distributed Cloud (GDC) 오프라인 Kubernetes 클러스터에서 실행되는 기존 스테이트리스 워크로드를 업데이트하는 방법을 설명합니다. 리소스 사용량 및 구성 최적화에 따라 애플리케이션이 발전함에 따라 Kubernetes 클러스터에서 기본 포드 사양을 업데이트하여 이러한 워크로드 변경사항을 반영해야 합니다.
이 페이지는 조직의 애플리케이션 워크로드를 업데이트하는 애플리케이션 운영자 그룹의 개발자를 위한 페이지입니다. 자세한 내용은 GDC 오프라인 문서 대상을 참고하세요.
[[["이해하기 쉬움","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-04(UTC)"],[[["\u003cp\u003eYou can update a \u003ccode\u003eDeployment\u003c/code\u003e object's pod specification, including its image, resource usage, requests, or configuration, by applying a new or updated manifest file.\u003c/p\u003e\n"],["\u003cp\u003eUpdating a container image within a deployment involves using the \u003ccode\u003ekubectl set image\u003c/code\u003e command, which is useful for changing selector fields or resources like requests and limits.\u003c/p\u003e\n"],["\u003cp\u003eTo update a \u003ccode\u003eDeployment\u003c/code\u003e object you will use the \u003ccode\u003ekubectl apply\u003c/code\u003e command by providing a \u003ccode\u003eDEPLOYMENT_FILE\u003c/code\u003e to the command along with the proper kubeconfig and namespace.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekubectl rollout undo\u003c/code\u003e command enables you to roll back a \u003ccode\u003eDeployment\u003c/code\u003e object update to its previous revision or to a specific revision number, preserving the deployment's rollout history for easy recovery.\u003c/p\u003e\n"]]],[],null,["# Update stateless workloads\n\nThis page explains how to update existing stateless workloads running in a\nGoogle Distributed Cloud (GDC) air-gapped Kubernetes cluster. As your application evolves\nbased on resource usage and configuration optimizations, you must update your\nunderlying pod specification in the Kubernetes cluster to reflect those workload\nchanges.\n\nThis page is for developers within the application operator group, who are\nresponsible for updating application workloads for their organization. For more\ninformation, see\n[Audiences for GDC air-gapped documentation](/distributed-cloud/hosted/docs/latest/gdch/resources/audiences).\n\nBefore you begin\n----------------\n\nTo run commands against a\n[Kubernetes cluster](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/clusters#cluster-architecture),\nmake sure you have the following resources:\n\n1. Locate the Kubernetes cluster name, or ask your Platform Administrator what\n the cluster name is.\n\n2. [Sign in and generate](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/iam/sign-in#zonal-cluster-kubeconfig)\n the kubeconfig file for the Kubernetes cluster if you don't have one.\n\n3. Use the kubeconfig path of the Kubernetes cluster to replace\n \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e in these instructions.\n\nTo get the required permissions to update stateless workloads, ask your\nOrganization IAM Admin to grant you the Namespace Admin role (`namespace-admin`)\nin your project namespace.\n\nUpdate the deployment\n---------------------\n\nTo update a `Deployment` object, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n apply -f \u003cvar translate=\"no\"\u003eDEPLOYMENT_FILE\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for the\n cluster running the deployment.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_FILE\u003c/var\u003e: the name of the `Deployment`\n manifest file to update.\n\nThe `kubectl apply` command applies a manifest file to a resource. If the\nspecified resource does not exist, it is created by the command.\n\nThere are also several other ways to update resources within your deployment.\n\n### Update a container image\n\nTo change the image of a `Deployment` object, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n set image deployment \u003cvar translate=\"no\"\u003eDEPLOYMENT_NAME\u003c/var\u003e \\\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nv\"\u003eIMAGE\u003c/span\u003e\u003c/var\u003e=\u003cvar translate=\"no\"\u003eIMAGE\u003c/var\u003e:\u003cvar translate=\"no\"\u003eTAG\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for the\n cluster running the deployment.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_NAME\u003c/var\u003e: the name of the `Deployment` object\n containing the image.\n\n- \u003cvar translate=\"no\"\u003eIMAGE\u003c/var\u003e: the name of the container image.\n\n- \u003cvar translate=\"no\"\u003eTAG\u003c/var\u003e: the tag to update for the container image.\n\nUpdating the image of a deployment is useful to change selector fields or\nresources, such as requests or limits.\n\nFor example, to update a `Deployment` object named `nginx` to use version\n`1.9.1`, run: \n\n kubectl --kubeconfig /tmp/kubeconfig.yaml -n my-namespace \\\n set image deployment nginx nginx=nginx:1.9.1\n\n### Roll back an update\n\nIf you want to roll back an update, such as when your deployment becomes\nunstable, use the `kubectl` CLI. A `Deployment` object's rollout history is\npreserved in the system so you can roll back at any time.\n\nTo roll back an in-progress or completed update to its previous revision,\nrun: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e \\\n -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n rollout undo deployment \u003cvar translate=\"no\"\u003eDEPLOYMENT_NAME\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for the\n cluster running the deployment.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_NAME\u003c/var\u003e: the name of the `Deployment` object\n to roll back.\n\nTo roll back to a specific revision, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e \\\n -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n rollout undo deployment \u003cvar translate=\"no\"\u003eDEPLOYMENT_NAME\u003c/var\u003e \\\n --to-revision=\u003cvar translate=\"no\"\u003eREVISION_NUMBER\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eKUBERNETES_CLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for the\n cluster running the deployment.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_NAME\u003c/var\u003e: the name of the `Deployment` object\n to roll back.\n\n- \u003cvar translate=\"no\"\u003eREVISION_NUMBER\u003c/var\u003e: the integer that defines the\n revision to roll back to, such as `3`."]]