이 페이지에서는 Google Distributed Cloud (GDC) 오프라인 어플라이언스 Kubernetes 클러스터에서 실행되는 기존 스테이트풀 워크로드를 업데이트하는 방법을 설명합니다. 리소스 사용량 및 구성 최적화에 따라 애플리케이션이 발전함에 따라 Kubernetes 클러스터에서 기본 포드 사양을 업데이트하여 이러한 워크로드 변경사항을 반영해야 합니다. 스테이트풀 워크로드 업데이트 계획에 대한 자세한 내용은 Kubernetes 문서의 업데이트 전략을 참고하세요.
이 페이지는 조직의 애플리케이션 워크로드를 업데이트하는 애플리케이션 운영자 그룹의 개발자를 위한 페이지입니다.
시작하기 전에
사전 구성된 베어메탈 Kubernetes 클러스터에 대해 명령어를 실행하려면 다음 리소스가 있어야 합니다.
Kubernetes 클러스터 이름을 찾거나 플랫폼 관리자에게 클러스터 이름을 문의합니다.
Kubernetes 클러스터의 kubeconfig 파일이 없는 경우 로그인 및 생성합니다.
Kubernetes 클러스터의 kubeconfig 경로를 사용하여 이 안내의 CLUSTER_KUBECONFIG를 바꿉니다.
스테이트풀 워크로드를 업데이트하는 데 필요한 권한을 얻으려면 조직 IAM 관리자에게 프로젝트 네임스페이스의 네임스페이스 관리자 역할 (namespace-admin)을 부여해 달라고 요청하세요.
StatefulSet 리소스 업데이트
StatefulSet을 업데이트하려면 신규 또는 업데이트된 매니페스트 파일을 적용하세요. 이 방법은 확장하거나 애플리케이션의 새 버전을 지정하는 등 StatefulSet를 다양하게 변경하는 경우에 유용합니다.
[[["이해하기 쉬움","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\u003e\u003ccode\u003eStatefulSet\u003c/code\u003e objects can be updated using either the \u003ccode\u003eOnDelete\u003c/code\u003e or \u003ccode\u003eRollingUpdate\u003c/code\u003e strategies, with \u003ccode\u003eRollingUpdate\u003c/code\u003e being the default method that automatically recreates \u003ccode\u003ePod\u003c/code\u003e objects upon configuration changes, ensuring the new \u003ccode\u003ePod\u003c/code\u003es are running and ready before deleting the old ones.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eStatefulSet\u003c/code\u003e objects use a sequential ordinal index for identifying and ordering their \u003ccode\u003ePod\u003c/code\u003e objects, where by default, pods are deployed sequentially and terminated in reverse order, ensuring a controlled update process.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekubectl apply\u003c/code\u003e command is a common declarative way to update a \u003ccode\u003eStatefulSet\u003c/code\u003e by applying a new or updated manifest file, and can also create the resource if it doesn't already exist.\u003c/p\u003e\n"],["\u003cp\u003eYou can monitor the update rollout of a \u003ccode\u003eStatefulSet\u003c/code\u003e by using \u003ccode\u003ekubectl rollout status\u003c/code\u003e and \u003ccode\u003ekubectl rollout history\u003c/code\u003e commands, allowing for detailed inspection of the process, and the ability to undo the rollout with \u003ccode\u003ekubectl rollout undo\u003c/code\u003e if necessary.\u003c/p\u003e\n"],["\u003cp\u003eBy setting \u003ccode\u003epodManagementPolicy: Parallel\u003c/code\u003e, you can have a \u003ccode\u003eStatefulSet\u003c/code\u003e launch and terminate all of its \u003ccode\u003ePod\u003c/code\u003e objects simultaneously, rather than sequentially.\u003c/p\u003e\n"]]],[],null,["# Update stateful workloads\n\nThis page explains how to update existing stateful workloads running in a\nGoogle Distributed Cloud (GDC) air-gapped appliance 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. For more information on planning updates for stateful workloads, see\nthe Kubernetes documentation for\n[Update strategies](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies).\n\nThis page is for developers within the application operator group, who are\nresponsible for updating application workloads for their organization.\n\nBefore you begin\n----------------\n\nTo run commands against the pre-configured bare metal Kubernetes cluster, make sure you have the\nfollowing resources:\n\n1. Locate the Kubernetes cluster name, or ask your Platform\n Administrator what the cluster name is.\n\n2. [Sign in and generate](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/iam/sign-in#kubernetes-cluster-kubeconfig) the\n 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\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e in these instructions.\n\nTo get the required permissions to update stateful workloads, ask your\nOrganization IAM Admin to grant you the Namespace Admin role (`namespace-admin`)\nin your project namespace.\n\nUpdate a `StatefulSet` resource\n-------------------------------\n\nTo update the `StatefulSet`, apply a new or updated manifest file. This is\nuseful for making various changes to your `StatefulSet` when scaling or for\nspecifying a new version of your application.\n\nTo update a `StatefulSet` object, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n apply -f \u003cvar translate=\"no\"\u003eSTATEFULSET_FILE\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for\n the Kubernetes cluster running the stateful workloads.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eSTATEFULSET_FILE\u003c/var\u003e: the name of the updated\n `StatefulSet` manifest file.\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\nInspect a `StatefulSet` resource update rollout\n-----------------------------------------------\n\nYou can view detailed information regarding the update rollout status and\nhistory of a `StatefulSet` object. You can also undo a rollout of a\n`StatefulSet` object.\n\n### Inspect the rollout\n\nTo inspect the rollout of the `StatefulSet` resource, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n rollout status statefulset \u003cvar translate=\"no\"\u003eSTATEFULSET_NAME\u003c/var\u003e\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for\n the Kubernetes cluster running the stateful workloads.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eSTATEFULSET_NAME\u003c/var\u003e: the name of the updated\n `StatefulSet` object.\n\n### Get the rollout history\n\nTo see the `StatefulSet` resource's rollout history, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n rollout history statefulset \u003cvar translate=\"no\"\u003eSTATEFULSET_NAME\u003c/var\u003e\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for\n the Kubernetes cluster running the stateful workloads.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eSTATEFULSET_NAME\u003c/var\u003e: the name of the updated\n `StatefulSet` object.\n\n### Undo a rollout\n\nTo undo a rollout, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n rollout undo statefulset \u003cvar translate=\"no\"\u003eSTATEFULSET_NAME\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for\n the Kubernetes cluster running the stateful workloads.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eSTATEFULSET_NAME\u003c/var\u003e: the name of the `StatefulSet`\n object."]]