Commit Graph

102 Commits

Author SHA1 Message Date
Bharath Vedartham 58b83ca847 Add support for aws ec2 instance metadata v2
A new field is add to the InstanceGroup spec with 2 sub fields,
HTTPPutResponseHopLimit and HTTPTokens. These fields enable the user
to disable IMDv1 for instances within an instance group.

By default, both IMDv1 and IMDv2 are enabled in instances in an instance group.
2020-12-08 08:56:13 +02:00
Ciprian Hacman 40ac40439b Add option to reuse existing Elastic IPs for NAT gateways 2020-12-06 16:09:36 +02:00
Ciprian Hacman fec2d6f505 Use pagination when listing LaunchTemplates 2020-11-12 12:46:36 +02:00
Ciprian Hacman 5358f6e3a7 Use LaunchTemplate id instead of name for ASGs 2020-11-12 12:46:36 +02:00
Ciprian Hacman 34ce9aa4c7 Use LaunchTemplate versions instead of timestamped LaunchTemplates 2020-11-12 12:46:36 +02:00
Peter Rifel 2f328116ef
Automated cherry pick of #10140 and #9011: Implement API load balancer class with NLB and ELB support on AWS (#10154)
* Create cloudmock implementations for elbv2 API calls used by future NLB support

* Add missing cloudmock functionality for enabling lifecycle integration test on complex cluster

* Add lifecycle integration tests for complex and externallb clusters

* refactor TargetLoadBalancer to use DNSTarget interface instead of LoadBalancer

* add LoadBalancerClass fields into api

* make api machinery

* WIP: Implemented API loadbalancer class, allowing NLB and ELB support on AWS for new clusters.

* perform vendoring related tasks and apply fixes identified from hack/

dissallow spotinst + nlb
remove reflection in status_discovery.go
Add precreated additional security groups to the Master nodes in case of NLB
Remove support for attaching individual instances to NLB; only rely on ASG attachments
Don't specify Classic loadbalancer in GCE integration test

* add utility function to the kops model context to make LoadBalancer comparisons simpler

* use DNSTarget interface when locating DNSName of API ELB

* wip: create target group task

* Consolidate TargetGroup tasks

* Use context helper for determining api load balancer type to avoid nil pointers

* Update NLB creation to use target group ARN from separate task rather than creating a TG in-line

* Address staticcheck and bazel failures

* Removing NLB Attachment tasks because they're not used since we switched to defining them as a part of the ASGs

* Address PR review feedback

* Only set LB Class field for AWS clusters, fix nil pointer

* Move target group attributes from NLB task to TG task, removing unused attributes

* Add terraform and cloudformation support for NLBs, listeners, and target groups

* Update integration test for NLB support

* Fix NLB name format to pass terraform validation

* Preserve security group rule names when switching ELB to NLB to reduce destructive terraform changes

* Use elbv2 enums and address some TODOs

* Set healthcheck values in target group

* Find TG tags, fix NLB name detection

* Fix more spurious changes reported by lifecycle integration test

* Fix spotinst validation, more code cleanup

* Address more PR feedback

* ReconcileTargetGroups unit test + more code simplification

* Addressing PR feedback Renaming task 1. awstasks.LoadBalancer -> awstasks.ClassicLoadBalancer

* Addressing PR feedback Renaming task: ELBName() -> CLBName() / LinkToELB() -> LinkToCLB()

* Addressing PR feedback: Various text changes

* fix export of kubecfg

* address TargetGroup should have the same name as the NLB

* should address error when fetching tags due to missing ARN

* Update expected and crds

* Add feature table to NLB docs

* Address more feedback and remove some TODOs that arent applicable anymore

* Update spotinst validation error message

Co-authored-by: Christian Joun <cjoun@proofpoint.com>
2020-11-02 09:10:54 -08:00
Peter Rifel b81f9b290f
Add a test ensuring shared VPCs dont have unrelated CIDR blocks disassociated 2020-10-02 14:23:16 -05:00
Ole Markus With 80ef2473b5 Various mock fixes 2020-10-01 19:15:40 +02:00
Justin SB 786423f617 Expose JWKS via a feature-flag
When the PublicJWKS feature-flag is set, we expose the apiserver JWKS
document publicly (including enabling anonymous access).  This is a
stepping stone to a more hardened configuration where we copy the JWKS
document to S3/GCS/etc.

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-08-30 10:15:11 -04:00
Ole Markus With 6615d55eb1 Remove duplicate code 2020-08-23 06:46:22 +02:00
Ole Markus With 8e5e3d4ea5 Mock create server should associate with mock ports 2020-08-22 22:08:02 +02:00
Ole Markus With 29682700c7 Don't use nova for glance mocks
Fetching images through nova is deprecated and removed in newer versions
of the compute API. Mocks now reflect this behavior.
2020-08-21 10:18:52 +02: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
Ole Markus With 9890839cec Add an integration test for openstack floating ip
* Integration test for floatingip cluster
* Implements mocking of floatingIP (only list for now)
* Expands various cloudmocks
* Fixes an NPR in openstack validation
* Fixes a bug where kops tries to use DNS even if the cluster is gossip
2020-08-12 12:59:30 +02:00
Peter Rifel 230d870ad6
Implement CRUD logic for cloudmock openstack
This is the bulk of the changes necessary to support openstack integration tests.

