Commit Graph

47 Commits

Author SHA1 Message Date
justinsb d9377e4e56 gce: don't logspam when next-route-hop is starting
Observed this when a machine was first starting up.
2023-08-19 13:08:15 -04:00
justinsb 3cce79d4e4 gce: Refactor resource labeling
Create a more strongly-typed label object and use it when labeling
cluster resources.
2023-07-28 23:48:41 -04:00
Ciprian Hacman 141f6065f9 Don't pass region to ListResources 2022-12-05 09:40:38 +02:00
Ciprian Hacman f7d434ee2c Refactor ListResources to not require passing the Cluster object 2022-12-05 09:10:58 +02:00
Ciprian Hacman 85026145a1 Always infer gossip DNS from cluster name 2022-10-02 12:54:37 +03:00
Ciprian Hacman 5e3e9fabd0 Limit GCE network names to 63 chars 2022-08-17 06:37:26 +03:00
Ciprian Hacman d2e614dd3e Refactor ClusterPrefixedName and ClusterSuffixedName to not return error 2022-06-30 07:59:52 +03:00
Ciprian Hacman bdb1f509f0 Fix cleanup of firewall rules that contain the cluster name hash 2022-06-29 06:30:14 +03:00
Ciprian Hacman 377e26d407 Clean-up firewall rules that contain targets with the cluster name hash 2022-06-25 10:52:30 +03:00
Ciprian Hacman d34e0fd1e0 Fix GCE resource tracking 2022-06-23 19:50:39 +03:00
Nat Henderson 9b08c4bb51 Enable internal load balancers when running on GCP
* Add ILBs, broadly following the AWS model.  The following new
capabilities are added for clusters in GCP:
  * Cluster's spec.api.loadBalancer can be set to 'type: internal' on
    GCP.
    * Therefore, GCP can now create:
        * regional backend services
        * regional (non-legacy) healthchecks
        * firewall rules with "internal" load-balancing scheme
        * firewall rules with dot-notation-specified IP addresses
  * Cluster's spec.api.loadBalancer's 'subnets' field functions
    as in the AWS model.

A few incidental changes are included, either because this change
touched the relevant code or because my use case happened to trigger the
issues that are fixed here.

* Cluster's spec.networkID field can be prefixed by project to use
  GCP's common cross-project networking model.
    * The presumption is that all specified subnets belong to this
      network and therefore this project.

* Add missing operation wait on forwarding rule creation.

* Some Terraform output improvements:
    * Permit no-ACL files in GCS buckets in Terraform output.
    * Enable marginally better cross-resource reference in Terraform outputs
    * Add project to network + subnetwork literals in Terraform output.
    * Add terraform output to backend services and health checks.

Testing:
  * Add mocks for backend services and health checks.
  * Add minimal integration test - copied from gce_private and ilb added.
  * Add update cluster goldens.

Co-authored-by: Travis Reid <travis_reid@apple.com>
2022-04-25 13:31:47 -07:00
Ole Markus With ce2e877aeb Remove bazel files from vendor 2022-04-12 13:29:03 +02:00
Kubernetes Prow Robot 02dc9dd8b3
Merge pull request #13201 from zetaab/removesa
cleanup GCP Cluster Service Accounts
2022-02-23 04:24:19 -08:00
Jesse Haka 67beb3fef5 add const 2022-02-23 10:52:08 +02:00
Jesse Haka 0a19533410 remove GCE Cluster Service Accounts 2022-02-04 16:46:27 +02:00
Jesse Haka d3fac0c1be GCP API health checks 2022-02-03 21:02:21 +02:00
justinsb 1eedb7ddee gce: clean up networking objects by reference
We try to avoid cleaning up by name, and prefer checking references to
(e.g. targeting) a known resource, like an instancegroup.
2021-12-17 10:08:09 -05:00
Jesse Haka 8f3b42222b Cleanup GCE loadbalancers created by k8s 2021-12-05 12:26:43 +02:00
justinsb 9f125b1db4 gce: Add network & subnet to toolbox dump
Now that we're better managing networks & subnets on GCE, we should
include them.
2021-12-04 11:30:27 -05:00
Kubernetes Prow Robot 0be79b25b7
Merge pull request #12867 from hakman/gofumpt_script
Add gofumpt scripts
2021-12-01 22:13:32 -08:00
Peter Rifel 00a8a68f01
Fix area/provider/gcp GitHub label assignment 2021-12-01 22:43:43 -06:00
Ciprian Hacman ea7df00719 Run hack/update-gofmt.sh 2021-12-01 22:39:50 +02:00
justinsb cfd4e91a2c GCE: Fix race around route deletion
Because the control-plane can recreate routes, there's a race between
deleting instances and deleting routes.  Add a dependency so we don't
try to delete routes until after we've deleted all the instances.
2021-11-21 10:14:02 -05:00
justinsb 344cc3edef GCE: Delete routes with long cluster names
GCE "classic" networking sets up routes to each instance.  The route
name looks like `<cluster-name>-<uuid>`.

