Skip to content

Commit 9155cd8

Browse files
Generated documents
documents generated via Terraform plugin Signed-off-by: Vasundhara Shukla <vasundharas@vmware.com>
1 parent e0304c6 commit 9155cd8

13 files changed

+390
-115
lines changed

docs/data-sources/tmc_cluster.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
---
2-
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "tmc_cluster Data Source - terraform-provider-tanzu-mission-control"
4-
subcategory: ""
5-
description: |-
6-
2+
Title: "Cluster Resource"
3+
Description: |-
4+
Reading the cluster resource.
75
---
86

9-
# tmc_cluster (Data Source)
10-
7+
# Cluster
118

9+
Different flavours such as attach cluster, TKG service workload and TKG Vsphere workload clusters can be fetched.
1210

1311
## Example Usage
1412

@@ -360,6 +358,4 @@ Optional:
360358

361359
- **cpu** (String)
362360
- **disk_size** (String)
363-
- **memory** (String)
364-
365-
361+
- **memory** (String)

docs/data-sources/tmc_cluster_group.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
---
2-
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "tmc_cluster_group Data Source - terraform-provider-tanzu-mission-control"
4-
subcategory: ""
5-
description: |-
6-
2+
Title: "Cluster Group Resource"
3+
Description: |-
4+
Fetching the cluster group resource to a cluster.
75
---
86

9-
# tmc_cluster_group (Data Source)
10-
7+
# Cluster Group
118

9+
A cluster group is needed for a cluster
1210

1311
## Example Usage
1412

@@ -43,6 +41,4 @@ Read-Only:
4341

4442
- **annotations** (Map of String) Annotations for the resource
4543
- **resource_version** (String) Resource version of the resource
46-
- **uid** (String) UID of the resource
47-
48-
44+
- **uid** (String) UID of the resource

docs/data-sources/tmc_cluster_node_pool.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
---
2-
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "tmc_cluster_node_pool Data Source - terraform-provider-tanzu-mission-control"
4-
subcategory: ""
5-
description: |-
6-
2+
Title: "Nodepool Resource"
3+
Description: |-
4+
Fetching the details of nodepool resource.
75
---
86

9-
# tmc_cluster_node_pool (Data Source)
10-
7+
# Nodepool
118

9+
A nodepool can be read.
1210

11+
## Example Usage
1312

13+
```terraform
14+
# Read TMC cluster nodepool : fetch cluster nodepool details
15+
data "tmc_cluster_node_pool" "read_node_pool" {
16+
management_cluster_name = "tkgs-terraform"
17+
provisioner_name = "test-gc-e2e-demo-ns"
18+
cluster_name = "tkgs-test"
19+
name = "default-nodepool"
20+
}
21+
```
1422

1523
<!-- schema generated by tfplugindocs -->
1624
## Schema
@@ -63,6 +71,4 @@ Optional:
6371
Optional:
6472

6573
- **class** (String) Nodepool instance type
66-
- **storage_class** (String) Storage Class to be used for storage of the disks which store the root filesystem of the nodes
67-
68-
74+
- **storage_class** (String) Storage Class to be used for storage of the disks which store the root filesystem of the nodes

docs/data-sources/tmc_namespace.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
---
2-
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "tmc_namespace Data Source - terraform-provider-tanzu-mission-control"
4-
subcategory: ""
5-
description: |-
6-
2+
Title: "Namespace Resource"
3+
Description: |-
4+
Fetching the details of namespace resource.
75
---
86

9-
# tmc_namespace (Data Source)
10-
7+
# Namespace
118

9+
A namespace can be read.
1210

1311
## Example Usage
1412

@@ -63,6 +61,4 @@ Read-Only:
6361
Optional:
6462

6563
- **attach** (Boolean)
66-
- **workspace_name** (String)
67-
68-
64+
- **workspace_name** (String)

docs/data-sources/tmc_workspace.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
---
2-
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "tmc_workspace Data Source - terraform-provider-tanzu-mission-control"
4-
subcategory: ""
5-
description: |-
6-
2+
Title: "Workspace Resource"
3+
Description: |-
4+
fetching the details of workspace resource.
75
---
86

