Commit Graph

59 Commits

Author SHA1 Message Date
Kubernetes Prow Robot e43efbe102
Merge pull request #10157 from rifelpet/acm-nlb
Setup a second NLB listener when an AWS ACM certificate is used
2020-11-10 10:36:41 -08:00
Kubernetes Prow Robot 6a57543f6e
Merge pull request #10179 from olemarkus/sgr-consistent-naming
Consistent naming of security group rules
2020-11-07 02:07:37 -08:00
Ole Markus With fab694d290 Add ability to consistently name sgrs
In order to let kops fully control the rules for each security group we need to be able to generate names from the info in AWS. This is similar to the approach we used for openstack

Update pkg/model/firewall.go

Co-authored-by: Ciprian Hacman <ciprianhacman@gmail.com>
2020-11-07 10:27:19 +01:00
Peter Rifel 54decbc479
Always use TCP health check protocol for target groups 2020-11-06 11:09:38 -06:00
Peter Rifel 370092cb5a
Update TG ports rather than protocols when adding/removing ACM certs from listeners
This also renames the TGs to be more descriptive, with tcp and tls prefixes.
2020-11-06 11:09:38 -06:00
Peter Rifel 316c1eec8a
Update complex integration test for ACM cert and second listener 2020-11-06 11:09:37 -06:00
Ciprian Hacman b5e4b7ad48 Add missing instance monitoring for CF and TF 2020-11-04 16:15:00 +02:00
Kubernetes Prow Robot 578920e921
Merge pull request #10162 from rifelpet/nlb-sg
Fix additionalSecurityGroups support for NLB
2020-11-03 08:02:16 -08:00
Peter Rifel 860249f6b7
Fix additionalSecurityGroups support for NLB
We were correctly adding the security groups to the master ASGs but identified them incorrectly.
2020-11-03 08:22:24 -06:00
Peter Rifel f08284834e
Move NLB's VPC CIDR security group rule logic into model
This way the security group rule task doesn't need to be aware of VPCs, since we know the VPC CIDR ahead of time via cluster spec.

This also fixes the terraform and cloudformation rendering of this rule (see the added cidr block in the integration test outputs)