If the cluster name is long enough, it will be truncated.  This was
confusing the route cleanup logic.
2021-10-27 09:34:36 -04:00
justinsb e3c3671f76 GCE: Support network deletion 2021-10-24 17:41:14 -04:00
justinsb 1823bc5963 GCE: Fix subnet deletion
Subnets are created & owned for IPAlias mode.  We weren't deleting
them because of a bug deleting when there is a hyphen in the name (and
by default they are named after the region, which has a hyphen).
2021-09-20 09:29:08 -04:00
Justin SB 0722124e8e Initial IPv6 support for GCE
Supporting IPv6 values where they can be set by the user, and ensuring
that IPv4 and IPv6 firewall rules are split because on GCP they cannot
be in the same rule.
2021-08-21 20:09:31 -04: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
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
Kubernetes Prow Robot b738f8e946
Merge pull request #8869 from justinsb/follow_on_8250
GCE DNS Cleanup: Print record name
2020-04-29 21:18:18 -07:00
eric-hole f25b26ff07 Migrates GCE sdk from v0.beta to v1 2020-04-24 10:54:19 -07:00
Justin Santa Barbara be1a03a3c0 GCE DNS Cleanup: Print record name
Use the GroupKey to pass the zone name, meaning the name can be the
user-facing value.

Follow-on to #8250
2020-04-07 22:11:09 -04:00
Christian van der Leeden eb3bb41c6b kops delete will also delete the DNS entries for GCE 2020-04-07 10:37:00 -04:00
Peter Rifel a999b3ea61 fix OWNERS labels format
These need to be lists
2020-03-10 22:47:50 -05:00
Peter Rifel 237a125f2c Add labels to OWNERS files
This will automatically label PRs that touch these directories.

This makes it easier to query GitHub for PRs that affect certain areas of the code.

I mostly used existing labels but created some new ones as well.
2020-03-10 08:35:58 -05:00
tanjunchen fa6d0130c8 remove unused functions and simplify return str 2019-10-15 23:54:10 +08:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Justin SB 4a8997a71d
GCE: support subnet deletion 2019-07-19 07:57:44 -04:00
Justin SB 76d03b3f71
Generated files: glog -> klog 2019-05-06 12:56:03 -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
Mike Splain 45a57915e2 Fix bazel deprecation notice 2018-02-26 09:36:13 -05:00
chrislovecnm 4dd3bb1dea Updating bazel BUILD files with new go_rules version 2017-12-29 15:03:14 -07:00
Justin Santa Barbara f03cc5dbd9 Update dnsprovider imports to use our version 2017-12-13 20:43:01 -05:00
chrislovecnm 609e268a1d gazelle updates with new bazel version 2017-11-05 17:41:53 -07:00
Justin Santa Barbara b3e00c0dd1 GCE Dump: Include instance IPs
The challenge here is that we normally only get the instance url.  So we
have to do another call to GCE, but we also don't want to do one call
per instance.

Instead, we create a dump operation context object which we pass into the dump.
2017-10-29 23:22:40 -04:00
Justin Santa Barbara 1f0601126c Refactor gce resources into pkg/resources/gce
Should be a no-op refactor
2017-10-29 18:37:23 -04:00