Commit Graph

33 Commits

Author SHA1 Message Date
justinsb da233efe11 gce: Prune old forwarding rules
Now that we create an new forwarding rule for kops-controller, we want
to remove the old one after the rolling-update.
2024-02-24 12:20:20 -05:00
justinsb ba7facff41 gce: Always create an internal load balancer
When we create a external load balancer on GCE, we now also create an
internal load balancer.  The internal load balancer is used for
node/pod -> control-plane traffic, the external load balancer is used
for other traffic (e.g. "user" traffic to kube-apiserver).

This means that we can apply more granular firewall rules, and
generally avoid complex logic around discovery of the internal control
plane addresses for GCE.
2024-02-24 12:20:19 -05:00
justinsb 50776a7e92 Refactor ForAPIServer
We instead return a list of the services we are supporting.

We can in future split out internal and external apiserver services.
2024-01-12 15:53:41 -05:00
Ciprian Hacman 41d4e54920 Replace `k8s.io/utils/strings/slices` with `golang.org/x/exp/slices` 2024-01-09 08:40:57 +02:00
upodroid ecf212d736 add --node-instance-group flag to ginkgo 2023-10-26 23:08:18 +01:00
justinsb 7bc5a71773 gce load balancers: set LoadBalancingScheme to EXTERNAL explicitly
This avoids a spurious change being printed, and is more correct - we
actually want this to be external (vs nil, which implicitly means
"don't care").
2023-07-29 08:15:29 +03: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
justinsb fb8e80e3f5 gce: Set labels on ForwardingRules
We add the cluster-name label, now that labels are supported on
ForwardingRules.
2023-07-28 23:48:41 -04:00
justinsb 3613f586c8 GCE: Set firewall rules for Internal LBs also
It seems we can use the exact same rules.
2023-07-09 19:25:42 -04:00
Ciprian Hacman 04a4e02920 gce: Update logic for internal LB 2023-07-08 04:34:43 +03:00
justinsb be588e830f gce: set ip address family on all FirewallRule tasks
We had missed a few code paths previously.
2023-04-18 03:45:09 -04:00
Ciprian Hacman 88fd444987 gcp: Update terraform rendering for Target Pool 2023-03-16 08:55:15 +02:00
Ciprian Hacman 1db17ab949 gcp: Update terraform rendering for HTTP Health Check 2023-03-16 08:10:25 +02:00
Justin SB eb7d3c958c gce: When using network native pod IPs, open firewall to apiserver
If we're not masquerading the pod IPs, we need an explicit firewall
rule for the pods to reach the kube-apiserver.  Normally this is
permitted anyway, but if the apiserver has a locked-down CIDR range
(as the e2e tests do) then we need our own rule.
2023-03-02 13:15:58 -05:00
John Gardiner Myers 7c3e32369a Refactor Context into separate cloudup and nodeup types 2022-12-17 17:42:46 -08:00
Ciprian Hacman b9f7c2619b gce: Add support for clusters without DNS 2022-12-14 11:09:54 +02:00
John Gardiner Myers 235aa61594 v1alpha3: move networking fields under networking 2022-12-02 19:19:59 -08:00
John Gardiner Myers d39ba74bd7 Change the control-plane IG role to "ControlPlane" in v1alpha3 API 2022-11-22 17:05:29 -08:00
John Gardiner Myers bc36f5b022 Rename ClusterSubnetSpec's ProviderID field to ID 2022-11-20 15:36:54 -08:00
John Gardiner Myers 5fca16aa30 v1alpha3: Move API-related settings under API 2022-11-19 10:27:12 -08: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
Jesse Haka 3e505a559e add missing import 2022-02-07 21:35:01 +02:00
Jesse Haka 180c3ae475
Update pkg/model/gcemodel/api_loadbalancer.go
Co-authored-by: Peter Rifel <rifelpet@users.noreply.github.com>
2022-02-07 21:32:05 +02:00
Jesse Haka d3fac0c1be GCP API health checks 2022-02-03 21:02:21 +02: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
John Gardiner Myers 7c9e7e9286 Make Lifecycle field non-pointer 2021-06-02 23:02:16 -07:00
John Gardiner Myers 43d8d97e7c Set lifecycle in GCE APILoadBalancerBuilder 2021-05-31 10:39:34 -07:00
John Gardiner Myers 86f157fa27 Refactor how api-server addresses are exported from tasks 2020-06-26 21:38:39 -07:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
chrislovecnm 1e418c3e13 more goimport updates 2017-11-04 10:03:02 -06:00
Justin Santa Barbara 3dfe48e5ae Wiring up lifecycle 2017-07-15 22:03:54 -04:00
Justin Santa Barbara be9a40e42c Fixes per code review 2017-03-28 00:58:13 -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