Skip to content

Commit 632500d

Browse files
modular-magicianEdward Sun
andauthored
add desc to schema for google_container_node_pool (#3563) (#2132)
Co-authored-by: Edward Sun <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Edward Sun <[email protected]>
1 parent 3bdc54e commit 632500d

File tree

2 files changed

+87
-62
lines changed

2 files changed

+87
-62
lines changed

.changelog/3563.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_container_node_pool.go

Lines changed: 84 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -42,143 +42,163 @@ func resourceContainerNodePool() *schema.Resource {
4242
schemaNodePool,
4343
map[string]*schema.Schema{
4444
"project": {
45-
Type: schema.TypeString,
46-
Optional: true,
47-
Computed: true,
48-
ForceNew: true,
45+
Type: schema.TypeString,
46+
Optional: true,
47+
Computed: true,
48+
ForceNew: true,
49+
Description: `The ID of the project in which to create the node pool. If blank, the provider-configured project will be used.`,
4950
},
5051
"cluster": {
51-
Type: schema.TypeString,
52-
Required: true,
53-
ForceNew: true,
52+
Type: schema.TypeString,
53+
Required: true,
54+
ForceNew: true,
55+
Description: `The cluster to create the node pool for. Cluster must be present in location provided for zonal clusters.`,
5456
},
5557
"zone": {
56-
Type: schema.TypeString,
57-
Optional: true,
58-
Removed: "use location instead",
59-
Computed: true,
58+
Type: schema.TypeString,
59+
Optional: true,
60+
Removed: "use location instead",
61+
Computed: true,
62+
Description: `The zone of the cluster`,
6063
},
6164
"region": {
62-
Type: schema.TypeString,
63-
Optional: true,
64-
Removed: "use location instead",
65-
Computed: true,
65+
Type: schema.TypeString,
66+
Optional: true,
67+
Removed: "use location instead",
68+
Computed: true,
69+
Description: `The region of the cluster`,
6670
},
6771
"location": {
68-
Type: schema.TypeString,
69-
Optional: true,
70-
Computed: true,
71-
ForceNew: true,
72+
Type: schema.TypeString,
73+
Optional: true,
74+
Computed: true,
75+
ForceNew: true,
76+
Description: `The location (region or zone) of the cluster.`,
7277
},
7378
}),
7479
}
7580
}
7681