These rules are for NLB's health checks. The AWS docs recommend allowing access from the entire VPC CIDRs
Also add rules for additionalNetworkCIDRs, supporting VPCs with multiple CIDR blocks.
2020-11-03 08:13:32 -06:00
Peter Rifel 0cd3854605
Fix NLB naming for terraform and cloudformation targets 2020-11-02 19:38:01 -06:00
Christian Joun e91ed11449
Implement API load balancer class with NLB and ELB support on AWS (#9011)
* 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: Peter Rifel <pgrifel@gmail.com>
2020-11-02 05:28:52 -08:00
Kubernetes Prow Robot b7f66a6d98
Merge pull request #10109 from bmelbourne/set-minimum-terraform-0.12
Set minimum Terraform version to 0.12.26/0.13.0
2020-10-29 01:52:58 -07:00
Barry Melbourne 84417c330b Set minimum Terraform version to 0.12.26/0.13.0 2020-10-28 20:24:41 +00:00
Rodrigo Menezes 82d0ebdb56 Prevent unintended resource updates to LB attatchments 2020-10-26 17:29:07 -07:00
Kubernetes Prow Robot fbb172c08c
Merge pull request #9575 from johngmyers/node-labels
Take node labels from cloud tags on AWS
2020-10-23 04:01:45 -07:00
Peter Rifel 4bcfebebcc
Fix the detection and rendering of multiple additionalNetworkCIDR blocks 2020-09-27 20:12:09 -05:00
Peter Rifel 0978cd97e8
Add second additionalNetworkCIDR w/ incorrect test output 2020-09-27 20:08:09 -05:00
John Gardiner Myers 54c280eed5 update-expected.sh 2020-09-10 20:59:28 -07:00
Peter Rifel 0326ce4ad7
Dont generate the ssl_certificate_id field on TCP listeners in Terraform 2020-08-30 09:44:16 -05:00
Ciprian Hacman 2880e22bce Add flag for root volume encryption 2020-08-21 18:31:21 +03:00
Victor Ferreira 3aaa9a7c0f feat(aws): adding support to permission boundaries for IAM Roles 2020-08-19 01:16:13 -03:00
Peter Rifel f213854330
Update integration test outputs with filebase64 2020-07-08 23:24:11 -05:00
Peter Rifel 69f2c71cc3
Add tag support to AWS launch templates
In addition to TagSpecifications which allow tagging of instances and volumes, launch templates support tags of their own.

This adds the usual tags to LTs, as seen in the kubernetes.tf additions. Cloudformation does not yet support it [0], so only "api" and "terraform" targets are updated.

[0] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html
2020-07-07 22:43:45 -05:00
Peter Rifel 75ccf45eb7
Fold multiple integration test cases into the complex cluster test
Each integration test cluster adds many LoC and some overhead in running the integration tests.
Since many of the tests are only testing a specific feature, it would be simpler to combine all of the non-mutually exclusive features into the complex cluster.
2020-06-19 22:09:22 -05:00
John Gardiner Myers 1b03e7237b hack/update-expected.sh 2020-06-10 09:34:48 -07:00
Peter Rifel 460cdbfc67 Add CloudLabels tags to additional AWS resources
This adds any labels defined in the Cluster spec's CloudLabels to the tags of the following AWS resource types:

Elastic IP
Internet Gateway
NAT Gateway
Route Table
Security Group
Subnet
VPC DHCP Options
VPC
2020-04-11 13:25:52 -05:00
Peter Rifel fa2d64c3a3 Update expected outputs of terraform tests 2020-04-05 21:24:49 -05:00
Ciprian Hacman 661bd6dfbd Add "owned" tag for all instance groups related resources 2020-03-02 10:39:50 +02:00
Peter Rifel e0cebf30e5 Update terraform resource names to be 0.12 compatible.
According to the upgrade guide [0] resource names cannot start with digits.
Currently both routes and VPC CIDR associations start with digits, so this adds prefixes to them so that they are valid resource identifiers in 0.12.

This is a significant change because on its own, terraform will destroy and recreate the route which impact the cluster networking.
To avoid this, existing clusters this will require moving the resources within the terraform state prior to the next `apply`.

```
kops update cluster --target terraform --out ./
terraform state mv aws_route.0-0-0-0--0 aws_route.route-0-0-0-0--0 # repeat for all aws_route resources
terraform plan
terraform apply
```

The exact terraform state command may vary depending on how Kops' terraform output is used.
See the command documentation [1] for more details.
Always run a terraform plan first to ensure the `aws_route` and `aws_vpc_ipv4_cidr_block_association` resources are not getting recreated.

Due to the potential impact, this notice should be very prominant in the Kops release notes

[0] https://www.terraform.io/upgrade-guides/0-12.html
[1] https://www.terraform.io/docs/commands/state/mv.html
2020-01-17 07:51:39 -06:00
Gabriel Tiossi 35071ccaff test: Volume integration in update_cluster/complex
Add rootVolumeDeleteOnTermination and deleteOnTermination to test if
volumes are being retained properly in direct, terraform and
cloudformation
2019-12-04 13:13:23 -03:00
Justin SB 21cb8ece06
Label AWS ASGs with kops.k8s.io/instancegroup
We will use this to map an AWS instance to the instance group.
2019-09-02 09:26:23 -07:00
Austin Moore 4485b115f4
Default CrossZoneLoadBalancing to false if not set 2019-07-26 12:21:43 -04:00
mikesplain d6c02d3d72 Fix tests 2019-03-29 13:29:11 -04:00
ryan-dyer e131f67b39 Add additional tags to expected TF output 2019-03-20 10:19:10 -05:00
David Archer 36d2282d6b AWS: Enable ICMP Type 3 Code 4 for API server ELBs 2019-01-12 07:20:17 -05:00
Rohith 2fc634c556 Revert "Apply cloud labels into ELB"
This reverts commit b52c945f9f.
2018-09-25 13:53:38 +01:00
k8s-ci-robot c61fb537ac
Merge pull request #5593 from wingyplus/elb_cloud_labels
Apply cloud labels into ELB
2018-08-18 02:00:01 -07:00
Justin Santa Barbara 1c3949bdfe Don't assume that we only have one subnet per AZ
I made a mistaken assumption in
dde2100a19 that we only had one subnet
per AZ, but as demonstrated in #5587 this was not the case.

What I was trying to achieve was not to include the cluster name, so
for the case of subnets this commit just uses the subnet name from the
cluster spec, which should be unique and stable.  That is hopefully at
least as meaningful.

Thankfully we hadn't released a version with the erroneous naming.

Fix #5587
2018-08-13 13:15:03 -04:00
Thanabodee Charoenpiriyakij b52c945f9f Apply cloud labels into ELB
Fixes #2048
2018-08-11 00:43:19 +07:00
Christian Kampka 00cd85d73e Add autoscaling group ids to terraform module output 2018-07-20 13:15:03 +02:00
Christian Kampka 978f66266c Generate locals for terraform target 2018-07-13 22:28:27 +02:00
Justin Santa Barbara e24aa79aa9 Updated terraform expected test output 2018-06-04 10:52:08 -07:00
k8s-ci-robot 5cda02ca2b
Merge pull request #4695 from vendrov/instnace_monitroing_support
Add support for instance monitoring
2018-03-25 14:17:01 -07:00
k8s-ci-robot 63225eb674
Merge pull request #4784 from justinsb/always_tag_volumes
Make sure volumes are tagged
2018-03-24 23:32:00 -07:00
Justin Santa Barbara 0ce7dbf4bd Update tests for new volume tags 2018-03-25 00:08:24 -04:00
Justin Santa Barbara 0e22bf4ab5 Update tests for new security group tags 2018-03-24 22:19:59 -04:00
devops d734f35126 Add support for instance monitoring
Add API backward comptability

Add api generated files

documenting detailed-monitoring

instance-group json typo

Update test expected result
to support enable_monitroing

Add instance-monitroing support to CF

Improve doc, test and rename InstanceMonitoring

Rename instnace-monitoring to fit the YAML kops form

typo detailedInstanceMonitoring
2018-03-21 23:06:38 +02:00
Justin Santa Barbara 650bd98ea2 Update integration tests with new tags 2018-03-15 20:11:54 -04:00
k8s-ci-robot aa6e801e18
Merge pull request #3829 from mikesplain/suspendAZRebalance
Add Instance Group Suspend Processes
2018-02-25 22:20:52 -08:00