Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird erläutert, wie Sie Pakete mit Config Sync über die Google Cloud Console verwalten.
Ein Paket ist eine Reihe von Kubernetes-Ressourcenobjektmanifesten, die in einer Source of Truth verwaltet und von Config Sync mit einem Cluster synchronisiert werden. Jede Paketdefinition ist in einem RootSync- oder RootSync-Objekt im Cluster enthalten.
Weitere Informationen zu RootSync- und RepoSync-Objekten finden Sie unter Config Sync-Architektur.
Nachdem Sie Ihre Cluster für eine Flotte registriert und Config Sync installiert haben, können Sie Config Sync so konfigurieren, dass ein Paket in einem Cluster aus einer Source of Truth bereitgestellt wird. Sie können ein Paket in mehreren Clustern oder verschiedene Pakete in verschiedenen Clustern bereitstellen.
Sie können ein Paket nach der Bereitstellung bearbeiten, mit Ausnahme einiger Einstellungen wie Paketname und Synchronisierungstyp. Weitere Informationen finden Sie unter Pakete verwalten.
Führen Sie folgende Schritte aus, um ein Paket bereitzustellen:
Rufen Sie in der Google Cloud Console das Config Sync-Dashboard auf.
Wählen Sie in der Tabelle Cluster für die Paketbereitstellung auswählen den Cluster aus, für den Sie ein Paket bereitstellen möchten, und klicken Sie dann auf Weiter.
Wählen Sie entweder Auf Git gehostetes Paket oder In OCI gehostete Paket als Quelltyp aus und klicken Sie dann auf Weiter.
Geben Sie im Abschnitt Paketdetails einen Paketnamen ein, der das RootSync- oder RepoSync-Objekt identifiziert.
Wählen Sie im Feld Synchronisierungstyp entweder Clusterbezogene Synchronisierung oder Namespace-bezogene Synchronisierung als Synchronisierungstyp aus.
Die clusterbezogene Synchronisierung erstellt ein RootSync-Objekt und die Namespace-bezogene Synchronisierung ein RepoSync-Objekt.
Weitere Informationen zu diesen Objekten finden Sie unter Config Sync-Architektur.
Geben Sie im Abschnitt Quelle Folgendes ein:
Geben Sie für Quellen, die in einem Git-Repository gehostet werden, die folgenden Felder ein:
Geben Sie die URL des Git-Repositorys, das Sie als „Source of Truth“ verwenden, als Repository-URL ein.
Optional: Aktualisieren Sie das Feld Überarbeitung, um zu prüfen, ob Sie nicht die Standardeinstellung HEAD verwenden.
Optional: Aktualisieren Sie das Feld Pfad, wenn Sie nicht aus dem Root-Repository synchronisieren möchten.
Optional: Aktualisieren Sie das Feld Zweig, wenn Sie nicht den Standardzweig main verwenden.
Geben Sie für Quellen, die in einem OCI-Image gehostet werden, die folgenden Felder ein:
Geben Sie die URL des OCI-Images, das Sie als „Source of Truth“ verwenden, als Image ein.
Geben Sie den Pfad des Verzeichnisses relativ zum Stammverzeichnis als Verzeichnis ein, von dem aus synchronisiert werden soll.
(Optional): Maximieren Sie den Abschnitt Erweiterte Einstellungen, um Folgendes abzuschließen:
Wählen Sie einen Authentifizierungstyp aus. Config Sync benötigt Lesezugriff auf Ihre „Source of Truth“, um die Konfigurationsdateien in der Quelle zu lesen und auf Ihre Cluster anzuwenden.
Sofern nicht Ihre Quelle (z. B. ein öffentliches Repository) keine Authentifizierung erfordert, müssen Sie dafür sorgen, dass Sie Config Sync Lesezugriff auf Ihr Git-Repository, OCI-Image oder Helm-Diagramm (nur gcloud CLI) gewähren.
Wählen Sie den Authentifizierungstyp aus, den Sie bei der Installation von Config Sync konfiguriert haben:
Keine: Keine Authentifizierung verwenden.
SSH: Mit einem SSH-Schlüsselpaar authentifizieren.
Cookiefile: Mit einem cookiefile authentifizieren.
Token: Mit einem Zugriffstoken oder Passwort authentifizieren.
Google Cloud Repository: Ein Google-Dienstkonto verwenden, um auf ein Repository in Cloud Source Repository zuzugreifen. Wählen Sie diese Option nur aus, wenn Workload Identity in Ihrem Cluster nicht aktiviert ist.
Workload Identity: Verwenden Sie ein Google-Dienstkonto, um auf ein Cloud Source Repositories-Repository zuzugreifen.
Geben Sie eine Anzahl von Sekunden ein, um die Synchronisierungswartezeit festzulegen, die bestimmt, wie lange Config Sync zwischen den Versuchen zum Abruf aus der „Source of Truth“ wartet.
Geben Sie eine Git-Proxy-URL für den HTTPS-Proxy ein, der bei der Kommunikation mit der „Source of Truth“ verwendet werden soll.
Wählen Sie Hierarchie aus, um das Quellformat zu ändern.
Der Standardwert Unstrukturiert wird in den meisten Fällen empfohlen, da Sie damit Ihre "Source of Truth" wie gewünscht organisieren können.
Klicken Sie auf Paket bereitstellen.
Sie werden zur Config Sync-Seite Pakete weitergeleitet. Nach einigen Minuten sollte für den von Ihnen konfigurierten Cluster in der Spalte Synchronisierungsstatus der Wert Synchronisiert angezeigt werden.
Paket bearbeiten
So bearbeiten Sie ein Paket, das bereits bereitgestellt wurde:
Rufen Sie in der Google Cloud Console den Config Sync-Tab Pakete auf.
(Optional): Maximieren Sie das Menü Schnellfilter und wählen Sie einen Filter aus, um das Paket zu finden, das Sie bearbeiten möchten.
Maximieren Sie den Paketnamen, den Sie bearbeiten möchten, und klicken Sie dann in der Zeile mit dem Clusternamen auf das Kontextmenü more_vert und dann auf editPaket bearbeiten.
Prüfen und aktualisieren Sie die Paketeinstellungen, die Sie ändern möchten.
Klicken Sie auf Speichern.
Paket deinstallieren
Führen Sie die folgenden Schritte aus, um ein Paket aus der Google Cloud Console zu deinstallieren:
Rufen Sie in der Google Cloud Console den Config Sync-Tab Pakete auf.
(Optional): Maximieren Sie das Menü Schnellfilter und wählen Sie einen Filter aus, um das Paket zu finden, das Sie deinstallieren möchten.
Maximieren Sie den Paketnamen, den Sie deinstallieren möchten. Klicken Sie dann in der Zeile mit dem Clusternamen auf das Kontextmenü more_vert und dann auf deletePaket deinstallieren.
Wählen Sie im Bestätigungsdialogfeld aus, ob nur das RootSync- oder RepoSync-Objekt deinstalliert werden soll oder ob RootSync oder RepoSync und alle von RootSync oder RepoSync verwalteten Ressourcen deinstalliert werden sollen.
Geben Sie die Bestätigungsmeldung ein und klicken Sie auf Deinstallieren.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2024-08-02 (UTC)."],[],[],null,["# Manage packages\n\nThis page explains how to manage packages with Config Sync from the Google Cloud console.\n\nA *package* is a set of Kubernetes resource object manifests that are managed in\na and synced to a cluster by Config Sync. Each package\ndefinition is contained in a *RootSync* or *RepoSync* object on the cluster.\nFor more detailed information about RootSync and RepoSync objects, see\n[Config Sync architecture](/kubernetes-engine/enterprise/config-sync/docs/concepts/architecture#rootsync-reposync).\n\nBefore you begin\n----------------\n\n- [Install Config Sync](/kubernetes-engine/enterprise/config-sync/docs/how-to/installing-config-sync).\n\nDeploy a package\n----------------\n\nAfter you have registered your clusters to a fleet and installed Config Sync,\nyou can configure Config Sync to deploy a package to a cluster from a\n. You can deploy the same package\nto multiple clusters or deploy different packages to different clusters.\nYou can edit a package after deploying it, except for some settings like\npackage name and sync type. For more information, see\n[Manage packages](/kubernetes-engine/enterprise/config-sync/docs/how-to/manage-packages).\n| **Note:** If you want Config Sync to render and apply a Helm chart, you must [configure Config Sync with the Google Cloud CLI](/kubernetes-engine/enterprise/config-sync/docs/how-to/installing-config-sync#configuring-config-sync) instead.\n\nTo deploy a package, complete the following steps:\n\n1. In the Google Cloud console, go to the **Config Sync dashboard**.\n\n [Go to Config Sync dashboard](https://console.cloud.google.com/kubernetes/config_management)\n2. Click **Deploy Package**.\n\n3. In the **Select clusters for package deployment** table, select the cluster\n that you want to deploy a package to and then click **Continue**.\n\n4. Select either **Package hosted on Git** or **Package hosted on OCI** as\n your source type and then click **Continue**.\n\n5. In the **Package details** section, enter a **Package name**, which\n identifies the RootSync or RepoSync object.\n\n6. In the **Sync type** field, choose either **Cluster scoped sync** or **Namespace scoped sync** as\n the sync type.\n\n Cluster scoped sync creates a RootSync object and Namespace scoped sync creates a RepoSync object.\n For more information about these objects, see\n [Config Sync architecture](/kubernetes-engine/enterprise/config-sync/docs/concepts/architecture#rootsync-reposync).\n7. In the **Source** section, complete the following:\n\n - For sources hosted in a Git repository, enter the following fields:\n\n 1. Enter the URL of the Git repository that you're using as a source of truth as the **Repository URL**.\n 2. Optional: Update the **Revision** field to check out if you're not using the default `HEAD`.\n 3. Optional: Update the **Path** field if you don't want to sync from the root repository.\n 4. Optional: Update the **Branch** field if you're not using the default `main` branch.\n - For sources hosted in an OCI image, enter the following fields:\n\n 1. Enter the URL of the OCI image that you're using as a source of truth as the **Image**.\n 2. Enter the path of the directory to sync from, relative to the root directory, as the **Directory**.\n8. (Optional): Expand the **Advanced settings** section to complete the following:\n\n 1. Select an **Authentication type** . Config Sync needs read-only access to\n your source of truth to read the configuration files in the source and apply them to your clusters.\n Unless your source requires no authentication, such as a public repository,\n ensure that you grant Config Sync\n read-only access to your [Git repository](/kubernetes-engine/enterprise/config-sync/docs/how-to/installing-config-sync#git-creds-secret),\n [OCI image](/kubernetes-engine/enterprise/config-sync/docs/how-to/installing-config-sync#oci-access), or [Helm chart](/kubernetes-engine/enterprise/config-sync/docs/how-to/installing-config-sync#helm-access) (gcloud CLI only).\n Choose the same authentication type that you configured when you installed\n Config Sync:\n\n | **Note:** for OCI, you can only select **Workload Identity** for authentication.\n - **None**: Use no authentication.\n - **SSH**: Authenticate by using an SSH key pair.\n - **Cookiefile** : Authenticate by using a `cookiefile`.\n - **Token**: Authenticate by using an access token or password.\n - **Google Cloud Repository** : Use a Google service account to access a Cloud Source Repositories repository. Only select this option if Workload Identity Federation for GKE is *not* enabled in your cluster.\n - **Workload Identity**: Use a Google service account to access a Cloud Source Repositories repository.\n 2. Enter a number in seconds to set the **Sync wait time**, which determines\n how long Config Sync waits between attempts to pull from the source of truth.\n\n 3. Enter a **Git proxy** URL for the HTTPS proxy to be used when\n communicating with the source of truth.\n\n 4. Choose **Hierarchy** to change the **Source format**.\n\n The default value **Unstructured** is recommended in most cases since it\n lets you organize your source of truth however you want.\n9. Click **Deploy Package**.\n\n You are redirected to the Config Sync **Packages** page. After a few\n minutes, you should see **Synced** in the **Sync status**\n column for the cluster that you configured.\n\nEdit a package\n--------------\n\nTo edit a package that you've already deployed, complete the following steps:\n\n1. In the Google Cloud console, go to the Config Sync **Packages** tab.\n\n [Go to Packages](https://console.cloud.google.com/kubernetes/config_management/packages)\n2. (Optional): Expand the **Quick filters** menu and then select a filter to\n help find the package that you want to edit.\n\n3. Expand the package name that you want to edit and then, in the row that contains\n the cluster name, click the context menu *more_vert*\n and then click *edit*\n **Edit package**.\n\n4. Review and update the package settings that you want to change.\n\n5. Click **Save**.\n\nUninstall a package\n-------------------\n\n| **Note:** The Google Cloud console uses the deletion propagation feature to delete package resources. If you don't manage your RootSync and RepoSync objects with the Google Cloud console, you can still use the deletion propagation feature to achieve a similar uninstall behavior, with `kubectl` or any other Kubernetes client. For more information, see [Bulk delete objects](/kubernetes-engine/enterprise/config-sync/docs/how-to/managing-objects#bulk_delete_objects) ([Preview](/products#product-launch-stages)).\n\nTo uninstall a package from the Google Cloud console, complete the following steps:\n\n1. In the Google Cloud console, go to the Config Sync **Packages** tab.\n\n [Go to Packages](https://console.cloud.google.com/kubernetes/config_management/packages)\n2. (Optional): Expand the **Quick filters** menu and then select a filter to\n help find the package that you want to uninstall.\n\n3. Expand the package name that you want to uninstall and then, in the row that contains\n the cluster name, click the context menu *more_vert*\n and then click *delete*\n **Uninstall package**.\n\n4. In the confirmation dialog, select whether to uninstall only the RootSync or RepoSync object,\n or uninstall the RootSync or RepoSync **and** all of the resources managed by the\n RootSync or RepoSync.\n\n5. Type the confirmation message and then click **Uninstall**.\n\nWhat's next\n-----------\n\n- [Monitor the status of Config Sync and packages](/kubernetes-engine/enterprise/config-sync/docs/how-to/use-config-sync-dashboard)\n- Use the [`nomos` command-line tool](/kubernetes-engine/enterprise/config-sync/docs/how-to/nomos-command)\n- [Troubleshoot Config Sync](/kubernetes-engine/enterprise/config-sync/docs/how-to/troubleshooting-config-sync)"]]