Skip to content

Commit cf006f3

Browse files
Enhancing README and splitting cluster resource
Signed-off-by: Vasundhara Shukla <vasundharas@vmware.com>
1 parent c48b176 commit cf006f3

21 files changed

+433
-308
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ vet:
2525
lint: gofmt
2626
golangci-lint run -c ./.golangci.yml ./internal/... .
2727

28+
set-tf-acc:
29+
TF_ACC=true
30+
31+
acc-test: | set-tf-acc test
32+
2833
website-lint:
2934
@echo "==> Checking website against linters..."
3035
@misspell -error -source=text website/ || (echo; \

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Terraform Tanzu TMC Provider
1+
# Terraform VMware Tanzu Mission Control Provider
22

3-
This is the repository for the Terraform Tanzu TMC Provider, which one can use with
4-
Terraform to work with [VMware Tanzu TMC][vmware-tanzu-tmc].
3+
This is the repository for the Terraform Tanzu Mission Control Provider, which one can use with Terraform to work with
4+
[VMware Tanzu Mission Control][vmware-tanzu-tmc].
55

66
[vmware-tanzu-tmc]: https://tanzu.vmware.com/mission-control
77

@@ -27,8 +27,8 @@ provider "tmc" {
2727
}
2828
```
2929

30-
Version locking uses a pessimistic operator, so this version lock would mean
31-
anything within the 1.x namespace, including or after 1.0.0. [Read more][provider-vc] on provider version control.
30+
Version locking uses a pessimistic operator, so this version lock would mean anything within the 1.x namespace, including or after 1.0.0.
31+
[Read more][provider-vc] on provider version control.
3232

3333
[provider-vc]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/index.html
3434

@@ -86,34 +86,34 @@ provider.
8686
**Flattening and Helper Tests:** These can be run by `make test` directly.
8787

8888
**Acceptance Tests:** Set the environment variables in your IDE configurations or Terminal.
89-
Environment variables that are required to be set universally are `TMC_ENDPOINT`, `TMC_CSP_ENDPOINT`, `TMC_CSP_TOKEN` and `TF_ACC`. `TF_ACC` has to be set as `true`.
89+
Environment variables that are required to be set universally are `TMC_ENDPOINT`, `TMC_CSP_ENDPOINT` and `TMC_CSP_TOKEN`.
9090

9191
Environment variables specific to particular resources:
9292

9393
- **Attach Cluster with Kubeconfig and Namespace Resource** - `KUBECONFIG`
9494
- **TKGs workload cluster** - `MANAGEMENT_CLUSTER`, `PROVISIONER_NAME`, `VERSION` and `STORAGE_CLASS`.
9595
- **TKGm Vsphere workload cluster** - `MANAGEMENT_CLUSTER` and `CONTROL_PLANE_ENDPOINT`.
9696

97-
After the environment variables are set, run the respective tests.
97+
After the environment variables are set, run `make acc-test`.
9898

9999
## Provider Documentation
100100

101-
TMC Terraform provider documentation is autogenerated using [tfplugindocs][tfplugindocs-link].
101+
Tanzu Mission Control Terraform provider documentation is autogenerated using [tfplugindocs][tfplugindocs-link].
102102

103-
Use the tfplugindocs tool to automatically generate documentation for your provider in the format required by the Terraform Registry.
103+
Use the tfplugindocs tool to generate documentation for your provider in the format required by the Terraform Registry.
104104
The plugin will read the descriptions and schema of each resource and data source in your provider and generate the relevant Markdown files for you.
105105

106106
[tfplugindocs-link]: https://github.com/hashicorp/terraform-plugin-docs
107-
## Utilising TMC provider
107+
## Using Tanzu Mission Control Provider
108108

109-
Please refer to `examples` folder to perform CRUD operations with TMC provider for various resources
109+
Please refer to `examples` folder to perform CRUD operations with Tanzu Mission Control provider for various resources
110110

111111
# Support
112112

113-
The TMC Terraform provider is now VMware supported as well as community supported. For bugs and feature requests please open a Github Issue and label it appropriately or contact VMware support.
113+
The Tanzu Mission Control Terraform provider is now VMware supported as well as community supported. For bugs and feature requests please open a Github Issue and label it appropriately or contact VMware support.
114114

115115
# License
116116

117117
Copyright © 2015-2021 VMware, Inc. All Rights Reserved.
118118

119-
The TMC Terraform provider is available under [MPL2.0 license](https://github.com/vmware-tanzu/terraform-provider-tanzu-mission-control/blob/main/LICENSE).
119+
The Tanzu Mission Control Terraform provider is available under [MPL2.0 license](https://github.com/vmware-tanzu/terraform-provider-tanzu-mission-control/blob/main/LICENSE).
File renamed without changes.

docs/guides/tmc_cluster.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -28,48 +28,48 @@ resource "tmc_cluster" "create_tkgs_workload" {
2828
name = "<cluster-name>"
2929
3030
meta {
31-
labels = { "key" : "test"}
31+
labels = { "key" : "test" }
3232
}
3333
3434
spec {
3535
cluster_group = "<cluster-group>" // Default: default
3636
tkg_service_vsphere {
37-
settings {
38-
network {
39-
pods {
37+
settings {
38+
network {
39+
pods {
4040
cidr_blocks = [
4141
"<pods-cidr-blocks>", // Required
4242
]
4343
}
44-
services {
44+
services {
4545
cidr_blocks = [
4646
"<services-cidr-blocks>", // Required
4747
]
4848
}
4949
}
5050
}
5151
52-
distribution {
52+
distribution {
5353
version = "<version>" // Required
5454
}
5555
56-
topology {
57-
control_plane {
58-
class = "<class>" // Required
59-
storage_class = "<storage-class" // Required
60-
high_availability = false // Default: false
56+
topology {
57+
control_plane {
58+
class = "<class>" // Required
59+
storage_class = "<storage-class" // Required
60+
high_availability = false // Default: false
6161
}
62-
node_pools {
63-
spec {
62+
node_pools {
63+
spec {
6464
worker_node_count = "<worker-node-count>" // Required
6565
cloud_label = {
66-
"<key>": "<val>"
66+
"<key>" : "<val>"
6767
}
6868
node_label = {
69-
"<key>": "<val>"
69+
"<key>" : "<val>"
7070
}
71-
tkg_service_vsphere {
72-
class = "<class>" // Required
71+
tkg_service_vsphere {
72+
class = "<class>" // Required
7373
storage_class = "<storage-class>" // Required
7474
}
7575
}
@@ -140,20 +140,20 @@ resource "tmc_cluster" "create_tkg_vsphere_cluster" {
140140
version = "<version>" // Required
141141
142142
workspace {
143-
datacenter = "<datacenter>" // Required
144-
datastore = "<datastore>" // Required
143+
datacenter = "<datacenter>" // Required
144+
datastore = "<datastore>" // Required
145145
workspace_network = "<workspace_network>" // Required
146-
folder = "<folder>" // Required
147-
resource_pool = "<resource_pool>" // Required
146+
folder = "<folder>" // Required
147+
resource_pool = "<resource_pool>" // Required
148148
}
149149
}
150150
151151
topology {
152152
control_plane {
153153
vm_config {
154-
cpu = "<cpu>" // Required
154+
cpu = "<cpu>" // Required
155155
disk_size = "<disk_size>" // Required
156-
memory = "<memory>" // Required
156+
memory = "<memory>" // Required
157157
}
158158
159159
high_availability = false // Default: false
@@ -163,17 +163,17 @@ resource "tmc_cluster" "create_tkg_vsphere_cluster" {
163163
spec {
164164
worker_node_count = "<worker-node-count>" // Required
165165
cloud_label = {
166-
"<key>": "<val>"
166+
"<key>" : "<val>"
167167
}
168168
node_label = {
169-
"<key>": "<val>"
169+
"<key>" : "<val>"
170170
}
171171
172172
tkg_vsphere {
173173
vm_config {
174-
cpu = "<cpu>" // Required
174+
cpu = "<cpu>" // Required
175175
disk_size = "<disk_size>" // Required
176-
memory = "<memory>" // Required
176+
memory = "<memory>" // Required
177177
}
178178
}
179179
}

docs/guides/tmc_nodepool.md

+18-9
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,32 @@ We support Create, read, update and delete operations for node pool.
1212
You could create/manage a `nodepool` for a cluster with the following config:
1313

1414
```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+
1526
# Create TMC nodepool entry
1627
resource "tmc_cluster_node_pool" "create_node_pool" {
1728
18-
management_cluster_name = "tkgs-terraform"
19-
provisioner_name = "test-gc-e2e-demo-ns"
20-
cluster_name = "tkgs-test"
21-
name = "terraform-nodepool"
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
2233
2334
spec {
2435
worker_node_count = "3"
2536
26-
tkg_service_vsphere {
27-
class = "best-effort-xsmall"
28-
storage_class = "gc-storage-profile"
37+
tkg_service_vsphere {
38+
class = "<class>" // Required
39+
storage_class = "<storage-class" // Required
2940
}
30-
3141
}
32-
3342
}
3443
```

docs/index.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ provider "tmc" {
2626
<!-- schema generated by tfplugindocs -->
2727
## Schema
2828

29-
### Optional
29+
### Required
3030

31-
- **csp_endpoint** (String)
3231
- **endpoint** (String)
33-
- **token** (String, Sensitive)
32+
- **token** (String, Sensitive)
33+
34+
### Optional
35+
36+
- **csp_endpoint** (String)

0 commit comments

Comments
 (0)