Commit Graph

322 Commits

Author SHA1 Message Date
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 a3a0b91b5f Order policy document sections alphabetically 2020-11-04 16:15:00 +02:00
Ciprian Hacman b5e4b7ad48 Add missing instance monitoring for CF and TF 2020-11-04 16:15:00 +02:00
Ciprian Hacman 51e70083f8 Add missing resource names for CF 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 43293d551f
Merge pull request #10140 from rifelpet/elbv2-cloudmock
Update AWS Cloudmock for complex and externallb integration test clusters
2020-10-30 10:02:07 -07:00
Peter Rifel 11bf3ff202
Add missing cloudmock functionality for enabling lifecycle integration test on complex cluster 2020-10-30 10:06:36 -05:00
John Gardiner Myers edfa6a0e94 Adjust Kubernetes version removals and deprecations for 1.20 2020-10-29 13:25:37 -07: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
Kubernetes Prow Robot f466403912
Merge pull request #9794 from rdrgmnzs/lb-attachment
Prevent unintended resource updates to LB attatchments
2020-10-28 15:18:59 -07:00
Barry Melbourne 84417c330b Set minimum Terraform version to 0.12.26/0.13.0 2020-10-28 20:24:41 +00:00
Peter Rifel 6c4273d985
Fix cloudformation lint errors
```
E3002 Invalid Property Resources/AWSAutoScalingAutoScalingGroupnodesmixedinstancesexamplecom/Properties/MixedInstancesPolicy/InstancesDistribution/SpotInstancePool
//kops/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json:321:13

E3031 CidrIp contains invalid characters (Pattern: x.x.x.x/y) at Resources/AWSEC2SecurityGroupIngresssshexternaltonode2001085a348/Properties/CidrIp
//kops/tests/integration/update_cluster/complex/cloudformation.json:833:9
```

I'm using the strings.Contains to determine if a CIDR is v6 since it seems simplest given that we know the value wont have a port number [0]