As mentioned in cloudmock/openstack/README.md, this involved a lot of wireshark to understand
how the gophercloud clients builds the requests and expects the responses.
2020-08-10 15:22:49 -05:00
Kubernetes Prow Robot da710a0c3c
Merge pull request #9691 from rifelpet/openstack-cloudmock-part3
Add an initial structure for openstack cloudmock
2020-08-06 00:00:55 -07:00
Peter Rifel 23dc8383da
Add an initial structure for openstack cloudmock
More info in the docs changes. This adds stubbed http handlers for every resource type used by Kops.
2020-08-05 23:13:34 -05:00
John Gardiner Myers ae772c3bd9 Add missing locking in MockEC2 2020-08-04 20:40:13 -07:00
Peter Rifel 690f2e3605
Add keypair tag and ID support to cloudmock 2020-07-28 13:35:09 -05:00
Peter Rifel b1e7704d09
Use "lt-" IDs for launch templates and add tagging support 2020-07-08 08:53:01 -05:00
Peter Rifel 844626ae44
cloudmock - recognize and store tags provided in Create requests 2020-07-08 08:53:01 -05:00
Peter Rifel 7e34e786ce
cloudmock - use ResourceType constants that are now in aws-sdk-go 2020-07-08 08:53:01 -05:00
Peter Rifel a7d2161c0e
Add OIDC Provider awstask, mock, and resource lister and deleter 2020-06-16 14:36:56 -05:00
John Gardiner Myers 3ce8dd165b Use launch templates by default 2020-06-10 09:34:48 -07:00
Peter Rifel 64ef8c2d42
Add DescribeInstanceTypes to AWSCloud 2020-06-09 10:13:00 -05:00
John Gardiner Myers 9f9b98e9f4 Merge branch 'master' into surge 2020-02-17 09:17:26 -08:00
Matt Ouille f025ff0e70
Add External Policies (AWS managed policy attachments) 2020-02-16 21:54:12 -08:00
John Gardiner Myers 640f5f5b74 Terminate AWS instances through EC2 instead of Autoscaling 2020-01-27 20:15:10 -08:00
John Gardiner Myers e4082aaf4c Fix cloudmock/aws/mockelbv2 staticcheck failures 2019-12-28 21:25:29 -08:00
Kubernetes Prow Robot e29a04e5af
Merge pull request #7854 from FayerZhang/master
fix golint failures
2019-11-07 11:37:43 -08:00
John Gardiner Myers d8128d2d59 Fix behavior of mock DescribeAutoScalingGroups when no names supplied 2019-11-02 16:50:18 -07:00
feifei.zhang@huawei.com 4b49412105 fix golint failures 2019-10-31 20:22:37 +08:00
tanjunchen 43bf6bdab6 fix-up gosimple check error 2019-10-07 11:59:57 +08:00
chentanjun d47b4b6534 fix-typo 2019-09-25 21:34:24 +08:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -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
Kubernetes Prow Robot e497f33104
Merge pull request #6809 from xichengliudui/update-go-const-part5
Using const() defines constants together (part:3)
2019-04-23 06:36:17 -07:00
Justin SB de581b1b64
Switch to golang 1.11.5
For cherry-picking to 1.13

https://github.com/kubernetes/kubernetes/blob/release-1.13/build/build-image/cross/Dockerfile
2019-04-20 17:36:56 -04:00
xichengliudui 16ee9c4342 Using const() defines constants together (part:3) 2019-04-20 05:02:21 -04:00
Rohith 6c3a125f9e - adding the ec2 mock methods for launch templates .. gosh 2019-02-05 12:22:57 +00:00
Justin SB 18d117d84e
cloudmock: replace unimplemented methods with interface embedding
It's simpler, and it lets us move to newer versions of the AWS API more easily.
2018-12-20 18:13:28 -05:00
Justin SB 1d14c361d1
Add missing locking to awsmock LaunchConfigurations
Caused a test flake in #6121
2018-11-27 10:17:34 -05:00
Justin Santa Barbara fa7b408607 cloudmock: govet fixes 2018-09-23 11:23:08 -04:00
k8s-ci-robot 2ad8588e51
Merge pull request #5635 from nareshku/support-albs-nlbs
Support for deletion of aws resources albs nlbs during delete
2018-09-21 11:40:33 -07:00
Naresh Kumar Amrutham 2242e4cd0a modified comments 2018-09-10 10:57:56 -07:00
Naresh Kumar Amrutham 22069c5d27 removed unwanted methods 2018-08-17 15:30:11 -07:00
Naresh Kumar Amrutham 504414dd1c include tests 2018-08-17 13:04:28 -07:00
wangxy518 79233c8e7e
Update iaminstanceprofile.go 2018-08-16 14:10:24 +08:00
Justin Santa Barbara a9eb6fed2e AWS: Delete old LaunchConfigurations
We delete old AWS LaunchConfigurations when we see that we have more
than 3.  We add a feature flag KeepLaunchConfigurations to disable this
functionality, for backwards compatability.

Fixes #329
2018-06-17 23:24:53 -04:00