Commit Graph

45 Commits

Author SHA1 Message Date
Nick Travers ddaedb4ef9 upup: gcetasks: fix diffs in instance template and router
Use the last component of the self-url for a router's region, rather
than the full URL.

Explicitly set the boolean pointer for `HasExternalIP` if the interface
attached to the instance does not have an access config (i.e. has no
public internet access).

Without this patch, both the router and instance template show pending
updates, neither of which can be applied as both are immutable
resources.

Signed-off-by: Nick Travers <n.e.travers@gmail.com>
2021-05-11 13:39:36 -07:00
John Gardiner Myers 57dec35f68 Split out TerraformWriter 2021-05-02 21:54:46 -07:00
John Gardiner Myers 7921a5bd7e Separate TerraformTarget.AddFile() into two receivers 2021-05-02 16:47:33 -07:00
Kenji Kaneda 71f52363f8 Add a lifecycle test for GCE
- Move MockGCECloud to cloudmock/gce.
- Change Compute() and CloudDNS() of GCECloud to return interfaces
  for mocking
2021-04-26 13:05:27 -07:00
Kenji Kaneda f37330f53d Add GCE Router task
This commit picks up the change from the previous attempt
(https://github.com/kubernetes/kops/pull/6828).

- Add Router to GCE tasks
- Add the HasExternalIP field to InstanceTemplate
- Create a RouterTask and set HasExternalIP to false when
  a private topology is specified.

https://github.com/kubernetes/kops/issues/6827
2021-04-23 23:03:38 -07:00
Justin Santa Barbara 5779f29e15 GCE: Don't warn about NVME
NVME only works with Local SSDs, which have their own restrictions;
it isn't a must-support GA blocker (which is why we had the log
previously)
2021-01-09 13:55:33 -05:00
Justin SB 8fb7f1930d
Use Region method of fi.Cloud
There's no need to track it separately, now that we have the Region
method on the Cloud interface.
2020-12-21 20:50:54 -06:00
Justin SB 1945a656a0 Remove deprecated ResourceHolder
Cleaning up what is now dead code.
2020-12-19 23:15:37 -05:00
Justin SB 45d11ba12c Replace (some) deprecated ResourceHolder with Resource
This removes more of the deprecated type, but it also simplifies
refactoring the GCE InstanceTemplate.
2020-12-19 09:51:43 -05:00
Justin SB 73b075d3b2 GCE: ignore (output-only) networkInterface.name
This field was causing spurious differences to be detected.

We probably should be comparing the values in the kops model, not the
GCE model.
2020-11-15 10:31:24 -05:00
Peter Rifel 4d9f0128a3
Upgrade to klog2
This splits up the kubernetes 1.19 PR to make it easier to keep up to date until we get it sorted out.
2020-08-16 20:56:48 -05:00
Justin SB 53c464c305 GCE: Fix spurious comparison failures on adddress & InstanceTemplate
Spruce up the find logic to avoid detecting changes that aren't there.
2020-08-03 13:00:04 -04:00
John Gardiner Myers f72dac180d Switch to new fitasks marker 2020-07-28 11:48:08 -07:00
John Gardiner Myers eb94877ee9 Revert move to explicit dependencies
The change to explicit dependencies lost the dependencies
that were previously found by reflection.
2020-07-20 22:10:46 -07:00
John Gardiner Myers 87446f8894 Make all users of userdata declare it as a dependency 2020-06-26 10:31:52 -07:00
Peter Rifel 964d402eb5
Store terraform launchtemplate userdata in plaintext rather than b64
This makes it easier to grok the userdata contents
2020-06-16 16:53:49 -05:00
Peter Rifel ef6abbcd5c
Don't use file references for single line strings in gce's metadata fields 2020-05-06 23:06:24 -05:00
Peter Rifel 7d845e5c38
Remove redundant literal function. LiteralFromStringValue is more commonly used. 2020-05-06 23:04:03 -05:00
eric-hole f25b26ff07 Migrates GCE sdk from v0.beta to v1 2020-04-24 10:54:19 -07:00
Peter Rifel ef76409046 Add support for writing maps of literals, used by gce metadata 2020-04-08 22:16:57 -05:00
Peter Rifel 2a48c70ea8 Copy GCE instance fields into both Instance and InstanceTemplate
The hcl2 library doesn't handle embedded types well,
so rather than trying to detect it with reflection I figured it was easier to just get rid of the one case of it.
This copies the fields from the embedded type into both Instance and InstanceTemplate, updating the receiver functions to instead return the value for the field that was being modified.
2020-04-08 21:18:50 -05:00
Peter Rifel 04a5ead08e Add cty field tags to Terraform structs 2020-04-05 21:18:02 -05:00
eric-hole c59314a799 Adds some initial tests. Fixes some logic
Need to fix service account implementation first

