[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eYou can use \u003ccode\u003ekubectl\u003c/code\u003e commands to inspect and retrieve detailed information about a \u003ccode\u003eStatefulSet\u003c/code\u003e object, including its configuration and managed resources.\u003c/p\u003e\n"],["\u003cp\u003eTo obtain detailed information about a \u003ccode\u003eStatefulSet\u003c/code\u003e, you can utilize the \u003ccode\u003ekubectl describe statefulset\u003c/code\u003e command, specifying the \u003ccode\u003eStatefulSet\u003c/code\u003e name and user cluster's kubeconfig.\u003c/p\u003e\n"],["\u003cp\u003eThe live configuration of a \u003ccode\u003eStatefulSet\u003c/code\u003e can be displayed in YAML format by using the command \u003ccode\u003ekubectl get statefulset -o yaml\u003c/code\u003e, along with the \u003ccode\u003eStatefulSet\u003c/code\u003e name and the user cluster kubeconfig.\u003c/p\u003e\n"],["\u003cp\u003eYou can list the pods, PersistentVolumeClaims (PVCs), and PersistentVolumes (PVs) associated with a \u003ccode\u003eStatefulSet\u003c/code\u003e by using \u003ccode\u003ekubectl get\u003c/code\u003e with the appropriate flags and object names.\u003c/p\u003e\n"],["\u003cp\u003eSpecific information about a pod, PVC or PV can be obtained using \u003ccode\u003ekubectl describe\u003c/code\u003e with the name of the pod, PVC, or PV and the user cluster's kubeconfig.\u003c/p\u003e\n"]]],[],null,["# Inspect stateful workloads\n\nThis page explains how to inspect existing stateful workloads running in a\nGoogle Distributed Cloud (GDC) air-gapped appliance Kubernetes cluster. Stateful workloads let you\nrun your application with persistent container storage. You can view your\nstateful workloads with the GDC console or the kubectl CLI to monitor\nresource usage and workload health.\n\nThis page is for developers within the application operator group, who are\nresponsible for managing 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 view all workloads deployed in a project, ask\nyour Organization IAM Admin to grant you the Workload Viewer role\n(`workload-viewer`) in your project namespace.\n\nTo get the required permissions to inspect stateful workloads, ask your\nOrganization IAM Admin to grant you the Namespace Admin role (`namespace-admin`)\nin your project namespace.\n\nView a project's container workloads\n------------------------------------\n\nRun the following command to list all pods in your project: \n\n kubectl get pods -n \u003cvar translate=\"no\"\u003ePROJECT_NAMESPACE\u003c/var\u003e\n\nThe output is similar to the following: \n\n NAME READY STATUS RESTARTS AGE\n nginx-workload-ah-aa-1228 1/1 Running 0 12h\n nginx-workload-ah-ab-6784 1/1 Running 0 11h\n nginx-workload-ah-ac-0045 1/1 Running 0 12h\n\nInspect a `StatefulSet` resource\n--------------------------------\n\nTo request more detailed information about the components of a `StatefulSet`\nresource, run commands that directly target the entity you're looking to\ninspect.\n\n### Get `StatefulSet` object information\n\nTo get detailed information about the `StatefulSet` object, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n describe 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 `StatefulSet` object.\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.\n\n### Display live configuration in YAML format\n\nTo display the live configuration of the `StatefulSet` resource in YAML format,\nrun: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n get statefulset \u003cvar translate=\"no\"\u003eSTATEFULSET_NAME\u003c/var\u003e -o yaml\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file for\n the Kubernetes cluster running the `StatefulSet` object.\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.\n\n### List pods\n\nTo list the `Pod` objects created by the `StatefulSet`, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n get pods -l app=\u003cvar translate=\"no\"\u003eAPP_NAME\u003c/var\u003e\n\nIn this command, the `-l` flag lists all `Pod` objects labeled with\n\u003cvar translate=\"no\"\u003eAPP_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 `StatefulSet` object.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003eAPP_NAME\u003c/var\u003e: the name of the stateful application\n managed by the `StatefulSet` object.\n\n### Get specific pod information\n\nTo get information about a specific `Pod` in the cluster, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n describe pod \u003cvar translate=\"no\"\u003ePOD_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 pod.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003ePOD_NAME\u003c/var\u003e: the name of the pod managed by the\n `StatefulSet` object.\n\n### List PVCs\n\nTo list the `PersistentVolumeClaim` (PVC) objects in the cluster, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n get pvc\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e: the kubeconfig file of\n the Kubernetes cluster running the PVCs.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n### Get specific PVC information\n\nTo get information about a specific `PersistentVolumeClaim` (PVC) in the\ncluster, run: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n describe pvc \u003cvar translate=\"no\"\u003ePVC_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 PVC.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003ePVC_NAME\u003c/var\u003e: the name of the PVC configured for the\n `StatefulSet` object.\n\n### Get PV information\n\nTo get information about a specific `PersistentVolume` (PV) in the cluster,\nrun: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e -n \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e \\\n describe pv \u003cvar translate=\"no\"\u003ePV_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 PV.\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace.\n\n- \u003cvar translate=\"no\"\u003ePV_NAME\u003c/var\u003e: the name of the PV configured for the\n `StatefulSet` object."]]