9-
# tmc_workspace (Data Source)
10-
7+
# Workspace
118

9+
A workspace can be read.
1210

1311
## Example Usage
1412

@@ -43,6 +41,4 @@ Read-Only:
4341

4442
- **annotations** (Map of String) Annotations for the resource
4543
- **resource_version** (String) Resource version of the resource
46-
- **uid** (String) UID of the resource
47-
48-
44+
- **uid** (String) UID of the resource

docs/guides/tmc_cluster.md

+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
---
2+
Title: "Provisioning of a workload cluster"
3+
Description: |-
4+
An example of provisioning a TKGs and a TKGm workload cluster.
5+
---
6+
7+
# TKGs Workload Cluster
8+
9+
The TKGs workload cluster can be provisioned through the terraform provider using the following example. For the
10+
provisioning, it is expected that the user already has a management cluster registered of the kind `vSphere with Tanzu`
11+
on their TMC instance. The following example demonstrates the resource of a TKG Service Vsphere workload cluster:
12+
13+
```terraform
14+
// TMC Cluster Type: TKGServiceVsphere workload.
15+
// Operations supported : Read, Create, Update & Delete (except nodepools)
16+
17+
// Read TMC TKG Service Vsphere workload cluster : fetch cluster details
18+
data "tmc_cluster" "ready_only_cluster_view" {
19+
management_cluster_name = "<management-cluster>" // Required
20+
provisioner_name = "<prov-name>" // Required
21+
name = "<cluster-name>" // Required
22+
}
23+
24+
# Create TMC TKG Service Vsphere workload cluster entry
25+
resource "tmc_cluster" "create_tkgs_workload" {
26+
management_cluster_name = "<management-cluster>"
27+
provisioner_name = "<prov-name>"
28+
name = "<cluster-name>"
29+
30+
meta {
31+
labels = { "key" : "test" }
32+
}
33+
34+
spec {
35+
cluster_group = "<cluster-group>" // Default: default
36+
tkg_service_vsphere {
37+
settings {
38+
network {
39+
pods {
40+
cidr_blocks = [
41+
"<pods-cidr-blocks>", // Required
42+
]
43+
}
44+
services {
45+
cidr_blocks = [
46+
"<services-cidr-blocks>", // Required
47+
]
48+
}
49+
}
50+
}
51+
52+
distribution {
53+
version = "<version>" // Required
54+
}
55+
56+
topology {
57+
control_plane {
58+
class = "<class>" // Required
59+
storage_class = "<storage-class" // Required
60+
high_availability = false // Default: false
61+
}
62+
node_pools {
63+
spec {
64+
worker_node_count = "<worker-node-count>" // Required
65+
cloud_label = {
66+
"<key>" : "<val>"
67+
}
68+
node_label = {
69+
"<key>" : "<val>"
70+
}
71+
tkg_service_vsphere {
72+
class = "<class>" // Required
73+
storage_class = "<storage-class>" // Required
74+
}
75+
}
76+
info {
77+
name = "<node-pool-name>" // Required
78+
}
79+
}
80+
}
81+
}
82+
}
83+
}
84+
```
85+
86+
# TKGm Vsphere Workload Cluster
87+
88+
The TKGm Vsphere workload cluster can be provisioned through the terraform provider using the following example. For the
89+
provisioning, it is expected that the user already has a management cluster registered of the kind `Tanzu Kubernetes Grid`
90+
on their TMC instance. The following example demonstrates the resource of a TKGm Vsphere workload cluster:
91+
92+
```terraform
93+
// TMC Cluster Type: TKGVsphere workload.
94+
// Operations supported : Read, Create, Update & Delete (except nodepools)
95+
96+
// Read TMC TKG Vsphere workload cluster : fetch cluster details
97+
data "tmc_cluster" "ready_only_cluster_view" {
98+
management_cluster_name = "<management-cluster>" // Required
99+
provisioner_name = "<prov-name>" // Required
100+
name = "<cluster-name>" // Required
101+
}
102+
103+
// Create TMC TKG Vsphere workload cluster entry
104+
resource "tmc_cluster" "create_tkg_vsphere_cluster" {
105+
management_cluster_name = "<management-cluster>" // Default: attached
106+
provisioner_name = "<prov-name>" // Default: attached
107+
name = "<cluster-name>" // Required
108+
109+
meta {
110+
description = "description of the cluster"
111+
labels = { "key" : "value" }
112+
}
113+
114+
spec {
115+
cluster_group = "<cluster-group>" // Default: default
116+
tkg_vsphere {
117+
settings {
118+
network {
119+
pods {
120+
cidr_blocks = [
121+
"<pods-cidr-blocks>", // Required
122+
]
123+
}
124+
125+
services {
126+
cidr_blocks = [
127+
"<services-cidr-blocks>", // Required
128+
]
129+
}
130+
131+
control_plane_end_point = "<end-point>" // Required
132+
}
133+
134+
security {
135+
ssh_key = "<ssh-key>" // Required
136+
}
137+
}
138+
139+
distribution {
140+
version = "<version>" // Required
141+
142+
workspace {
143+
datacenter = "<datacenter>" // Required
144+
datastore = "<datastore>" // Required
145+
workspace_network = "<workspace_network>" // Required
146+
folder = "<folder>" // Required
147+
resource_pool = "<resource_pool>" // Required
148+
}
149+
}
150+
151+
topology {
152+
control_plane {
153+
vm_config {
154+
cpu = "<cpu>" // Required
155+
disk_size = "<disk_size>" // Required
156+
memory = "<memory>" // Required
157+
}
158+
159+
high_availability = false // Default: false
160+
}
161+
162+
node_pools {
163+
spec {
164+
worker_node_count = "<worker-node-count>" // Required
165+
cloud_label = {
166+
"<key>" : "<val>"
167+
}
168+
node_label = {
169+
"<key>" : "<val>"
170+
}
171+
172+
tkg_vsphere {
173+
vm_config {
174+
cpu = "<cpu>" // Required
175+
disk_size = "<disk_size>" // Required
176+
memory = "<memory>" // Required
177+
}
178+
}
179+
}
180+
181+
info {
182+
name = "<node-pool-name>" // Required
183+
description = "<node-pool-description>"
184+
}
185+
}
186+
}
187+
}
188+
}
189+
}
190+
```
191+
192+
When you apply these configurations it will create the respective workload cluster on the chosen management cluster.
193+
If you need to update the cluster, you simply make an update to the rule definition and Terraform will
194+
apply/update it across all the sites. If you add / or remove a site from the list, Terraform will also
195+
handle creating or removing the rule on the subsequent `terraform apply`.