Fixing tests and iterating on the serviceaccount logic

Run the gce_byo_sa test
2020-04-04 21:20:31 -07:00
eric-hole b3d65ffce0 Adds a gce-service-account flag so you BYO service-account
Generated code and some cleanup

Not sure where that code went

Tests for service account

fixes case on gceserviceaccount
2020-04-04 21:15:56 -07:00
Christian van der Leeden ddc0879e6d some resources upgraded to google provider 3.0 2019-12-13 19:13:59 +01:00
tanjunchen 43bf6bdab6 fix-up gosimple check error 2019-10-07 11:59:57 +08:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Justin SB 62f7c26f98
Support "gce" networking mode, which uses ip aliases 2019-07-19 07:54:13 -04:00
Justin SB 3e33ac7682
Change code from glog to klog
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog.  That
will happen when we update to k8s 1.13.
2019-05-06 12:54:51 -04:00
Justin Santa Barbara 6015336098 GCE: Set network tier, to avoid spurious changes
Otherwise we were seeing instance templates changing every time.

PREMIUM is the default, so we set it to PREMIUM for compatability.  In
future we may want to expose this option.
2018-06-14 11:08:58 -04:00
Justin Santa Barbara d71bd09a6c GCE: Limit length of InstanceTemplate
We explicitly set a separate prefix for the names, and we ensure it is
not too long
2017-10-10 09:48:38 -04:00
Justin Santa Barbara 0c89c9851e Simple code updates for 1.8 breakages 2017-10-01 13:17:40 -04:00
Justin Santa Barbara 73dd870118 GCE integration test: verify TF output 2017-09-23 16:27:15 -04:00
Kubernetes Submit Queue 80928386e8 Merge pull request #3404 from justinsb/gce_instancetemplate_matching
Automatic merge from submit-queue. .

GCE: Prevent instancetemplate spurious mismatches
2017-09-20 12:51:57 -07:00
Justin Santa Barbara 487b83a8ca GCE: Prevent instancetemplate spurious mismatches
The lack of a Kind on the networkInterface was causing the
InstanceTemplate to be considered dirty.
2017-09-17 14:25:23 -04:00
Justin Santa Barbara 0e03fb61ad GCE: Ignore the Lifecycle field for change detection
Not copying the Lifecycle field causes spurious changes to be detected.
2017-09-17 14:11:36 -04:00
chrislovecnm 0779fb6fc4 Implementing GCE as an inteface modelling aws cloud provider 2017-08-27 22:19:25 -06:00
Justin Santa Barbara 3e1ce4f950 Add Lifecycle 2017-07-15 22:01:03 -04:00
Justin Santa Barbara 5e5e37e2e2 GCE: Allow updating the instance group template
We follow the same pattern as on AWS, where we create a new template,
because the templates are immutable.
2017-05-16 10:49:07 -04:00
Justin Santa Barbara c9ac0cdbd8 Support GCE ForwardingRule (LoadBalancer) for API
Also lots of GCE cleanup
2017-03-28 00:00:20 -04:00
Justin Santa Barbara 3d14d07616 Support cloud-config on GCE 2017-02-28 20:08:03 -05:00
Justin Santa Barbara 645f330dad Re-enable GCE support
We move everything to the models.  We feature-flag it, because we
probably want to change the names etc, and we aren't going to be able to
offer smooth upgrades until that is done.
2017-02-28 20:08:03 -05:00
chrislovecnm 8fa2aac99f fixing more headers 2016-10-15 19:20:56 -06:00
Justin Santa Barbara d427858477 Rename to kops
The upup tool is now called kops, and we have moved repos
2016-06-30 09:25:25 -04:00
Justin Santa Barbara c72593fcf7 Use generators in tasks 2016-05-30 17:46:36 -04:00