Commit Graph

66 Commits

Author SHA1 Message Date
Dana Hoffman
974c3f7646
Add GKE Shared VPC support (#1528)
All this needed was to allow setting the network/subnetwork to a self link.

~WIP for now because I want to run the tests in CI.~ Tests are passing.
2018-05-23 16:47:17 -07:00
Nathan McKinley
e37c25abe5
Can't move from region to region without a recreate. (#1456) 2018-05-09 12:55:28 -07:00
Dana Hoffman
8907321d60
Roll forward beta scaffolding PR (#1453)
* Revert "Merge pull request #1434 from terraform-providers/paddy_revert_beta"

This reverts commit 118cd71201, reversing
changes made to d59fcbbc59.

* add ConvertSelfLinkToV1 calls to places where beta links are stored
2018-05-09 11:24:40 -07:00
Vincent Roseberry
9cb159f992
ValidateFunc accepts blank value for cluster_ipv4_cidr (#1446)
* ValidateFunc accepts blank value for cluster_ipv4_cidr in google_container_cluster

* Simplify tests
2018-05-07 15:34:56 -07:00
Paddy Carver
f91c62d598 Revert "remove switch statements between api versions for container"
This reverts commit 9c85e57b8c7e84de385995df7ca04dd93e843f5b.
2018-05-04 07:52:42 -07:00
Dana Hoffman
d59fcbbc59
Remove switch statements between api versions for container; clean up dead version code (#1427)
* remove switch statements between api versions for container

* remove dead api version code and move things around
2018-05-03 21:51:54 -07:00
emily
ac64624adc
Add issue_client_certificate to cluster (#1396) 2018-04-27 18:06:26 -07:00
Darren Haken
2b1b668953 #1300 Supporting regional clusters for node pools (#1320)
This PR also switched us to using the beta API in all cases, and that had a side effect which is worth noting, note included here for posterity.

=====
The problem is, we add a GPU, and as per the docs, GKE adds a taint to
the node pool saying "don't schedule here unless you tolerate GPUs",
which is pretty sensible.

Terraform doesn't know about that, because it didn't ask for the taint
to be added. So after apply, on refresh, it sees the state of the world
(1 taint) and the state of the config (0 taints) and wants to set the
world equal to the config. This introduces a diff, which makes the test
fail - tests fail if there's a diff after they run.

Taints are a beta feature, though. :) And since the config doesn't
contain any taints, terraform didn't see any beta features in that node
pool ... so it used to send the request to the v1 API. And since the v1
API didn't return anything about taints (since they're a beta feature),
terraform happily checked the state of the world (0 taints I know about)
vs the config (0 taints), and all was well.

This PR makes every node pool refresh request hit the beta API. So now
terraform finds out about the taints (which were always there) and the
test fails (which it always should have done).

The solution is probably to write a little bit of code which suppresses
the report of the diff of any taint with value 'nvidia.com/gpu', but
only if GPUs are enabled. I think that's something that can be done.
2018-04-24 17:55:21 -07:00
Nathan McKinley
de9363502b
Fix for networkPolicyEnabled test - must explicitly add default network policy. (#1363) 2018-04-20 11:39:20 -07:00
Nathan McKinley
039e82cf6d
Regional cluster update support for additional zones (#1359) 2018-04-19 14:17:38 -07:00
Nathan McKinley
92d98fc8e1
Make sure that additional zones are added-then-removed instead of all at once. (#1354) 2018-04-18 17:29:07 -07:00
Ben Galvin
1c992ab241 Use correct project id regex in instanceGroupManagerURL (#1311) 2018-04-10 09:52:54 -07:00
ashish-amarnath
f488a6e6bf Add support for regional GKE clusters in google_container_cluster (#1181)
* Add support for regional GKE clusters in google_container_cluster:

* implement operation wait for v1beta1 api
* implement container clusters get for regional clusters
* implement container clusters delete for regional cluster
* implement container clusters update for regional cluster
* simplify logic by using generic 'location' instead of 'zone' and 'region'
* implement a method to generate the update function and refactor
* rebase and fix

* reorder container_operation fns

* cleanup

* add import support and docs

* additional locations cleanup
2018-04-05 14:51:35 -07:00
Michael Parker
b8adcc28fe Updates container_cluster to set enable_legacy_abac to false by default (#1281)
* Updates the default GKE legacy ABAC setting to false

* Updates docs for container_cluster

* Update test comments

* Format fix

* Adds ImportState test step to default legacy ABAC test
2018-04-04 10:58:08 -07:00
emily
360260d8d0
Add project to container cluster import name. (#1282)
* allow import of container cluster by project as well

* update docs for importing container cluster with project

* combine tests
2018-04-03 13:39:28 -07:00
Janos Lenart
1840363c74 Adding private_cluster (#1250)
* Updated google.golang.org/api/container/v1beta1

* Added support for private_cluster and master_ipv4_cidr

This is to implement #1174. See
https://groups.google.com/forum/#!topic/google-cloud-sdk-announce/GGW3SQSANIc

* Added simple test for private_cluster and master_ipv4_cidr

* Review replies

* Added some documentation for private_cluster
2018-03-30 10:10:25 -07:00
Dana Hoffman
42cca119eb add gke taints 2018-03-27 14:55:42 -07:00
Dana Hoffman
685842410e
Add update support for pod security policy (#1195)
* move setid calls back

* Revert "move setid calls back"

This reverts commit 0c7b2dbf92aff33dac8c5beb95568c2bc86dd7de.

* add update support for pod security policy

* update test

* add comment about updates
2018-03-23 11:27:37 -07:00
Dana Hoffman
95f96674a8
add ability to delete the default node pool (#1245) 2018-03-22 17:22:44 -07:00
Nathan McKinley
e717edb7a6
Add network policy config. (#1200) 2018-03-15 14:50:24 -07:00
Dana Hoffman
fe8ceed1d5
Add support for GKE metadata concealment (#1199)
* add support for gke metadata concealment

* docs for metadata concealment
2018-03-15 13:28:30 -07:00
Dana Hoffman
65147fd23e
Add support for pod security policy (#1192)
* move setid calls back

* add support for pod security policy

* pod security policy docs

* Revert "move setid calls back"

This reverts commit 0c7b2dbf92aff33dac8c5beb95568c2bc86dd7de.

* cleanup

* remove comments about disabling update
2018-03-14 14:00:31 -07:00
Dana Hoffman
46fb949c1f
Set ID for GKE resources before waiting (#1158) 2018-03-07 11:06:00 -08:00
Dana Hoffman
6d8a8b1747
Add more beta scaffolding for GKE resources (#1139)
* vendor container/v1beta1

* revendor container/v1beta1

* add beta scaffolding for gke resources

* fix json unmarshal error

* fix issues with trying to convert interface instead of struct

* same fixes but for node pool

* move setid calls back
2018-03-06 17:44:05 -08:00
Nathan McKinley
58a7ef9d03
Fix incorrect result on Read ignoring most authorized networks. (#1097) 2018-03-01 13:19:18 -08:00
Vincent Roseberry
5f32d7e87a
Fix TestAccContainerCluster_withIPAllocationPolicy test (#1065)
* Remove bad test in testAccContainerCluster_withIPAllocationPolicy

One step was expecting the test to fail if the subnetwork defines
secondary ip ranges that the cluster doesn't use. However, it is
perfectly fine to do so and we don't expect an error.

* Revert "Remove bad test in testAccContainerCluster_withIPAllocationPolicy"

This reverts commit af2f369907181a107cfc0ed9fa2ff0e288f02f66.

* Fail if use_ip_aliases is true and no range names is provided

* make fmt

* don't introduce new field for now. Wait until we want to support new feature in allocation policy
2018-02-09 13:55:38 -08:00
Vincent Roseberry
e8c5266a2f
Mark subnetwork field in container cluster as computed (#1061)
* Mark subnetwork field in container cluster as computed

* make fmt
2018-02-08 10:04:16 -08:00
Emily Ye
41a0fddfbd remove multiple locks from cluster update and add lock helper 2018-02-05 09:45:53 -08:00
Emily Ye
10ef26a905 actually fix container_network_policy diff suppress and add test 2018-02-01 10:25:12 -08:00
Emily Ye
5f3070e223 add diff suppress for empty network policy in container cluster 2018-01-31 14:36:03 -08:00
Vincent Roseberry
6ba6dfa6d2
Ensures operation on a cluster are applied serially (#937) 2018-01-09 12:39:04 -05:00
Dana Hoffman
585c734503
Set default scopes when creating GKE clusters/node pools (#924)
* set scopes by default

* clarify list -> list/set
2018-01-08 15:54:45 -08:00
Vincent Roseberry
dab491d28d
Make zone field consistent and truly optional for all resources (#914) 2018-01-03 16:18:40 -05:00
Michael Bannister
18534c9e7d Don't recreate container_cluster when maintenance_window changes (#893)
* Don't recreate container_cluster when maintenance_window changes

Fixes #727

* Omit ForceNew when false

Review comments for PR #893

* Move MaintenancePolicy mapping logic into expand/flatten functions

Review comments for PR #893

* Improve acceptance test for maintenance window update/removal

Review comments for PR #893
2017-12-27 12:29:14 -08:00
Nathan McKinley
114b646fae
Enable 'zone' to be specified at the provider level instead of per-resource. (#816)
- Fetch Zone attribute any place where it *was* being fetched from the schema by
	combination schema / provider-level attribute.
- Allow region to be unspecified if zone is specified.
- Switch one example to using provider-level zone as an example.
- Make provider-level zone optional.  (Individual resources will fail if they can't find a zone.)
- Add tests for getZone and getRegion.
2017-12-06 14:30:04 -08:00
Vincent Roseberry
8f701c6ebb
Remove getNetworkName method and use ParseNetworkFieldValue instead (#802) 2017-11-29 10:54:10 -08:00
Vincent Roseberry
6c5d6b72e0
Store project and region in state (#784)
* Store project and region in state

* Delete unused project in runtimeconfig_variable
2017-11-27 16:32:20 -08:00
David Quarles
d57db91143 add support for ip aliasing in google_container_cluster (#654)
* add support for ip aliasing in `google_container_cluster`

* [review] cleanup galore, infer feature enablement from `ip_allocation_policy`

* [review] cleanup, round 2

* add nil check back (when reading ip allocation policy from API)
2017-11-27 18:15:03 -05:00
Sébastien GLON
39f22ef924 [WIP] Add container cluster network policy addon (#630)
* replalce TypeList by TypeSet

* Add network policy

* test improvement

* correct test

* Add cluster network polocy enabled

* Replalce network_policy addons by global network_policy enabled

* Update node_config.go

* Update resource_container_cluster.go

* clean

* clean

* Correct PR

* COrrect PR

* pr

* fix test to use same name

* add more documentation
2017-11-27 15:40:07 -05:00
Vincent Roseberry
0c0caee7ba
Standardize on test env var for region, creds and project (#770) 2017-11-21 09:34:32 -08:00
Michael Bannister
ee641e0b1f Relax diff on maintenance_policy.daily_maintenance_window.start_time (#726)
* Relax diff on maintenance_policy.daily_maintenance_window.start_time

If the maintenance window has been set outside of Terraform to a time with a
single-digit hour (such as 1:00), and the terraform definition is set to the
same hour but with a leading zero as per validation (i.e. 01:00), do not
consider the time to be changed (as we currently don't support update on this
property).

Fixes #719

* Generalise rfc3339TimeDiffSuppress and add more test cases
2017-11-13 11:30:26 -08:00
Michael Bannister
12060f9f3d Add support for maintenance window on google_container_cluster (#670)
* Add support for maintenance window on google_container_cluster (#526)

* Address review comments

- Set ForceNew: true on the schema element daily_maintenance_window
- Correct resource name in acceptance test
- Correct documentation of resource attribute maintenance_policy.0.daily_maintenance_window.0.duration
2017-11-07 15:42:11 -08:00
David Quarles
ca7551c8c5 Add support for master authorized networks in google_container_cluster (#626)
* Add support for master authorized networks in `google_container_cluster`

* [review] remove enabled flag / restructure schema

- remove `google_container_cluster.master_authorized_networks_config.enabled`
- add `display_name` and restructure schema as follows:
    master_authorized_networks_config {
        cidr_blocks {
            cidr_block   = "0.0.0.0/0"
            display_name = "foo"
        }
    }
- amend tests

* [review] add test for validateRFC1918Network, fix acc test
2017-11-02 10:38:20 -07:00
Henry Bell
026d76616d Add support for Kubernetes alpha features (#646)
* Add support for Kubernetes alpha features

* Add tests for support of Kubernetes alpha features

* Fix dodgy copy and paste operations

* Add documentation
2017-10-31 16:38:18 -07:00
Dana Hoffman
adbb5dd4fb
Update GKE docs to match actual schema; reorder fields in schema (#637)
* reorder schemas and update docs

* initial_node_count is optional

* clarify when initial_node_count must be set
2017-10-27 15:18:34 -07:00
Dana Hoffman
7c2bf7f4a7 make addons_config updatable (#597) 2017-10-20 09:47:07 -07:00
Dana Hoffman
62eb5ceedf Allow updating google_container_cluster.monitoring_service (#598) 2017-10-20 09:46:21 -07:00
Dana Hoffman
811530f145 Fix cluster version upgrades (#577)
* wait for running status on a cluster on read

* add min_master_version field

* respond to comments

* add docs

* no node_version on create
2017-10-12 11:21:33 -07:00
Dana Hoffman
d67bf7b3fc add master_version to container cluster (#538) 2017-10-06 15:48:01 -07:00
Dana Hoffman
bb0ab8e1f6 Merge the schemas and logic for the node pool resource and the node pool field in the cluster to aid in maintainability (#489) 2017-10-03 17:09:34 -07:00