[0] https://stackoverflow.com/questions/22751035/golang-distinguish-ipv4-ipv6
2020-10-28 10:16:29 -05:00
Rodrigo Menezes dbbd0dd802 Move external LB and target group to inline as well. 2020-10-26 17:30:06 -07:00
Rodrigo Menezes 82d0ebdb56 Prevent unintended resource updates to LB attatchments 2020-10-26 17:29:07 -07:00
Kubernetes Prow Robot c9aa53895a
Merge pull request #10048 from hakman/container-runtime-assets
Install container runtime packages as assets
2020-10-25 21:03:01 -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
binkkatal 86b605d10b RUN: ./hack/update-expected.sh 2020-10-20 19:28:20 +05:30
Ciprian Hacman e44037f825 Install container runtime packages as assets - Integration 2020-10-14 15:41:51 +03:00
Ciprian Hacman dc86205faf Update expected outputs of integration tests 2020-10-09 17:12:37 +03:00
Ciprian Hacman 9c888bcdcf Update expected outputs of integration tests 2020-10-09 09:33:39 +03: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
Justin SB 2a44cb7f16 Update script and testdata CA keypair
If we generate with the wrong type (usages), the keypair will be
regenerated.
2020-09-12 16:21:15 -04:00
John Gardiner Myers 54c280eed5 update-expected.sh 2020-09-10 20:59:28 -07:00
Justin SB 6fa8be2716 JSON formatting of IAM: Workaround for optional fields
AWS IAM is very strict and doesn't support `Resource: []` for example.
We implement a custom MarshalJSON method to work around that.
2020-09-09 09:57:07 -04: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 ccc814dfbc Create tests for JWKS scenarios 2020-09-09 09:57:06 -04:00
Kubernetes Prow Robot 4604fa53b3
Merge pull request #9899 from olemarkus/remove-insecure-bind-address
Don't explicitly set insecure-bind-address on newer k8s
2020-09-09 03:25:53 -07:00
Ole Markus With 886b4c97cb Don't explicitly set insecure-bind-address on newer k8s 2020-09-09 11:41:51 +02:00
Ciprian Hacman 43e0b2332c Update expected outputs of integration tests 2020-09-08 10:12:57 +03:00
Ciprian Hacman d1bdc1632d Update expected outputs of integration tests 2020-09-08 08:46:09 +03:00
Kubernetes Prow Robot 277038d419
Merge pull request #9839 from rifelpet/tf-cert-id
Dont generate the ssl_certificate_id field on TCP listeners in Terraform
2020-08-31 06:14:21 -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
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
Ciprian Hacman cd82550088 Update integration test for Calico after validation changes 2020-08-24 12:54:15 +03:00
Ciprian Hacman 3f8edd74fe Update integration test for Calico 2020-08-24 12:30:37 +03:00
Ciprian Hacman 2880e22bce Add flag for root volume encryption 2020-08-21 18:31:21 +03:00
Kubernetes Prow Robot 8a81d94c7b
Merge pull request #9773 from victorfrancax1/7286
Adding support for permission boundaries for AWS IAM Roles
2020-08-19 06:51:11 -07:00
Victor Ferreira 3aaa9a7c0f feat(aws): adding support to permission boundaries for IAM Roles 2020-08-19 01:16:13 -03:00
Kubernetes Prow Robot 96ab8423b1
Merge pull request #9566 from hakman/arm64-images
Add ARM64 support for masters
2020-08-14 20:46:17 -07: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 6991655921
Add openstack integration test.
This will create / update / update / delete an openstack cluster using cloudmock, ensuring there are no lingering changes reported or orphaned resources
2020-08-10 15:22:49 -05:00
Ciprian Hacman 527b1eb36f ARM64 support - Update expected tests output 2020-08-10 12:05:24 +03:00
John Gardiner Myers cd2941b56c update-expected.sh 2020-07-29 17:24:39 -07:00
Peter Rifel f3e6ac874d
Update integration test outputs with new ssh key tags 2020-07-28 13:35:10 -05:00
John Gardiner Myers be3e311c12 update-expected.sh 2020-07-17 19:32:53 -07:00
John Gardiner Myers c0774d7ffa Stop using legacy IAM in integration tests 2020-07-17 19:32:48 -07:00
Peter Rifel f213854330
Update integration test outputs with filebase64 2020-07-08 23:24:11 -05:00
Ciprian Hacman 827d8c041f Update mock version to 1.19.0-alpha.1 2020-07-08 18:31:18 +03: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
Ciprian Hacman 69511a998e Use kubelet docker-specific flags only for Docker 2020-07-05 07:57:10 +03:00
Ole Markus With 53f670aeb0 Rebase with master 2020-07-03 08:39:43 +02:00
Ole Markus With 263172caac Use new templates for cilium 1.8 2020-07-03 07:56:35 +02:00
John Gardiner Myers 5f45389124 update-expected.sh 2020-06-28 18:52:03 -07:00
John Gardiner Myers 35645b49c4 update-expected.sh 2020-06-28 18:51:42 -07:00
John Gardiner Myers 64167b7420 update-expected.sh 2020-06-28 18:51:16 -07: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
Ciprian Hacman 80295961fb ARM64 support - Update tests output 2020-06-19 04:42:11 +03:00
John Gardiner Myers 91c741d8fb update-expected.sh 2020-06-17 09:09:24 -07:00
Peter Rifel c5882446c8
Only store launchtemplate userdata in plaintext for terraform 0.12+ 2020-06-16 17:16:41 -05:00
Peter Rifel 964d402eb5
Store terraform launchtemplate userdata in plaintext rather than b64
This makes it easier to grok the userdata contents
2020-06-16 16:53:49 -05:00
Ciprian Hacman d888b1f517 Update integration tests 2020-06-12 06:24:08 +03:00
John Gardiner Myers 1b03e7237b hack/update-expected.sh 2020-06-10 09:34:48 -07:00
Ciprian Hacman 3eda07aec0 Update tests output 2020-06-03 17:25:53 +03:00
Ciprian Hacman c0b62a74ca Remove all traces of utils.tar.gz 2020-06-03 09:55:45 +03:00
Kubernetes Prow Robot e6d73b5ba0
Merge pull request #9135 from justinsb/gce_no_hostname_no_worries
GCE: don't rely on hostname being correct
2020-05-22 17:43:10 -07:00
Peter Rifel 7228223781
Update integration test outputs 2020-05-22 18:48:20 -05:00
Kubernetes Prow Robot 2c899d859a
Merge pull request #9104 from hakman/containerd-kubenet
Add support for Kubenet with containerd
2020-05-21 22:20:38 -07:00
Kubernetes Prow Robot bda2a15ee6
Merge pull request #9024 from tomesm/support_launch_template
Added Launch Template support for instance interruption behavior
2020-05-17 15:35:36 -07:00
Ciprian Hacman e608cd5265 Add support for Kubenet with containerd 2020-05-12 17:20:59 +03:00
Peter Rifel ef6abbcd5c
Don't use file references for single line strings in gce's metadata fields 2020-05-06 23:06:24 -05:00
John Gardiner Myers 843e5b9b16 Move GCEServiceAccount into CloudConfig 2020-05-03 20:35:32 -07:00
Ciprian Hacman 78de18a803 Update k8s.gcr.io/pause image to version 3.2 2020-05-01 22:12:42 +03:00
Ole Markus With 74732487d5 Fix various tests that used masters without etcd members 2020-04-30 18:32:28 +02:00
Martin Tomes c66180bc58 Added support for instance interruption behavior 2020-04-29 14:53:17 +02:00
Peter Rifel fd17a118f5
Remove irrelevant TODO comment from userdata
This comment is from 2016, isn't clear, and I believe may be no longer relevant.

