Mettre à jour les références de certificat CA vCenter
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment mettre à jour la référence au certificat CA vCenter si celui-ci a changé, car votre cluster d'administrateur et vos clusters d'utilisateur en cours d'exécution doivent être informés de la modification. Cela affecte le champ vCenter.caCertPath dans le fichier de configuration du cluster d'administrateur et les fichiers de configuration du cluster d'utilisateur pour Google Distributed Cloud.
Vous pouvez mettre à jour les références de certificats avec la commande gkectl update comme décrit ici.
Mettre à jour le certificat CA vCenter référencé dans les fichiers de configuration du cluster
Pour mettre à jour les clusters d'administrateur et d'utilisateur en cours d'exécution afin qu'ils utilisent le nouveau certificat, procédez comme suit :
Récupérez le nouveau certificat CA vCenter et extrayez-le :
Vous pouvez utiliser l'option -k si vous souhaitez autoriser les certificats inconnus. Cela permet d'éviter tout problème de certificat que vous pourriez rencontrer en accédant à vCenter.
Déterminez lequel des certificats vCenter est valide. Seul l'un des fichiers de certificat Linux du dossier ..../certs/lin extrait est un certificat vCenter valide. Pour déterminer quel fichier est le certificat vCenter valide, procédez comme suit :
Définissez les variables d'environnement suivantes à partir du poste de travail administrateur sur lequel govc est déjà installé. Si vous ne l'avez pas encore fait, téléchargez et installez l'outil govc :
VCENTER_IP_ADDRESS_OR_FQDN : adresse IP ou nom de domaine complet du serveur vCenter.
VCENTER_USERNAME : nom d'utilisateur du serveur vCenter.
VCENTER_PASSWORD : mot de passe du nom d'utilisateur spécifié.
FULL_PATH_OF_EXTRACTED_LIN_FILE : chemin d'accès complet au fichier de certificat Linux pour lequel vous effectuez un test de validité.
Pour vérifier que le certificat vCenter est valide, exécutez la commande govc about :
govc about
Si le certificat vCenter est valide, la commande govc about affiche des informations sur le serveur vCenter semblables à celles-ci :
FullName: VMware Center Server 7.0.3 build-24322018
Name: VMware Center Server
Vendor: VMware, Inc.
Version: 7.0.3
Build: 24322018
OS type: linux-x64
API type: VirtualCenter
API version: 7.0.3.0
Product ID: vpx
UUID: 475fa366-faa9-43f0-9417-e6dadc55514c
Si le certificat n'est pas valide, l'erreur x509 s'affiche. Si l'erreur x509 s'affiche, mettez à jour la variable d'environnement FULL_PATH_OF_EXTRACTED_LIN_FILE pour qu'elle pointe vers un autre fichier de certificat Linux dans le dossier ..../certs/lin extrait, puis exécutez à nouveau la commande govc about. Répétez les étapes a et b jusqu'à ce que vous trouviez le certificat valide ou jusqu'à ce que vous ayez testé chacun des fichiers de certificat Linux dans le dossier ..../certs/lin extrait.
Pour sauvegarder l'ancien fichier de certificat CA vCenter (qui se trouve au chemin d'accès spécifié dans le champ vCenter.caCertPath de votre fichier de configuration de cluster d'administrateur), renommez-le en vcenter-ca-cert.pem.old.
Renommez le nouveau fichier de certificat valide dans le dossier ..../certs/lin en vcenter-ca-cert.pem, puis déplacez-le vers le chemin d'accès spécifié dans le champ vCenter.caCertPath de votre fichier de configuration du cluster d'administrateur.
Dans chacun des fichiers de configuration de votre cluster d'utilisateur, définissez vCenter.caCertPath sur le chemin d'accès du nouveau fichier vcenter-ca-cert.pem.
Pour chacun de vos clusters d'utilisateur, exécutez la commande gkectl update :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["This page describes how to update the reference to the vCenter CA certificate if it has changed, as your running admin cluster and user clusters must be informed of the change. This affects the `vCenter.caCertPath` field in the admin cluster configuration file and the user cluster configuration files for Google Distributed Cloud.\n\nYou can update the certificate references with the `gkectl update` command as described here.\n\nUpdate the referenced vCenter CA certificate in the cluster configuration files\n\nTo update the running admin and user clusters to use the new certificate:\n\n1. Retrieve the new vCenter CA certificate and extract it:\n\n ```\n curl -o certs.zip https://VCENTER_IP_ADDRESS_OR_FQDN/certs/download.zip\n unzip certs.zip\n ```\n\n You can use the `-k` flag if you want to allow unknown certificates. This is to avoid any certificate issues you may have accessing vCenter.\n2. Determine which of the vCenter certificates is valid. Only one of the Linux certificate files in the extracted `..../certs/lin` folder is the valid vCenter certificate. To determine which file is the valid vCenter certificate, do the following:\n\n 1. Set the following environment variables from the Admin Workstation where `govc` is already installed. If not already done, [download and install govc tool](https://github.com/vmware/govmomi/tree/main/govc#binaries):\n\n ```\n export GOVC_URL=https://VCENTER_IP_ADDRESS_OR_FQDN\n export GOVC_USERNAME=VCENTER_USERNAME\n export GOVC_PASSWORD=VCENTER_PASSWORD\n export GOVC_TLS_CA_CERTS=FULL_PATH_OF_EXTRACTED_LIN_FILE\n export GOVC_INSECURE=false\n ```\n\n \u003cbr /\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVCENTER_IP_ADDRESS_OR_FQDN\u003c/var\u003e: the IP address or FQDN of the vCenter Server.\n\n - \u003cvar translate=\"no\"\u003eVCENTER_USERNAME\u003c/var\u003e: the username of the vCenter Server.\n\n - \u003cvar translate=\"no\"\u003eVCENTER_PASSWORD\u003c/var\u003e: the password for the specified username.\n\n - \u003cvar translate=\"no\"\u003eFULL_PATH_OF_EXTRACTED_LIN_FILE\u003c/var\u003e: the full path to the Linux certificate file for which you are conducting a validity test.\n\n 2. To verify that the vCenter certificate is valid, run the `govc about` command:\n\n ```\n govc about\n ```\n\n If the vCenter certificate is valid, the `govc about` command prints details about the vCenter Server similar to the following: \n\n FullName: VMware Center Server 7.0.3 build-24322018\n Name: VMware Center Server\n Vendor: VMware, Inc.\n Version: 7.0.3\n Build: 24322018\n OS type: linux-x64\n API type: VirtualCenter\n API version: 7.0.3.0\n Product ID: vpx\n UUID: 475fa366-faa9-43f0-9417-e6dadc55514c\n\n If the certificate is invalid, you should see an `x509` error. If you see an `x509` error, update the `FULL_PATH_OF_EXTRACTED_LIN_FILE` environment variable to point at a different Linux certificate file in the extracted `..../certs/lin` folder, and then run the `govc about` command again. Repeat steps a. and b. until you locate the valid certificate, or until you are done testing each of the Linux certificate files in the extracted `..../certs/lin` folder.\n3. To backup the old vCenter CA certificate file (which is at the path specified in the [`vCenter.caCertPath`](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#vcenter-cacertpath-field) field of your admin cluster configuration file), rename it to `vcenter-ca-cert.pem.old`.\n\n4. Rename the new valid certificate file in the `..../certs/lin` folder to `vcenter-ca-cert.pem` and then move it to the path specified in the [`vCenter.caCertPath`](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#vcenter-cacertpath-field) field of your admin cluster configuration file.\n\n5. Update your admin cluster:\n\n ```\n gkectl update admin --config ADMIN_CLUSTER_CONFIG --kubeconfig ADMIN_CLUSTER_KUBECONFIG\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eADMIN_CLUSTER_CONFIG\u003c/var\u003e: the path of your admin cluster configuration file.\n\n After the update command completes, the admin cluster will use the new\n certificate.\n6. Verify that the admin cluster is healthy:\n\n ```\n gkectl diagnose cluster --kubeconfig ADMIN_CLUSTER_KUBECONFIG\n ```\n\n For more information, see\n [Diagnose an admin cluster](/kubernetes-engine/distributed-cloud/vmware/docs/troubleshooting/diagnose#diagnose_admin_cluster).\n7. In each of your user cluster configuration files, set [`vCenter.caCertPath`](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#vcenter-cacertpath-field) to the path of your new `vcenter-ca-cert.pem` file.\n\n8. For each of your user clusters, run the `gkectl update` command:\n\n ```\n gkectl update cluster --config USER_CLUSTER_CONFIG --kubeconfig ADMIN_CLUSTER_KUBECONFIG\n ```\n\n \u003cbr /\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eUSER_CLUSTER_CONFIG\u003c/var\u003e: the path of your user cluster configuration file.\n\n After the update command completes for a particular user cluster, the cluster\n will use the new certificate.\n9. Verify that the user cluster is healthy:\n\n ```\n gkectl diagnose cluster --kubeconfig ADMIN_CLUSTER_KUBECONFIG \\\n --cluster-name USER_CLUSTER_NAME\n ```\n\n For more information, see\n [Diagnose a user cluster](/kubernetes-engine/distributed-cloud/vmware/docs/troubleshooting/diagnose#diagnose_user_cluster).\n\n| **Note:** The `vCenter.caCertPath` field also appears in the admin workstation configuration file. If you want to create a new admin workstation, make sure that you edit the `vCenter.caCertPath` field to reference the current certificate."]]