Method: projects.locations.global.memberships.initializeHub

Initializes the Hub in this project, which includes creating the default Hub Service Account and the Hub Workload Identity Pool. Initialization is optional, and happens automatically when the first Membership is created.

memberships.initializeHub should be called when the first Membership cannot be registered without these resources. A common example is granting the Hub Service Account access to another project, which requires the account to exist first.

HTTP request

POST https://gkehub.googleapis.com/v1alpha2/{project=projects/*/locations/global/memberships}:initializeHub

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Required. The Hub to initialize, in the format projects/*/locations/*/memberships/*.

Request body

The request body must be empty.

Response body

Response message for the memberships.initializeHub method.

If successful, the response body contains data with the following structure:

JSON representation
{
  "serviceIdentity": string,
  "workloadIdentityPool": string
}
Fields
serviceIdentity

string

Name of the Hub default service identity, in the format:

service-<project-number>@gcp-sa-gkehub.iam.gserviceaccount.com

The service account has roles/gkehub.serviceAgent in the Hub project.

workloadIdentityPool

string

The Workload Identity Pool used for Workload Identity-enabled clusters registered with this Hub. Format: <project-id>.hub.id.goog

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.