You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
* initial support for using kubecontext for hub registration * Tested with GKE using kubectl * Tested with GKE using kubectl * Fixed typo in README * Fixed formatting errors * Fixed formatting errors * Fixed formatting and renamed example to be more consistent * Fixed formatting and renamed example to be more consistent * remove test files * fixed typo in README * use a flag to switch gke vs kubeconfig instead of having two scripts * Update modules/hub/scripts/gke_hub_registration.sh specify PROJECT_ID to be more specific Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com> * Update modules/hub/scripts/gke_hub_unregister.sh fix number of arguments check Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com> * update simple_zonal_with_hub_kubeconfig to use kind cluster Co-authored-by: Abhinav Rau <arau@google.com> Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com> Co-authored-by: Morgante Pell <morgantep@google.com>
This example illustrates how to register a non-GKE Kubernetes Cluster with [Anthos](https://cloud.google.com/anthos/multicluster-management/environs) a.k.a Attached cluster.
4
+
5
+
It creates a [kind](https://kind.sigs.k8s.io/) cluster, sets current kubecontext to the cluster and registers the cluster using the [Hub registration module](../../modules/hub).
6
+
7
+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
8
+
## Inputs
9
+
10
+
| Name | Description | Type | Default | Required |
Copy file name to clipboardExpand all lines: modules/hub/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Specifically, this module automates the following steps for [registering a clust
6
6
7
7
## Usage
8
8
9
-
There is a [full example](../../examples/simple_zonal_with_asm) provided. Simple usage is as follows:
9
+
There is [GKE full example](../../examples/simple_zonal_with_asm) and a [Generic K8s example](../../examples/simple_zonal_with_hub_kubeconfig) provided. Simple usage is as follows:
10
10
11
11
```tf
12
12
module "hub" {
@@ -37,13 +37,15 @@ To deploy this config:
37
37
| cluster\_name | The unique name to identify the cluster in ASM. |`string`| n/a | yes |
38
38
| enable\_gke\_hub\_registration | Enables GKE Hub Registration when set to true |`bool`|`true`| no |
39
39
| gcloud\_sdk\_version | The gcloud sdk version to use. Minimum required version is 293.0.0 |`string`|`"296.0.1"`| no |
40
-
| gke\_hub\_membership\_name |Memebership name that uniquely represents the cluster being registered on the Hub |`string`|`"gke-hub-membership"`| no |
40
+
| gke\_hub\_membership\_name |Membership name that uniquely represents the cluster being registered on the Hub |`string`|`"gke-hub-membership"`| no |
41
41
| gke\_hub\_sa\_name | Name for the GKE Hub SA stored as a secret `creds-gcp` in the `gke-connect` namespace. |`string`|`"gke-hub-sa"`| no |
42
+
| labels | Comma separated labels in the format name=value to apply to cluster in the GCP Console. |`string`|`""`| no |
42
43
| location | The location (zone or region) this cluster has been created in. |`string`| n/a | yes |
43
44
| module\_depends\_on | List of modules or resources this module depends on. |`list`|`[]`| no |
44
45
| project\_id | The project in which the resource belongs. |`string`| n/a | yes |
45
46
| sa\_private\_key | Private key for service account base64 encoded. Required only if `use_existing_sa` is set to `true`. |`string`|`null`| no |
46
47
| use\_existing\_sa | Uses an existing service account to register membership. Requires sa\_private\_key |`bool`|`false`| no |
48
+
| use\_kubeconfig | Use existing kubeconfig to register membership. Set this to true for non GKE clusters. Assumes kubectl context is set to cluster to register. |`bool`|`false`| no |
47
49
| use\_tf\_google\_credentials\_env\_var | Optional GOOGLE\_CREDENTIALS environment variable to be activated. |`bool`|`false`| no |
Copy file name to clipboardExpand all lines: modules/hub/variables.tf
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ variable "gke_hub_sa_name" {
59
59
}
60
60
61
61
variable"gke_hub_membership_name" {
62
-
description="Memebership name that uniquely represents the cluster being registered on the Hub"
62
+
description="Membership name that uniquely represents the cluster being registered on the Hub"
63
63
type=string
64
64
default="gke-hub-membership"
65
65
}
@@ -81,3 +81,14 @@ variable "module_depends_on" {
81
81
type=list
82
82
default=[]
83
83
}
84
+
85
+
variable"use_kubeconfig" {
86
+
description="Use existing kubeconfig to register membership. Set this to true for non GKE clusters. Assumes kubectl context is set to cluster to register."
87
+
default=false
88
+
}
89
+
90
+
variable"labels" {
91
+
description="Comma separated labels in the format name=value to apply to cluster in the GCP Console."
0 commit comments