This will cleanup the TODO comment from everyone's userdata.
2020-04-18 08:54:35 -05:00
Nicolas Vanheuverzwijn bcb141ab74 bastion: add test for loadbalancer.additionalSecurityGroups 2020-04-16 12:04:59 -04:00
Ole Markus With d174faf116 Add some integration tests for cilium 2020-04-16 16:22:58 +02:00
Ole Markus With a7f631e7c9 Apply suggestions from code review
Co-Authored-By: Peter Rifel <rifelpet@users.noreply.github.com>
2020-04-16 08:42:59 +02:00
Ole Markus With 869ab75dea Use etcd-manager for the cilium etcd cluster 2020-04-16 08:42:59 +02: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 fb7fba0152 Update GCE integration test output 2020-04-08 22:16:57 -05:00
Peter Rifel fa2d64c3a3 Update expected outputs of terraform tests 2020-04-05 21:24:49 -05:00
eric-hole c59314a799 Adds some initial tests. Fixes some logic
Need to fix service account implementation first

Fixing tests and iterating on the serviceaccount logic

Run the gce_byo_sa test
2020-04-04 21:20:31 -07:00
eric-hole b3d65ffce0 Adds a gce-service-account flag so you BYO service-account
Generated code and some cleanup

Not sure where that code went

Tests for service account

fixes case on gceserviceaccount
2020-04-04 21:15:56 -07:00
Kubernetes Prow Robot 759e24a490
Merge pull request #8802 from thejasbabu/feature/spot-block
Add support for Spot block in launch template
2020-04-01 10:15:27 -07:00
Peter Rifel a0e1672cdc add terraform testing 2020-03-31 14:50:45 -05:00
Thejas B dda8dc3f37 Add support for Spot block in launch template
- Launch configuration does not support the field SpotDurationInMinutes which is used to reserve the spot instances, but however Launch Template does
2020-03-31 20:07:01 +05:30
Peter Rifel ee86488d98 Don't set terraform's user_data if it is an empty string
Bastion hosts have no user_data by default.
This is not valid in terraform, based on the error messages reported here [0]

The Terraform provider code says user_data is optional for both LaunchConfigurations and LaunchTemplates [1] [2]

This change prevents the user_data property from being added to aws_launch_configuration and aws_launch_template resources unless the string is not empty.

[0] https://travis-ci.org/github/kubernetes/kops/jobs/662472020
[1] 04d24f80f3/aws/resource_aws_launch_configuration.go (L74-L76)
[2] 04d24f80f3/aws/resource_aws_launch_template.go (L510-L512)
2020-03-31 09:33:16 -05:00
Peter Rifel 833b22575f Disable anonymous auth in integration test clusters
This silences the anonymousAuth warning printed during `update cluster`, reducing the integration test output by >500 lines.
2020-03-29 22:21:10 -05:00
John Gardiner Myers b645dac752 Remove support for v1alpha1 and before 2020-03-24 19:49:15 -07:00
John Gardiner Myers d9e999d377 Convert TestMinimal_json to v1alpha2 API 2020-03-24 19:49:07 -07:00
Ciprian Hacman 5c8cc493af Set default log level to "info" for containerd 2020-03-22 20:53:58 +02:00
eric-hole 31285f921b Adds a minimal GCE integration test 2020-03-17 01:19:49 -07:00
Ciprian Hacman 576e546b5e Update integration tests for launch templates 2020-03-16 18:41:39 +02:00