Commit Graph

97 Commits

Author SHA1 Message Date
Ciprian Hacman 5e3e9fabd0 Limit GCE network names to 63 chars 2022-08-17 06:37:26 +03:00
Ivan Volynkin 329c60cc62 Adding GCE SPOT support 2022-07-14 20:19:50 +03:00
Ciprian Hacman 7fbf2705dd Limit GCE router name to 63 chars 2022-07-01 07:37:30 +03:00
Ciprian Hacman 5a8472313f Limit GCE names to 63 chars for various resources 2022-06-30 14:15:17 +03:00
Ciprian Hacman d2e614dd3e Refactor ClusterPrefixedName and ClusterSuffixedName to not return error 2022-06-30 07:59:52 +03:00
Kubernetes Prow Robot ba1d2d2fd6
Merge pull request #13707 from jonasasx/feature/accelerators-from-master
Adding GuestAccelerators to InstanceTemplate
2022-06-23 23:21:20 -07:00
Ciprian Hacman 4750fdfc1e Limit GCE ASG labels to 63 chars 2022-06-23 20:38:23 +03:00
Ivan Volynkin 4264d78839 Adding GuestAccelerators to InstanceTemplate 2022-06-23 10:00:02 +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
Peter Rifel 0481aebc2d
Trim GCE Subnet and Disk names 2022-04-21 17:40:29 -05:00
Peter Rifel 0e59715e15
Trim GCE firewall rule names to their max length 2022-04-18 18:40:39 -05:00
Ole Markus With ce2e877aeb Remove bazel files from vendor 2022-04-12 13:29:03 +02:00
Jesse Haka 617b439b38 Fix GCE service account creation 2022-03-01 11:59:42 +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 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
John Gardiner Myers 5385381633 Use IPv6-only subnets for worker nodes in private IPv6 topology 2022-01-06 21:00:00 -08:00
justinsb 93a6871e9b gce: don't set per-IG permissions when using shared account
If we're using a cluster-level service-account, we shouldn't try to
set bucket permissions on a per-IG level.

For compatibility with the existing behavior, we simply don't set any
permissions in this case.
2021-12-28 10:10:16 -05:00
justinsb 8b3372ec76 Need to truncate gce serviceaccounts to max 30 characters 2021-12-17 12:57:14 -05:00
justinsb 746f886718 gce: use per instancegroup serviceaccounts
We no longer set the cloudconfig serviceaccount on new clusters, and
instead use a per-IG setting if this is not set.
2021-12-17 12:57:14 -05:00
justinsb 63e3d98443 gce: Use ServiceAccount task when building model
The next step towards supporting custom ServiceAccounts per IG
2021-12-15 11:08:51 -05:00
justinsb 4cf52d0e51 GCE: Support kops-controller, including in gossip mode
We discover the kops-controller in gossip mode using seeding code that
calls into the GCE API, just like gossip itself does.

We refactor the gossip code into a shared gcediscovery library with
minimal dependencies.
2021-12-04 11:51:41 -05:00
Peter Rifel 85d4bf7497 Add labels to GCE instance templates 2021-12-02 08:20:04 +02: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 5e4987b246 GCE: support egress specification
Empty or "nat" now defaults to creating a per-subnet NAT router for
private topologies.  "external" will assume that egress is configured
outside of kOps.
2021-10-26 21:37:03 -04:00
justinsb caff7e36ad gce: open node->master ports for calico and cilium
We're taking the opportunity to pursue a locked-down model, but this
means we need to open ports explicitly.
2021-10-25 08:31:21 -04:00
justinsb d363bf3dad GCE: improve network & subnet terraform support
We should use the subnet spec in the Cluster, and default to creating
a new subnet/network, but allow an existing one to be specified.
2021-10-24 17:41:14 -04:00
justinsb 0611e4f638 gce: open kops-controller port from nodes
This is now needed in our nodeup bootstrap with vTPM on GCE.

Also remove the cadvisor port, it is no longer running on the control-plane nodes.
2021-10-24 13:47:16 -04:00
justinsb af76c4c20a gce: allow router to refer to network object
This allows for our execution model to work a little more smoothly.
2021-10-24 09:19:06 -04:00
justinsb 860b033ddc gce: allow network to be marked as shared 2021-10-23 23:54:39 -04:00
justinsb e2f7895700 GCE: When using calico, need to open up ipip protocol
We need to open up the ipip protocol, which wasn't previously enabled.

Future work could construct the firewall rules in a common library,
and then adapt them to the various clouds.
2021-09-21 21:20:24 -04:00
justinsb 3e83b771d6 GCE: For IPAlias or Custom Routes, we must recognize source by CIDR
SourceTags are not recognized when using IPAlias or custom routes (aka
kubenet), so we must recognize by CIDR instead.
2021-09-21 08:20:17 -04:00
justinsb 76f816f483 GCE: Always have IPv6 rules in "ipv6 mode"
If we don't specify some SourceRanges, it defaults to 0.0.0.0/0, which
is IPv4 and confusing.
2021-09-20 09:26:28 -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
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
Kubernetes Prow Robot b0664176bc
Merge pull request #11259 from olemarkus/warm-life-cycle-hook
Make nodeup able to complete the warming life cycle hook
2021-04-24 02:05:15 -07:00
Ole Markus With 1ec0bd18e8 Enable support for the ASG WarmPool lifecycle hook
Update pkg/model/iam/iam_builder.go

Co-authored-by: Ciprian Hacman <ciprianhacman@gmail.com>
2021-04-24 09:40:52 +02: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
Kubernetes Prow Robot 9bc1c0ed77
Merge pull request #10477 from justinsb/refactor_gce_instancetemplate
Refactor GCE InstanceTemplate
2020-12-21 17:48:28 -08:00
Justin SB 1945a656a0 Remove deprecated ResourceHolder
Cleaning up what is now dead code.
2020-12-19 23:15:37 -05:00
Justin SB f12c3f95f8 Refactor GCE InstanceTemplate
Clearer, and for future cluster-api support.
2020-12-19 17:14:51 -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 a61ecf4c58 Refactor to use interface for iam Subjects
Hat-tip to johngmyers for the idea!
2020-09-09 09:57:07 -04:00
Justin SB 8498ac9dbb Create PublicJWKS feature flag
This should be much easier to start and to get under testing; it only
works with a load balancer, it sets the apiserver into anonymous-auth
allowed, it grants the anonymous auth user permission to read our jwks
tokens.  But it shouldn't need a second bucket or anything of that
nature.

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-09-09 09:57:06 -04: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