diff --git a/docs/using-hive.md b/docs/using-hive.md index 81b70cc571..fcf32c7ac7 100644 --- a/docs/using-hive.md +++ b/docs/using-hive.md @@ -1240,6 +1240,8 @@ spec: name: my-gcp-cluster-admin-kubeconfig clusterID: 61010205-c91d-44c9-8394-3e1790bd76f3 infraID: my-gcp-cluster-wsvdn + metadataJSONSecretRef: + name: my-gcp-cluster-metadata-json clusterName: my-gcp-cluster installed: true platform: @@ -1251,6 +1253,8 @@ spec: name: pull-secret ``` +Note: For `metadataJSONSecretRef`, copy its correspoding secret when the cluster is already managed by Hive and it appears in the original ClusterDeployment YAML;Otherwise create the metadata.json following the below samples. + If the cluster you are looking to adopt is on AWS and leverages Privatelink, you'll also need to include that setting under `spec.platform.aws` to ensure the VPC Endpoint Service for the cluster is tracked in the ClusterDeployment. ```yaml @@ -1263,30 +1267,74 @@ If the cluster you are looking to adopt is on AWS and leverages Privatelink, you region: us-east-1 ``` -If the cluster you are looking to adopt is on AWS and uses a shared VPC, you will also need to include the name of the hosted zone role in `spec.clusterMetadata.platform.aws.hostedZoneRole`. - -```yaml - clusterMetadata: - adminKubeconfigSecretRef: - name: my-gcp-cluster-admin-kubeconfig - clusterID: 61010205-c91d-44c9-8394-3e1790bd76f3 - infraID: my-gcp-cluster-wsvdn - platform: - aws: - hostedZoneRole: account-b-zone-role -``` - -If the cluster you are looking to adopt is on GCP and uses a shared VPC, you will also need to include the name of the network project ID in `spec.clusterMetadata.platform.gcp.networkProjectID`. - -```yaml - clusterMetadata: - adminKubeconfigSecretRef: - name: my-gcp-cluster-admin-kubeconfig - clusterID: 61010205-c91d-44c9-8394-3e1790bd76f3 - infraID: my-gcp-cluster-wsvdn - platform: - gcp: - networkProjectID: some@project.id +metadata.json sample for GCP cluster + +``` +{ + "clusterName": "my-gcp-cluster", + "clusterID": "61010205-c91d-44c9-8394-3e1790bd76f3", + "infraID": "my-gcp-cluster-wsvdn", + "gcp": { + "region": "us-east1", + "projectID": "projectID for the cluster", + "networkProjectID": "networkProjectID for the cluster", + "privateZoneDomain": "privateZoneDomain like .", + "privateZoneProjectID": "privateZoneProjectID for the cluster" + }, + "featureSet": "featureSet for the cluster", + "customFeatureSet": null +} +``` + +Note: networkProjectID is optional and shall be included if the cluster you are looking to adopt is on GCP and uses a shared VPC + +metadata.json sample for AWS cluster + +``` +{ + "clusterName": "my-aws-cluster", + "clusterID": "61010205-c91d-44c9-8394-3e1790bd76f3", + "infraID": "my-aws-cluster-wsvdn", + "aws": { + "region": "us-east-1", + "identifier": [ + { + "kubernetes.io/cluster/": "owned" + }, + { + "openshiftClusterID": "" + }, + { + "sigs.k8s.io/cluster-api-provider-aws/cluster/": "owned" + } + ], + "clusterDomain": ".", + "hostedZoneRole": "arn:aws:iam::641733028092:role/-shared-role" + }, + "featureSet": "featureSet for the cluster", + "customFeatureSet": null +} +``` + +Note: hostedZoneRole is optional and shall be included if the cluster you are looking to adopt is on AWS and uses a shared VPC + +metadata.json sample for Azure cluster + +``` +{ + "clusterName": "my-azure-cluster", + "clusterID": "61010205-c91d-44c9-8394-3e1790bd76f3", + "infraID": "my-azure-cluster-wsvdn", + "azure": { + "armEndpoint": "", + "cloudName": "AzurePublicCloud", + "region": "centralus", + "resourceGroupName": "", + "baseDomainResourceGroupName": "baseDomainResourceGroupName for the cluster" + }, + "featureSet": "featureSet for the cluster", + "customFeatureSet": null +} ``` ### Adopting with hiveutil @@ -1294,7 +1342,7 @@ If the cluster you are looking to adopt is on GCP and uses a shared VPC, you wil [hiveutil](hiveutil.md) is a development focused CLI tool which can be built from the hive repo. To adopt a cluster specify the following flags: ```bash -bin/hiveutil create-cluster --namespace=namespace-to-adopt-into --base-domain=example.com mycluster --adopt --adopt-admin-kubeconfig=/path/to/cluster/admin/kubeconfig --adopt-infra-id=[INFRAID] --adopt-cluster-id=[CLUSTERID] +bin/hiveutil create-cluster --namespace=namespace-to-adopt-into --base-domain=example.com mycluster --adopt --adopt-admin-kubeconfig=/path/to/cluster/admin/kubeconfig --adopt-infra-id=[INFRAID] --adopt-cluster-id=[CLUSTERID] --adopt-metadata-json=/path/to/metadata.json ``` ### Transferring ownership