Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per ruotare le chiavi del account di servizio in Google Distributed Cloud, aggiorna le credenziali del cluster esistenti con il comando bmctl. La rotazione di questa chiave del account di servizio
potrebbe avvenire nell'ambito delle tue procedure regolari di aggiornamento delle credenziali o in
risposta a una potenziale esposizione delle chiavi. Quando aggiorni le credenziali del cluster, le nuove informazioni vengono trasmesse ai cluster di amministrazione o ibridi oppure vengono indirizzate automaticamente ai cluster utente interessati gestiti da un cluster di amministrazione.
Credenziali del cluster che possono essere aggiornate
I cluster Google Distributed Cloud richiedono più credenziali al momento della creazione.
Imposti le credenziali nella configurazione del cluster quando crei un cluster amministratore,
autonomo o ibrido. Come indicato in precedenza, i cluster utente sono gestiti
da un cluster di amministrazione (o da un cluster ibrido che funge da amministratore) e riutilizzeranno le
stesse credenziali del cluster di amministrazione.
Puoi aggiornare le seguenti credenziali e i relativi secret
nei cluster Google Distributed Cloud con il comando bmctl:
Chiave privata SSH: utilizzata per l'accesso ai nodi.
Chiave Artifact Registry (anthos-baremetal-gcr): chiave dell'account di servizio
utilizzata per l'autenticazione con Artifact Registry per il pull delle immagini.
Connect agent service account key
(anthos-baremetal-connect): chiave dell'account di servizio utilizzata dai pod di Connect Agent.
Chiave del account di servizio di registrazione di Connect
(anthos-baremetal-register): chiave del service account utilizzata per l'autenticazione con
Hub durante la registrazione o l'annullamento della registrazione di un cluster.
Chiave del account di servizio del servizio Cloud Operations (anthos-baremetal-cloud-ops):
Chiave del service account per l'autenticazione con le API Google Cloud Observability (logging e monitoraggio).
Aggiorna le credenziali con bmctl
Quando crei cluster, Google Distributed Cloud crea i secret Kubernetes
in base alle chiavi delle credenziali. Se generi nuove chiavi, devi aggiornare i
segreti corrispondenti come descritto nei passaggi seguenti. Se il nome o il percorso
delle chiavi cambia, devi aggiornare anche il file di configurazione
del cluster corrispondente.
Prepara i nuovi valori per le credenziali che vuoi aggiornare:
Genera una nuova chiave privata SSH sulla workstation di amministrazione e assicurati che le macchine dei nodi del cluster abbiano la chiave pubblica corrispondente.
Aggiorna la sezione delle credenziali del file di configurazione del cluster con i percorsi
alle nuove chiavi.
Aggiorna i secret del cluster corrispondenti con il comando bmctl update credentials, aggiungendo i flag appropriati.
L'esempio seguente aggiorna le credenziali per una nuova chiave privata SSH:
ADMIN_KUBECONFIG: il percorso del file kubeconfig
del cluster di amministrazione o autogestito.
CLUSTER_NAME: il nome del cluster per cui stai
aggiornando la chiave SSH.
SSH_KEY_PATH: il percorso del file della chiave SSH. Per
impostazione predefinita, bmctl controlla i file di chiave SSH eaccount di serviziot specificati
nel file di configurazione del cluster. Se bmctl trova un file di chiavi scaduto,
il comando non va a buon fine. Se il nuovo file delle chiavi valido si trova in una posizione diversa da quella specificata nel file di configurazione, includi il flag --ignore-validation-errors per evitare questo errore.
Per un elenco completo dei flag che puoi utilizzare con il comando bmctl update
credentials, consulta update
credentials nella documentazione di riferimento del comando bmctl.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-01 UTC."],[],[],null,["To rotate the service account keys in Google Distributed Cloud, you update the\nexisting cluster credentials with the `bmctl` command. This service account key\nrotation might be as part of your regular processes to update credentials, or in\nresponse to a potential exposure of the keys. When you update cluster\ncredentials, the new information is passed to admin or hybrid clusters, or\nautomatically routed to affected user clusters managed by an admin cluster.\n\nCluster credentials that can be updated\n\nGoogle Distributed Cloud clusters require multiple credentials when they are created.\nYou set the credentials in the cluster config when you create an admin,\nstandalone, or hybrid cluster. User clusters, as noted previously, are managed\nby an admin cluster (or a hybrid cluster acting as admin), and will reuse the\nsame credentials from the admin cluster.\n\nFor more information about creating clusters and different cluster types,\nsee [Installation overview: choosing a deployment model](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/install-prep).\n\nYou can update the following credentials, and their corresponding secrets,\nin Google Distributed Cloud clusters with the `bmctl` command:\n\n- **SSH private key**: Used for node access.\n- **Artifact Registry key** (`anthos-baremetal-gcr`): Service account key used to authenticate with Artifact Registry for image pulling.\n- **Connect agent service account key** (`anthos-baremetal-connect`): Service account key used by Connect agent pods.\n- **Connect register service account key** (`anthos-baremetal-register`): Service account key used to authenticate with Hub when registering or unregistering a cluster.\n- **Cloud operations service account key** (`anthos-baremetal-cloud-ops`): Service account key to authenticate with Google Cloud Observability (logging \\& monitoring) APIs.\n\nUpdate credentials with `bmctl`\n\nWhen you create clusters, Google Distributed Cloud creates Kubernetes Secrets\nbased on your credential keys. If you generate new keys, you must update the\ncorresponding Secrets as described in the following steps. If the name or path\nto your keys change, you must also update the corresponding cluster\nconfiguration file.\n\n1. Prepare the new values for the credentials you want to update:\n\n - You can\n [generate new Google service account keys](/iam/docs/keys-create-delete#creating)\n through the Google Cloud CLI or through the Google Cloud console.\n\n - Generate new SSH private key on the admin workstation and make sure the\n cluster node machines have the corresponding public key.\n\n2. Update the credentials section of your cluster configuration file with paths\n to the new keys.\n\n3. Update the corresponding cluster Secrets with the `bmctl update credentials`\n command, adding the appropriate flags.\n\n The following example updates the credentials for a new SSH private key: \n\n bmctl update credentials --kubeconfig \u003cvar translate=\"no\"\u003eADMIN_KUBECONFIG\u003c/var\u003e \\\n --cluster \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --ssh-private-key-path \u003cvar translate=\"no\"\u003eSSH_KEY_PATH\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eADMIN_KUBECONFIG\u003c/var\u003e: the path of the kubeconfig file\n of the admin or self-managing cluster.\n\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the cluster that you're\n updating the SSH key for.\n\n - \u003cvar translate=\"no\"\u003eSSH_KEY_PATH\u003c/var\u003e: the path of the SSH key file. By\n default, `bmctl` checks the SSH and service account key files specified\n in the cluster configuration file. If `bmctl` finds an expired key file,\n the command fails. If you have the new valid key file in a different\n location than what's specified in the configuration file, include the\n `--ignore-validation-errors` flag to avoid this failure.\n\n For a complete list of the flags that you can use with the `bmctl update\n credentials` command, see [update\n credentials](/kubernetes-engine/distributed-cloud/bare-metal/docs/reference/bmctl#update_credentials) in the `bmctl`\n command reference."]]