Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 73 additions & 25 deletions docs/using-hive.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -1263,38 +1267,82 @@ 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: [email protected]
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 <clusterName>.<baseDomain>",
"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/<infraID>": "owned"
},
{
"openshiftClusterID": "<clusterID>"
},
{
"sigs.k8s.io/cluster-api-provider-aws/cluster/<infraID>": "owned"
}
],
"clusterDomain": "<clusterName>.<baseDomain>",
"hostedZoneRole": "arn:aws:iam::641733028092:role/<clusterName>-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

[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
Expand Down