7782
var schemaNodePool = map[string]*schema.Schema{
7883
"autoscaling": {
79-
Type: schema.TypeList,
80-
Optional: true,
81-
MaxItems: 1,
84+
Type: schema.TypeList,
85+
Optional: true,
86+
MaxItems: 1,
87+
Description: `Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage.`,
8288
Elem: &schema.Resource{
8389
Schema: map[string]*schema.Schema{
8490
"min_node_count": {
8591
Type: schema.TypeInt,
8692
Required: true,
8793
ValidateFunc: validation.IntAtLeast(0),
94+
Description: `Minimum number of nodes in the NodePool. Must be >=0 and <= max_node_count.`,
8895
},
8996

9097
"max_node_count": {
9198
Type: schema.TypeInt,
9299
Required: true,
93100
ValidateFunc: validation.IntAtLeast(1),
101+
Description: `Maximum number of nodes in the NodePool. Must be >= min_node_count.`,
94102
},
95103
},
96104
},
97105
},
98106

99107
"max_pods_per_node": {
100-
Type: schema.TypeInt,
101-
Optional: true,
102-
ForceNew: true,
103-
Computed: true,
108+
Type: schema.TypeInt,
109+
Optional: true,
110+
ForceNew: true,
111+
Computed: true,
112+
Description: `The maximum number of pods per node in this node pool. Note that this does not work on node pools which are "route-based" - that is, node pools belonging to clusters that do not have IP Aliasing enabled.`,
104113
},
105114

106115
"node_locations": {
107-
Type: schema.TypeSet,
108-
Optional: true,
109-
Computed: true,
110-
Elem: &schema.Schema{Type: schema.TypeString},
116+
Type: schema.TypeSet,
117+
Optional: true,
118+
Computed: true,
119+
Elem: &schema.Schema{Type: schema.TypeString},
120+
Description: `The list of zones in which the node pool's nodes should be located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. If unspecified, the cluster-level node_locations will be used.`,
111121
},
112122

113123
"upgrade_settings": {
114-
Type: schema.TypeList,
115-
Optional: true,
116-
Computed: true,
117-
MaxItems: 1,
124+
Type: schema.TypeList,
125+
Optional: true,
126+
Computed: true,
127+
MaxItems: 1,
128+
Description: `Specify node upgrade settings to change how many nodes GKE attempts to upgrade at once. The number of nodes upgraded simultaneously is the sum of max_surge and max_unavailable. The maximum number of nodes upgraded simultaneously is limited to 20.`,
118129
Elem: &schema.Resource{
119130
Schema: map[string]*schema.Schema{
120131
"max_surge": {
121132
Type: schema.TypeInt,
122133
Required: true,
123134
ValidateFunc: validation.IntAtLeast(0),
135+
Description: `The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater.`,
124136
},
125137

126138
"max_unavailable": {
127139
Type: schema.TypeInt,
128140
Required: true,
129141
ValidateFunc: validation.IntAtLeast(0),
142+
Description: `The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater.`,
130143
},
131144
},
132145
},
133146
},
134147

135148
"initial_node_count": {
136-
Type: schema.TypeInt,
137-
Optional: true,
138-
ForceNew: true,
139-
Computed: true,
149+
Type: schema.TypeInt,
150+
Optional: true,
151+
ForceNew: true,
152+
Computed: true,
153+
Description: `The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource.`,
140154
},
141155

142156
"instance_group_urls": {
143-
Type: schema.TypeList,
144-
Computed: true,
145-
Elem: &schema.Schema{Type: schema.TypeString},
157+
Type: schema.TypeList,
158+
Computed: true,
159+
Elem: &schema.Schema{Type: schema.TypeString},
160+
Description: `The resource URLs of the managed instance groups associated with this node pool.`,
146161
},
147162

148163
"management": {
149-
Type: schema.TypeList,
150-
Optional: true,
151-
Computed: true,
152-
MaxItems: 1,
164+
Type: schema.TypeList,
165+
Optional: true,
166+
Computed: true,
167+
MaxItems: 1,
168+
Description: `Node management configuration, wherein auto-repair and auto-upgrade is configured.`,
153169
Elem: &schema.Resource{
154170
Schema: map[string]*schema.Schema{
155171
"auto_repair": {
156-
Type: schema.TypeBool,
157-
Optional: true,
158-
Default: false,
172+
Type: schema.TypeBool,
173+
Optional: true,
174+
Default: false,
175+
Description: `Whether the nodes will be automatically repaired.`,
159176
},
160177

161178
"auto_upgrade": {
162-
Type: schema.TypeBool,
163-
Optional: true,
164-
Default: false,
179+
Type: schema.TypeBool,
180+
Optional: true,
181+
Default: false,
182+
Description: `Whether the nodes will be automatically upgraded.`,
165183
},
166184
},
167185
},
168186
},
169187

170188
"name": {
171-
Type: schema.TypeString,
172-
Optional: true,
173-
Computed: true,
174-
ForceNew: true,
189+
Type: schema.TypeString,
190+
Optional: true,
191+
Computed: true,
192+
ForceNew: true,
193+
Description: `The name of the node pool. If left blank, Terraform will auto-generate a unique name.`,
175194
},
176195

177196
"name_prefix": {
178-
Type: schema.TypeString,
179-
Optional: true,
180-
Computed: true,
181-
ForceNew: true,
197+
Type: schema.TypeString,
198+
Optional: true,
199+
Computed: true,
200+
ForceNew: true,
201+
Description: `Creates a unique name for the node pool beginning with the specified prefix. Conflicts with name.`,
182202
},
183203

184204
"node_config": schemaNodeConfig(),
@@ -188,12 +208,14 @@ var schemaNodePool = map[string]*schema.Schema{
188208
Optional: true,
189209
Computed: true,
190210
ValidateFunc: validation.IntAtLeast(0),
211+
Description: `The number of nodes per instance group. This field can be used to update the number of nodes per instance group but should not be used alongside autoscaling.`,
191212
},
192213

193214
"version": {
194-
Type: schema.TypeString,
195-
Optional: true,
196-
Computed: true,
215+
Type: schema.TypeString,
216+
Optional: true,
217+
Computed: true,
218+
Description: `The Kubernetes version for the nodes in this pool. Note that if this field and auto_upgrade are both specified, they will fight each other for what the node version should be, so setting both is highly discouraged. While a fuzzy version can be specified, it's recommended that you specify explicit versions as Terraform will see spurious diffs when fuzzy versions are used. See the google_container_engine_versions data source's version_prefix field to approximate fuzzy versions in a Terraform-compatible way.`,
197219
},
198220
}
199221

0 commit comments

Comments
 (0)