Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing 443 to nodes from EKS service #148

Merged
merged 1 commit into from
Oct 9, 2018
Merged

Allowing 443 to nodes from EKS service #148

merged 1 commit into from
Oct 9, 2018

Conversation

max-rocket-internet
Copy link
Contributor

@max-rocket-internet max-rocket-internet commented Oct 2, 2018

PR o'clock

Description

This allows the EKS cluster service to connect to the nodes on port 443. This is require to run the metrics-server, details here. Metrics-server is required to run horrizontal pod autoscalers.

AWS CFN is here: https://github.com/awslabs/amazon-eks-ami/blob/master/amazon-eks-nodegroup.yaml#L251-L260

Checklist

  • terraform fmt and terraform validate both work from the root and examples/eks_test_fixture directories (look in CI for an example)
  • Tests for the changes have been added and passing (for bug fixes/features)
  • Test results are pasted in this PR (in lieu of CI)
  • Docs have been updated using terraform-docs per README.md instructions
  • I've added my change to CHANGELOG.md
  • Any breaking changes are highlighted above

@mmcaya
Copy link
Contributor

mmcaya commented Oct 2, 2018

👍 had been doing this after the fact with module outputs.

Any reason not to tighten up the control plan egress rules to match that latest cloud formation as well:
https://github.com/awslabs/amazon-eks-ami/blob/master/amazon-eks-nodegroup.yaml#L229
https://github.com/awslabs/amazon-eks-ami/blob/master/amazon-eks-nodegroup.yaml#L251

Sample:

resource "aws_security_group_rule" "cluster_egress_workers" {
  description              = "Allow the cluster control plane to communicate with worker Kubelet and pods"
  protocol                 = "tcp"
  security_group_id        = "${aws_security_group.cluster.id}"
  source_security_group_id = "${local.worker_security_group_id}"
  from_port                = "${var.worker_sg_ingress_from_port}"
  to_port                  = 65535
  type                     = "egress"
  count                    = "${var.cluster_security_group_id == "" ? 1 : 0}"
}

resource "aws_security_group_rule" "cluster_egress_extension_api" {
  description              = "Allow the cluster control plane to communicate with pods running extension API servers on port 443"
  protocol                 = "tcp"
  security_group_id        = "${aws_security_group.cluster.id}"
  source_security_group_id = "${local.worker_security_group_id}"
  from_port                = 443
  to_port                  = 443
  type                     = "egress"
  count                    = "${var.cluster_security_group_id == "" ? 1 : 0}"
}

@max-rocket-internet
Copy link
Contributor Author

had been doing this after the fact with module outputs.

Nice. I think it's reasonable to have this access in place by default.

Any reason not to tighten up the control plan egress rules to match that latest cloud formation as well

Sure but what do you mean exactly? In the AWS CFN port 1025-65535 is allowed from EKS service to nodes. And this module is the same?

@mmcaya
Copy link
Contributor

mmcaya commented Oct 2, 2018

Current module uses egress to the internet from control plane by default:
https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/cluster.tf#L25
vs the more granular control plane egress rules described by the cloud formation template
and this: https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html

@max-rocket-internet
Copy link
Contributor Author

@mmcaya OK good idea. I'll do that in a separate PR.

@mmcaya
Copy link
Contributor

mmcaya commented Oct 4, 2018

great, thanks!

@max-rocket-internet
Copy link
Contributor Author

Paging @brandoconnor 🙂

Copy link
Contributor

@brandonjbjelland brandonjbjelland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that you need it but you've got my blessing 🙏

@brandonjbjelland
Copy link
Contributor

Thanks as always @max-rocket-internet and @mmcaya

@max-rocket-internet max-rocket-internet merged commit 5d9d4fb into terraform-aws-modules:master Oct 9, 2018
@max-rocket-internet max-rocket-internet deleted the sg443 branch October 9, 2018 08:38
nicgrayson pushed a commit to nicgrayson/terraform-aws-eks that referenced this pull request Oct 29, 2018
* upstream/master: (25 commits)
  Update documentation for removed `configure_kubectl_session` (terraform-aws-modules#171)
  remove the checksum step
  Add target_group_arns to worker ASG (terraform-aws-modules#167)
  Removing 2 providers from the module (terraform-aws-modules#168)
  Removing aws_iam_service_linked_role from module (terraform-aws-modules#160)
  Adjust the order and correct/update the info (terraform-aws-modules#163)
  Ruby ver `2.4.2` -> `2.4.4`
  Move env vars into env section
  Remove `v` in `v0.11.8`
  Better version control
  Add suspended_processes attributes to autoscaling_group (terraform-aws-modules#159)
  Updating changelog for v1.7.0 (terraform-aws-modules#158)
  Revert "Add suspended_processes attributes to autoscaling_group (terraform-aws-modules#153)" (terraform-aws-modules#157)
  Add suspended_processes attributes to autoscaling_group (terraform-aws-modules#153)
  Add option to change worker placement_tenancy. (terraform-aws-modules#142)
  Allowing 443 to nodes from EKS service (terraform-aws-modules#148)
  Fixed issue with 'workers_group_defaults_defaults.iam_role_id' and added explicit depends_on for 'update_config_map_aws_auth' (terraform-aws-modules#147)
  Added timeout configs and variables to aws_eks_cluster resource (terraform-aws-modules#149)
  Fixing travis config (terraform-aws-modules#151)
  Fix for ERROR: 'aws_iam_instance_profile.workers' not found (terraform-aws-modules#141)
  ...
aykamko pushed a commit to crowd-ai/terraform-aws-eks that referenced this pull request Dec 14, 2018
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants