Skip to content

Commit c0ce85e

Browse files
issue #475: add doc about GKE node pools in terraform (#5289) (#3711)
Short explanation about why GKE node pools should be defined separately from the cluster resource when using terraform. Signed-off-by: Modular Magician <[email protected]>
1 parent 6fc2df3 commit c0ce85e

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

.changelog/5289.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
container: Added note about why node pools should be defined separately from the cluster
3+
```

google-beta/resource_compute_security_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/hashicorp/errwrap"
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1212
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
13-
"google.golang.org/api/compute/v0.beta"
13+
compute "google.golang.org/api/compute/v0.beta"
1414
)
1515

1616
func resourceComputeSecurityPolicy() *schema.Resource {

google-beta/resource_gke_hub_feature_membership_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"testing"
77

8-
"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
8+
dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
99
gkehub "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/gkehub/beta"
1010
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"

website/docs/r/container_cluster.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ resource "google_container_node_pool" "primary_preemptible_nodes" {
6161
}
6262
```
6363

64+
~> **Note:** It is recommended that node pools be created and managed as separate resources as in the example above.
65+
This allows node pools to be added and removed without recreating the cluster. Node pools defined directly in the
66+
`google_container_cluster` resource cannot be removed without re-creating the cluster.
67+
6468
## Example Usage - with the default node pool
6569

6670
```hcl

0 commit comments

Comments
 (0)