docs/guides/tmc_nodepool.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
Title: "Provisioning Nodepool Resource"
3+
Description: |-
4+
Adding the nodepool resource to a cluster.
5+
---
6+
7+
# Provisioning nodepool on a cluster
8+
9+
A nodepool can be added to a workload cluster. For provisioning of a cluster, refer to the `tmc_cluster` in `guides`.
10+
11+
We support Create, read, update and delete operations for node pool.
12+
You could create/manage a `nodepool` for a cluster with the following config:
13+
14+
```terraform
15+
// TMC Cluster Type: Attach. Bring your own k8s cluster and attach it to TMC.
16+
// Operations supported : Read, Create, Update & Delete
17+
18+
# Read TMC cluster nodepool : fetch cluster nodepool details
19+
data "tmc_cluster_node_pool" "read_node_pool" {
20+
management_cluster_name = "<management-cluster>" // Default: attached
21+
provisioner_name = "<prov-name>" // Default: attached
22+
cluster_name = "<cluster_name>" // Required
23+
name = "<nodepool-namcde>" // Required
24+
}
25+
26+
# Create TMC nodepool entry
27+
resource "tmc_cluster_node_pool" "create_node_pool" {
28+
29+
management_cluster_name = "<management-cluster>" // Default: attached
30+
provisioner_name = "<prov-name>" // Default: attached
31+
cluster_name = "<cluster_name>" // Required
32+
name = "<nodepool-name>" // Required
33+
34+
spec {
35+
worker_node_count = "3"
36+
37+
tkg_service_vsphere {
38+
class = "<class>" // Required
39+
storage_class = "<storage-class" // Required
40+
}
41+
}
42+
}
43+
```

0 commit comments

Comments
 (0)