[[["易于理解","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-03。"],[],[],null,["This document describes how to use the `bmctl get` command to retrieve important\nconfiguration and credential information for your existing clusters. This\ninformation can be helpful in troubleshooting cluster problems.\n\nGet cluster configuration details\n\nAfter you create\n[admin](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/creating-clusters/admin-cluster-creation),\n[hybrid](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/creating-clusters/hybrid-cluster-creation),\n[standalone](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/creating-clusters/standalone-cluster-creation),\nor [user](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/creating-clusters/user-cluster-creation)\nclusters you can use the `bmctl get config` command to retrieve the cluster\nconfiguration details.\n\nUse the following command to retrieve all custom resources for a self-managing\ncluster, such as an admin cluster: \n\n bmctl get config --cluster \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --kubeconfig \u003cvar translate=\"no\"\u003eADMIN_KUBECONFIG_PATH\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the target cluster.\n\n- \u003cvar translate=\"no\"\u003eADMIN_KUBECONFIG_PATH\u003c/var\u003e: the path to the admin cluster\n `kubeconfig` file.\n\nUse the following command to retrieve all custom resources for a user cluster:\n\nNote that `bmctl` supports the use of `--kubeconfig` as an alias for the\n`--admin-kubeconfig` flag. \n\n bmctl get config --cluster \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --admin-kubeconfig \u003cvar translate=\"no\"\u003eADMIN_KUBECONFIG_PATH\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the target user cluster.\n\n- \u003cvar translate=\"no\"\u003eADMIN_KUBECONFIG_PATH\u003c/var\u003e: the path to the admin cluster\n `kubeconfig` file.\n\nFor both commands, the custom resources are written to a YAML file named:\n`bmctl-workspace/`\u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e`-`\u003cvar translate=\"no\"\u003eTIMESTAMP\u003c/var\u003e`.yaml`.\nThe \u003cvar translate=\"no\"\u003eTIMESTAMP\u003c/var\u003e in the filename indicates the date and time the file\nwas created.\n\nThe YAML file produced by the `bmctl get config` command looks similar to the\nfollowing example: \n\n ---\n apiVersion: v1\n kind: Namespace\n metadata:\n name: cluster-admin1\n ---\n apiVersion: baremetal.cluster.gke.io/v1\n kind: Cluster\n metadata:\n name: admin1\n namespace: cluster-admin1\n spec:\n clusterNetwork:\n services:\n cidrBlocks:\n - 10.96.0.0/20\n pods:\n cidrBlocks:\n - 192.168.0.0/16\n controlPlane:\n nodePoolSpec:\n nodes:\n - address: 172.18.0.13\n loadBalancer:\n mode: bundled\n ports:\n controlPlaneLBPort: 6443\n vips:\n controlPlaneVIP: 172.18.0.254\n storage:\n lvpShare:\n path: /mnt/localpv-share/\n storageclassname: standard\n numpvundersharedpath: 5\n lvpNodeMounts:\n path: /mnt/localpv-disk\n storageclassname: node-disk\n authentication:\n oidc:\n issuerURL: https://accounts.google.com\n kubectlRedirectURL: http://localhost:9879/callback\n clientID: 611080206796-9qq355g2q1coed5t78ckfmm1c6ini3et.apps.googleusercontent.com\n clientSecret: FTPbx3INYJcxBSQhMRlbk3tX\n username: email\n scopes: email\n extraParams: prompt=consent,access_type=offline\n clusterOperations:\n projectID: baremetal-test\n location: us-central1\n type: admin\n anthosBareMetalVersion: 0.0.0\n bypassPreflightCheck: false\n ---\n apiVersion: baremetal.cluster.gke.io/v1\n kind: NodePool\n metadata:\n name: nodepool1\n namespace: cluster-admin1\n spec:\n clusterName: admin1\n nodes:\n - address: 172.18.0.9\n\nGet cluster credentials\n\nUse the `bmctl get credentials` command to retrieve credentials for a given\nuser cluster.\n\nTo retrieve all custom resources for a user cluster, use the following command:\n\nNote that `bmctl` supports the use of `--kubeconfig` as an alias for the\n`--admin-kubeconfig` flag. \n\n bmctl get credentials --cluster \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --admin-kubeconfig \u003cvar translate=\"no\"\u003eADMIN_KUBECONFIG_PATH\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the target user cluster.\n\n- \u003cvar translate=\"no\"\u003eADMIN_KUBECONFIG_PATH\u003c/var\u003e: the path to the admin cluster `kubeconfig`\n file.\n\nThe cluster's credentials are written to a file,\n`bmctl-workspace/`\u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e`-`\u003cvar translate=\"no\"\u003eTIMESTAMP\u003c/var\u003e`-kubeconfig`.\nThe \u003cvar translate=\"no\"\u003eTIMESTAMP\u003c/var\u003e in the filename indicates the date and time the file\nwas created.\n\nBecause this file contains authentication credentials for your\ncluster, you should store it in a secure location with restricted access.\n\nWhat's next\n\nIf you need additional assistance, reach out to\n\n[Cloud Customer Care](/support-hub).\nYou can also see\n[Getting support](/kubernetes-engine/distributed-cloud/bare-metal/docs/getting-support) for more information about support resources, including the following:\n\n- [Requirements](/kubernetes-engine/distributed-cloud/bare-metal/docs/getting-support#intro-support) for opening a support case.\n- [Tools](/kubernetes-engine/distributed-cloud/bare-metal/docs/getting-support#support-tools) to help you troubleshoot, such as your environment configuration, logs, and metrics.\n- Supported [components](/kubernetes-engine/distributed-cloud/bare-metal/docs/getting-support#what-we-support)."]]