From 213b20a105865e87ff95da010ee9008463fee990 Mon Sep 17 00:00:00 2001 From: M00nF1sh Date: Mon, 30 Oct 2023 10:01:09 -0800 Subject: [PATCH] Deployed 6ecfc62cc to v2.6 with MkDocs 1.1.2 and mike 1.0.0 --- latest/guide/use_cases/frontend_sg/index.html | 16 + v2.6/404.html | 12 + v2.6/CONTRIBUTING/index.html | 14 +- v2.6/code-of-conduct/index.html | 12 + v2.6/controller-devel/index.html | 12 + v2.6/deploy/configurations/index.html | 24 + v2.6/deploy/installation/index.html | 51 +- v2.6/deploy/pod_readiness_gate/index.html | 12 + v2.6/deploy/security_groups/index.html | 164 ++- v2.6/deploy/subnet_discovery/index.html | 12 + v2.6/deploy/upgrade/migrate_v1_v2/index.html | 12 + v2.6/examples/echo_server/index.html | 26 +- v2.6/examples/grpc_server/index.html | 12 + v2.6/examples/secrets_access/index.html | 12 + v2.6/guide/ingress/annotations/index.html | 12 + v2.6/guide/ingress/cert_discovery/index.html | 12 + v2.6/guide/ingress/ingress_class/index.html | 37 + v2.6/guide/ingress/spec/index.html | 22 + .../integrations/external_dns/index.html | 12 + v2.6/guide/service/annotations/index.html | 22 +- v2.6/guide/service/nlb/index.html | 30 +- v2.6/guide/targetgroupbinding/spec/index.html | 12 + .../targetgroupbinding/index.html | 12 + .../tasks/cognito_authentication/index.html | 12 + .../tasks/migrate_legacy_apps/index.html | 12 + v2.6/guide/tasks/ssl_redirect/index.html | 12 + v2.6/guide/use_cases/blue_green/index.html | 12 + v2.6/guide/use_cases/frontend_sg/index.html | 1303 +++++++++++++++++ .../use_cases/nlb_tls_termination/index.html | 12 + .../use_cases/self_managed_lb/index.html | 16 +- v2.6/how-it-works/index.html | 12 + v2.6/index.html | 28 + v2.6/release/index.html | 12 + v2.6/search/search_index.json | 2 +- v2.6/sitemap.xml | 52 +- v2.6/sitemap.xml.gz | Bin 209 -> 208 bytes 36 files changed, 1969 insertions(+), 78 deletions(-) create mode 100644 latest/guide/use_cases/frontend_sg/index.html create mode 100644 v2.6/guide/use_cases/frontend_sg/index.html diff --git a/latest/guide/use_cases/frontend_sg/index.html b/latest/guide/use_cases/frontend_sg/index.html new file mode 100644 index 000000000..379bb9429 --- /dev/null +++ b/latest/guide/use_cases/frontend_sg/index.html @@ -0,0 +1,16 @@ + + + + + Redirecting + + + + + Redirecting to ../../../../v2.6/guide/use_cases/frontend_sg/... + + \ No newline at end of file diff --git a/v2.6/404.html b/v2.6/404.html index aba896ce2..dbeb02ecd 100644 --- a/v2.6/404.html +++ b/v2.6/404.html @@ -801,6 +801,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/CONTRIBUTING/index.html b/v2.6/CONTRIBUTING/index.html index 2c61a88db..1427ac067 100644 --- a/v2.6/CONTRIBUTING/index.html +++ b/v2.6/CONTRIBUTING/index.html @@ -806,6 +806,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -991,7 +1003,7 @@

    Contributing GuidelinesAs contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

    Getting Started

    Building the project

    -

    Controller developement documentation has instructions on how to build the project and project specific expectations.

    +

    Controller development documentation has instructions on how to build the project and project specific expectations.

    Contributing to docs

    The documentation is generated using Material for MkDocs. In order to generate and preview docs locally, use the steps below -

    diff --git a/v2.6/controller-devel/index.html b/v2.6/controller-devel/index.html index ff91d6b1e..223c43b36 100644 --- a/v2.6/controller-devel/index.html +++ b/v2.6/controller-devel/index.html @@ -806,6 +806,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/deploy/configurations/index.html b/v2.6/deploy/configurations/index.html index 309dfe93f..e16a71ca7 100644 --- a/v2.6/deploy/configurations/index.html +++ b/v2.6/deploy/configurations/index.html @@ -939,6 +939,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -1435,6 +1447,18 @@

    Controller command line flags + + Additional requirements for isolated cluster: + +
  • @@ -959,6 +966,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -1094,6 +1113,13 @@ Additional requirements for non-EKS clusters: + + +
  • + + Additional requirements for isolated cluster: + +
  • @@ -1234,6 +1260,9 @@

    Additional requirements fo
  • Ensure subnets are tagged appropriately for auto-discovery to work
  • For IP targets, pods must have IPs from the VPC subnets. You can configure the amazon-vpc-cni-k8s plugin for this purpose.
  • +

    Additional requirements for isolated cluster:

    +

    Isolated clusters are clusters without internet access, and instead reply on VPC endpoints for all required connects. +When installing the AWS LBC in isolated clusters, you need to disable shield, waf and wafv2 via controller flags --enable-shield=false, --enable-waf=false, --enable-wafv2=false

    Using the Amazon EC2 instance metadata server version 2 (IMDSv2)

    We recommend blocking the access to instance metadata by requiring the instance to use IMDSv2 only. For more information, please refer to the AWS guidance here. If you are using the IMDSv2, set the hop limit to 2 or higher in order to allow the LBC to perform the metadata introspection.

    You can set the IMDSv2 as follows: @@ -1281,13 +1310,13 @@

  • @@ -497,15 +510,35 @@
  • @@ -997,6 +1042,19 @@ Frontend Security Groups + +
  • @@ -1008,15 +1066,35 @@
    • - - Management of Backend Security Group Rules + + Configuration
    • - - Port Range Restrictions for Backend Security Group Rules + + Coordination of Frontend and Backend Security Groups + + + + +
    • + +
    • + + Port Range Restrictions
    • @@ -1043,24 +1121,62 @@ -

      Security groups

      -

      The AWS Load Balancer Controller classifies security groups into two categories: frontend and backend.

      +

      Security Groups for Load Balancers

      +

      Use security groups to limit client connections to your load balancers, and restrict connections with nodes. The AWS Load Balancer Controller (LBC) defines two classifications of security groups: frontend and backend.

      +
        +
      • Frontend Security Groups: Determine the clients that can access the load balancers.
      • +
      • Backend Security Groups: Permit the load balancer to connect to targets, such as EC2 instances or ENIs.
      • +

      Frontend Security Groups

      -

      Frontend security groups control which clients can access the load balancers. The frontend security groups can be configured with the alb.ingress.kubernetes.io/security-groups annotation on Ingress resources or service.beta.kubernetes.io/aws-load-balancer-security-groups annotation on Service resources. If the annotations are not specified, the LBC will create one security group per load balancer, allowing traffic from inbound-cidrs to listen-ports.

      +

      Frontend security groups control access to load balancers by specifying which clients can connect to them.

      +

      Use cases for Frontent Security Groups include:

      +
        +
      • Placing the load balancer behind another service, such as AWS Web Application Firewall or AWS CloudFront.
      • +
      • Blocking the IP address range (CIDR) of a region.
      • +
      • Configuring the Load Balancer for private or internal use, by specifying internal CIDRs and Security Groups.
      • +
      +

      In the default configuration, the LBC automatically creates one security group per load balancer, allowing traffic from inbound-cidrs to listen-ports.

      +

      Configuration

      +

      Apply custom frontend security groups with an annotation. This disables automatic generation of frontend security groups.

      +

      Backend Security Groups

      -

      A single shared backend security group controls the traffic between load balancers and their target EC2 instances or ENIs. This security group is attached to the load balancers and is used as the traffic source in the ENI/Instance security group rules. The backend security group is shared between multiple load balancers.

      -

      The controller flag --enable-backend-security-group (default true) is used to enable/disable the shared backend security group. The flag --backend-security-group (default empty) is used to pass in the security group to use as a shared backend security group. If it is empty, the LBC will auto-generate a security group with the following name and tags -

      -
      name: k8s-traffic-<cluster_name>-<hash_of_cluster_name>
      -tags: 
      -    elbv2.k8s.aws/cluster: <cluster_name>
      -    elbv2.k8s.aws/resource: backend-sg
      +

      Backend Security Groups control traffic between AWS Load Balancers and their target EC2 instances or ENIs. For example, backend security groups can restrict the ports load balancers may access on nodes.

      +
        +
      • Backend security groups permit traffic from AWS Load Balancers to their targets.
      • +
      • LBC uses a single, shared backend security group, attaching it to each load balancer and using as the traffic source in the security group rules it adds to targets.
      • +
      • When configuring security group rules at the ENI/Instance level, use the Security Group ID of the backend security group. Avoid using the IP addresses of a specific AWS Load Balancer, these IPs are dynamic and the security group rules aren't updated automatically.
      • +
      +

      Configuration

      +

      Enable or Disable: Use --enable-backend-security-group (default true) to enable/disable the shared backend security group.

      +

      You can turn off the shared backend security group feature by setting it to false. However, if you have a high number of Ingress resources with frontend security groups auto-generated by the controller, you might run into security group rule limits on the instance/ENI security groups.

      +

      Specification: Use --backend-security-group to pass in a security group ID to use as a custom shared backend security group.

      +

      If --backend-security-group is left empty, a security group with the following attributes will be created:

      +
      name: k8s-traffic-<cluster_name>-<hash_of_cluster_name>
      +tags: 
      +    elbv2.k8s.aws/cluster: <cluster_name>
      +    elbv2.k8s.aws/resource: backend-sg
       
      -

      You can turn off the shared backend security group feature by setting --enable-backend-security-group to false. However, if you have a high number of Ingress resources with frontend security groups auto-generated by the controller, you might run into security group rule limits on the instance/ENI security groups.

      -

      Management of Backend Security Group Rules

      -

      When the LBC auto-creates the frontend security group for a load balancer, it automatically adds the security group rules to allow traffic from the load balancer to the backend instances/ENIs.

      -

      When the frontend security group is specified via the alb.ingress.kubernetes.io/security-groups annotation on Ingress resources or service.beta.kubernetes.io/aws-load-balancer-security-groups annotation on Service resources, the controller will not by default add any security group rules to the backend instances/ENIs. The automatic management of instance/ENI security group can be controlled via the additional annotation alb.ingress.kubernetes.io/manage-backend-security-group-rules on Ingress resources or service.beta.kubernetes.io/aws-load-balancer-manage-backend-security-group-rules on Service resources. When these annotations are set to true the security group rules are automatically managed by the controller. These annotations get ignored in the case of auto-generated security groups. --enable-backend-security-group needs to be true if either alb.ingress.kubernetes.io/manage-backend-security-group-rules or service.beta.kubernetes.io/aws-load-balancer-manage-backend-security-group-rules are specified, otherwise it is an error.

      -

      Port Range Restrictions for Backend Security Group Rules

      -

      As of version v2.3.0, the controller will by default restrict the backend security group rules to specific port ranges. You can set the controller flag --disable-restricted-sg-rules to true to get the backend security group rules to allow traffic to ALL ports.

      +

      Coordination of Frontend and Backend Security Groups

      +
        +
      • If the LBC auto-creates the frontend security group for a load balancer, it automatically adds the security group rules to allow traffic from the load balancer to the backend instances/ENIs.
      • +
      • If the frontend security groups are manually specified, the LBC will not by default add any rules to the backend security group.
      • +
      +

      Enable Autogeneration of Backend Security Group Rules

      +
        +
      • If using custom frontend security groups, the LBC can be configured to automatically manage backend security group rules.
      • +
      • To enable managing backend security group rules, apply an additional annotation to Ingress and Service resources.
      • +
      • For Ingress resources, set the alb.ingress.kubernetes.io/manage-backend-security-group-rules annotation to true.
      • +
      • For Service resources, set the service.beta.kubernetes.io/aws-load-balancer-manage-backend-security-group-rules annotation to true.
      • +
      • If management of backend security group rules is enabled with an annotation on a Service or Ingress, then --enable-backend-security-group must be set to true.
      • +
      • These annotations are ignored when using auto-generated frontend security groups.
      • +
      +

      Port Range Restrictions

      +

      From version v2.3.0 onwards, the controller restricts port ranges in the backend security group rules by default. This improves the security of the default configuration. The LBC should generate the necessary rules to permit traffic, based on the Service and Ingress resources.

      +

      If needed, set the controller flag --disable-restricted-sg-rules to true to permit traffic to all ports. This may be appropriate for backwards compatability, or troubleshooting.

      diff --git a/v2.6/deploy/subnet_discovery/index.html b/v2.6/deploy/subnet_discovery/index.html index f09366ea1..b2edd42af 100644 --- a/v2.6/deploy/subnet_discovery/index.html +++ b/v2.6/deploy/subnet_discovery/index.html @@ -864,6 +864,18 @@ + + + + +
    • + + Frontend Security Groups + +
    • + + +
  • diff --git a/v2.6/deploy/upgrade/migrate_v1_v2/index.html b/v2.6/deploy/upgrade/migrate_v1_v2/index.html index 336f3c7cf..62e9c40e3 100644 --- a/v2.6/deploy/upgrade/migrate_v1_v2/index.html +++ b/v2.6/deploy/upgrade/migrate_v1_v2/index.html @@ -866,6 +866,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/examples/echo_server/index.html b/v2.6/examples/echo_server/index.html index 9087182b3..c20914240 100644 --- a/v2.6/examples/echo_server/index.html +++ b/v2.6/examples/echo_server/index.html @@ -808,6 +808,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -1161,9 +1173,9 @@

    Deploy the echoserver resources
  • Deploy all the echoserver resources (namespace, service, deployment)

    -
    kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.6.0/docs/examples/echoservice/echoserver-namespace.yaml &&\
    -kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.6.0/docs/examples/echoservice/echoserver-service.yaml &&\
    -kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.6.0/docs/examples/echoservice/echoserver-deployment.yaml
    +
    kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.6.1/docs/examples/echoservice/echoserver-namespace.yaml &&\
    +kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.6.1/docs/examples/echoservice/echoserver-service.yaml &&\
    +kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.6.1/docs/examples/echoservice/echoserver-deployment.yaml
     
  • @@ -1183,7 +1195,7 @@

    Deploy ingress for echoserver
    wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.6.0/docs/examples/echoservice/echoserver-ingress.yaml
    +
    wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.6.1/docs/examples/echoservice/echoserver-ingress.yaml
     

  • @@ -1352,7 +1364,7 @@

    Kube2iam setupKube2iam setup -

    Previous - Externally Managed Load Balancer + Frontend Security Groups diff --git a/v2.6/examples/grpc_server/index.html b/v2.6/examples/grpc_server/index.html index 9a1a9f85e..18c04d929 100644 --- a/v2.6/examples/grpc_server/index.html +++ b/v2.6/examples/grpc_server/index.html @@ -808,6 +808,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + +

  • diff --git a/v2.6/examples/secrets_access/index.html b/v2.6/examples/secrets_access/index.html index 06f2eef92..ba5576054 100644 --- a/v2.6/examples/secrets_access/index.html +++ b/v2.6/examples/secrets_access/index.html @@ -808,6 +808,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/ingress/annotations/index.html b/v2.6/guide/ingress/annotations/index.html index aed1778a4..b49cdb4a5 100644 --- a/v2.6/guide/ingress/annotations/index.html +++ b/v2.6/guide/ingress/annotations/index.html @@ -922,6 +922,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/ingress/cert_discovery/index.html b/v2.6/guide/ingress/cert_discovery/index.html index d36ad7980..bcf489934 100644 --- a/v2.6/guide/ingress/cert_discovery/index.html +++ b/v2.6/guide/ingress/cert_discovery/index.html @@ -859,6 +859,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/ingress/ingress_class/index.html b/v2.6/guide/ingress/ingress_class/index.html index 179a7d69b..b9e1e2274 100644 --- a/v2.6/guide/ingress/ingress_class/index.html +++ b/v2.6/guide/ingress/ingress_class/index.html @@ -961,6 +961,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -1309,6 +1321,31 @@

    IngressClassParams
    apiVersion: elbv2.k8s.aws/v1beta1
    +kind: IngressClassParams
    +metadata:
    +  name: awesome-class
    +spec:
    +  subnets:
    +    ids:
    +    - subnet-xxx
    +    - subnet-123
    +
    +
  • with subnets.tags +
    apiVersion: elbv2.k8s.aws/v1beta1
    +kind: IngressClassParams
    +metadata:
    +  name: class2048-config
    +spec:
    +  subnets:
    +  tags:
    +    kubernetes.io/role/internal-elb:
    +    - "1"
    +    myKey:
    +    - myVal0
    +    - myVal1
    +
  • IngressClassParams specification

    diff --git a/v2.6/guide/ingress/spec/index.html b/v2.6/guide/ingress/spec/index.html index 432138150..6c90c5164 100644 --- a/v2.6/guide/ingress/spec/index.html +++ b/v2.6/guide/ingress/spec/index.html @@ -822,6 +822,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -948,6 +960,16 @@

    Ingress specification

    This document covers how ingress resources work in relation to The AWS Load Balancer Controller.

    +
    +
      +
    • Beginning from v2.4.3 of the AWS LBC, rules are ordered as follows:
        +
      • pathType: Exact paths are always ordered first
      • +
      • followed by pathType: Prefix paths, with the longest prefix first
      • +
      • followed by pathType: ImplementationSpecific paths, in the order they are listed in the manifest
      • +
      +
    • +
    +

    An example ingress, from example is as follows.

    apiVersion: networking.k8s.io/v1
     kind: Ingress
    diff --git a/v2.6/guide/integrations/external_dns/index.html b/v2.6/guide/integrations/external_dns/index.html
    index 26c8baecb..97066037f 100644
    --- a/v2.6/guide/integrations/external_dns/index.html
    +++ b/v2.6/guide/integrations/external_dns/index.html
    @@ -808,6 +808,18 @@
       
     
               
    +            
    +  
    +  
    +  
    +    
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/service/annotations/index.html b/v2.6/guide/service/annotations/index.html index 15dedbb22..e8fbf9191 100644 --- a/v2.6/guide/service/annotations/index.html +++ b/v2.6/guide/service/annotations/index.html @@ -911,6 +911,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -1872,8 +1884,14 @@

    Access controlLegacy Cloud Provider

    -

    The AWS Load Balancer Controller manages Kubernetes Services in a compatible way with the legacy aws cloud provider. The annotation service.beta.kubernetes.io/aws-load-balancer-type is used to determine which controller reconciles the service. If the annotation value is nlb-ip or external, legacy cloud provider ignores the service resource (provided it has the correct patch) so that the AWS Load Balancer controller can take over. For all other values of the annotation, the legacy cloud provider will handle the service. Note that this annotation should be specified during service creation and not edited later.

    -

    The legacy cloud provider patch was added in Kubernetes v1.20 and is backported to Kubernetes v1.18.18+, v1.19.10+.

    +

    The AWS Load Balancer Controller manages Kubernetes Services in a compatible way with the AWS cloud provider's legacy service controller.

    +
      +
    • For users on v2.5.0+, The AWS LBC provides a mutating webhook for service resources to set the spec.loadBalancerCLass field for Serive of type LoadBalancer, effectively making the AWS LBC the default controller for Service of type LoadBalancer. + Users can disable this feature and revert to using the AWS Cloud Controller Manager as the default service controller by setting the helm chart value enableServiceMutatorWebhook to false with --set enableServiceMutatorWebhook=false .
    • +
    • For users on older versions, the annotation service.beta.kubernetes.io/aws-load-balancer-type is used to determine which controller reconciles the service. If the annotation value is nlb-ip or external, + recent versions of the legacy cloud provider ignore the Service resource so that the AWS LBC can take over. For all other values of the annotation, the legacy cloud provider will handle the service. + Note that this annotation should be specified during service creation and not edited later. Support for the annotation was added to the legacy cloud provider in Kubernetes v1.20, and is backported to v1.18.18+ and v1.19.10+.
    • +
    diff --git a/v2.6/guide/service/nlb/index.html b/v2.6/guide/service/nlb/index.html index b9260ae3d..9df3864a6 100644 --- a/v2.6/guide/service/nlb/index.html +++ b/v2.6/guide/service/nlb/index.html @@ -900,6 +900,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -1091,7 +1103,7 @@

    Network Load Balancertarget type.

    Secure by default

    -

    Since the v2.2.0 release, the LBC provisions an internal NLB by default.

    +

    Since the v2.2.0 release, the LBC provisions an internal NLB by default.

    To create an internet-facing NLB, the following annotation is required on your service:

    service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
     
    @@ -1119,10 +1131,10 @@

    Prerequisites

    Configuration

    -

    By default, Kubernetes Service resources of type LoadBalancer get reconciled by the Kubernetes controller built into the CloudProvider component of the kube-controller-manager or the cloud-controller-manager(also known as the in-tree controller).

    +

    By default, Kubernetes Service resources of type LoadBalancer get reconciled by the Kubernetes controller built into the CloudProvider component of the kube-controller-manager or the cloud-controller-manager(also known as the in-tree controller).

    In order for the LBC to manage the reconciliation of Kubernetes Service resources of type LoadBalancer, you need to offload the reconciliation from the in-tree controller to the LBC, explicitly.

    -

    The LBC supports the LoadBalancerClass feature since the v2.4.0 release for Kubernetes v1.22+ clusters.

    +

    The LBC supports the LoadBalancerClass feature since the v2.4.0 release for Kubernetes v1.22+ clusters.

    The LoadBalancerClass feature provides a CloudProvider agnostic way of offloading the reconciliation for Kubernetes Service resources of type LoadBalancer to an external controller.

    When you specify the spec.loadBalancerClass to be service.k8s.aws/nlb on a Kubernetes Service resource of type LoadBalancer, the LBC takes charge of reconciliation by provisioning an NLB.

    @@ -1187,7 +1199,7 @@

    Configuration

    Protocols

    -

    The LBC supports both TCP and UDP protocols. The controller also configures TLS termination on your NLB if you configure the Service with a certificate annotation.

    +

    The LBC supports both TCP and UDP protocols. The controller also configures TLS termination on your NLB if you configure the Service with a certificate annotation.

    In the case of TCP, an NLB with IP targets doesn't pass the client source IP address, unless you specifically configure it to using target group attributes. Your application pods might not see the actual client IP address, even if the NLB passes it along. For example, if you're using instance mode with externalTrafficPolicy set to Cluster. In such cases, you can configure NLB proxy protocol v2 using an annotation if you need visibility into the client source IP address on your application pods.

    @@ -1261,7 +1273,10 @@

    ProtocolsSubnet tagging requirements

    See Subnet Discovery for details on configuring Elastic Load Balancing for public or private placement.

    Security group

    -

    AWS doesn't support attaching security groups to NLBs. To allow inbound traffic from an NLB, the controller automatically adds inbound rules to the worker node security groups, by default.

    +
      +
    • From v2.6.0, the AWS LBC creates and attaches frontend and backend security groups to NLB by default. For more information please see the security groups documentation
    • +
    • In older versions, the controller by default adds inbound rules to the worker node security groups, to allow inbound traffic from an NLB.
    • +

    disable worker node security group rule management

    You can disable the worker node security group rule management using an annotation.

    @@ -1291,6 +1306,7 @@

    Worker node security groups selec

    ${cluster-name} is the name of the Kubernetes cluster.

    +

    If it is possible for multiple security groups with the tag kubernetes.io/cluster/${cluster-name} to be on a target ENI, you may use the --service-target-eni-security-group-tags flag to specify additional tags that must also match in order for a security group to be used.

    Worker node security groups rules

    diff --git a/v2.6/guide/targetgroupbinding/spec/index.html b/v2.6/guide/targetgroupbinding/spec/index.html index 134fef899..3138d3e49 100644 --- a/v2.6/guide/targetgroupbinding/spec/index.html +++ b/v2.6/guide/targetgroupbinding/spec/index.html @@ -815,6 +815,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/targetgroupbinding/targetgroupbinding/index.html b/v2.6/guide/targetgroupbinding/targetgroupbinding/index.html index 7e5f33f7e..0e909222c 100644 --- a/v2.6/guide/targetgroupbinding/targetgroupbinding/index.html +++ b/v2.6/guide/targetgroupbinding/targetgroupbinding/index.html @@ -893,6 +893,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/tasks/cognito_authentication/index.html b/v2.6/guide/tasks/cognito_authentication/index.html index 751dd25c3..3fb04cbd8 100644 --- a/v2.6/guide/tasks/cognito_authentication/index.html +++ b/v2.6/guide/tasks/cognito_authentication/index.html @@ -873,6 +873,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/tasks/migrate_legacy_apps/index.html b/v2.6/guide/tasks/migrate_legacy_apps/index.html index 332ae17c2..6484d2591 100644 --- a/v2.6/guide/tasks/migrate_legacy_apps/index.html +++ b/v2.6/guide/tasks/migrate_legacy_apps/index.html @@ -806,6 +806,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/tasks/ssl_redirect/index.html b/v2.6/guide/tasks/ssl_redirect/index.html index e57127eb1..7ae3d2d30 100644 --- a/v2.6/guide/tasks/ssl_redirect/index.html +++ b/v2.6/guide/tasks/ssl_redirect/index.html @@ -859,6 +859,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/use_cases/blue_green/index.html b/v2.6/guide/use_cases/blue_green/index.html index b74539b98..b3af7a9ff 100644 --- a/v2.6/guide/use_cases/blue_green/index.html +++ b/v2.6/guide/use_cases/blue_green/index.html @@ -806,6 +806,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/use_cases/frontend_sg/index.html b/v2.6/guide/use_cases/frontend_sg/index.html new file mode 100644 index 000000000..abb4f4fdf --- /dev/null +++ b/v2.6/guide/use_cases/frontend_sg/index.html @@ -0,0 +1,1303 @@ + + + + + + + + + + + + + + + + + Restrict Access with Frontend Security Groups - AWS Load Balancer Controller + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    + + + + + + + +
    +
    + + + +
    +
    +
    + + + + + + +
    +
    +
    + + + + + + +
    +
    + + + + + + + +

    Frontend Security Groups

    + +

    Frontend security groups limit client/internet traffic with a load balancer. This improves security by preventing unauthorized access to cluster services, and blocking unexpected outbound connections. Both AWS Network Load Balancers (NLBs) and Application Load Balancers (ALBs) support frontend security groups. Learn more about how the Load Balancer Controller uses Frontend and Backend Security Groups.

    +

    Solution Overview

    +

    Load balancers expose cluster workloads to a wider network. Creating a frontend security group limits access to these workloads (service or ingress resources). More specifically, a security group acts as a virtual firewall to control incoming and outgoing traffic. Inbound rules control the incoming traffic to your load balancer, and outbound rules control the outgoing traffic from your load balancer.

    +

    Security groups are particularly suited for defining what access other AWS resources (services, EC2 instances) have to your cluster. For example, if you have an existing security group including EC2 instances, you can permit only that security group to access a service.

    +

    In this example, you will restrict access to a cluster service. You will create a new security group for the frontend of a load balancer, and add an inbound rule permitting traffic. The rule may limit traffic to a specific port, CIDR, or existing security group.

    +

    Prerequisites

    + +

    Configure

    +

    1. Find the VPC ID of your cluster

    +
    $ aws eks describe-cluster --name <cluster-name> --query "cluster.resourcesVpcConfig.vpcId" --output text
    +
    +vpc-0101XXXXa356
    +
    +

    Ensure you have the right cluster name, AWS region, and the AWS CLI is configured.

    +

    2. Create a security group using the VPC ID

    +
    $ aws ec2 create-security-group --group-name <sg-name> --description <description> --vpc-id <vpc-id>
    +
    +{
    +    "GroupId": "sg-0406XXXX645c"
    +}
    +
    +

    Note the security group ID. This will be the frontend security group for the load balancer.

    +

    3. Create your ingress rules

    +

    Load balancers generally serve as an entrypoint for clients to access your cluster. This makes ingress rules especially important.

    +

    For example, this rule permits all traffic on port 443:

    +
    aws ec2 authorize-security-group-ingress --group-id <sg-id> --protocol all --port 443 --cidr 0.0.0.0/0
    +
    +

    Learn more about how to create an ingress rule with the AWS CLI.

    +

    4. Determine your egress rules (optional)

    +

    By default, all outbound traffic is allowed. Further, security groups are stateful, and responses to an allowed connection will also be permitted.

    +

    Learn how to create an egress rule with the AWS CLI.

    +

    5. Add the security group annotation to your Ingress or Service

    +

    For Ingress resources, add the following annotation:

    +
    apiVersion: networking.k8s.io/v1
    +kind: Ingress
    +metadata:
    +  name: frontend
    +  annotations:
    +    alb.ingress.kubernetes.io/security-groups: <sg-id>
    +
    +

    For Service resources, add the following annotation:

    +
    apiVersion: v1
    +kind: Service
    +metadata:
    +  name: frontend
    +  annotations:
    +    service.beta.kubernetes.io/aws-load-balancer-security-groups: <sg-id>
    +spec:
    +    type: LoadBalancer
    +    loadBalancerClass: service.k8s.aws/nlb
    +
    +

    For Ingress resources, the associated Application Load Balancer will be updated. For Service resources, the associated Network Load Balancer will be updated.

    +

    6. List your load balancers and verify the security groups are attached

    +
    $ aws elbv2 describe-load-balancers
    +
    +{
    +    "LoadBalancers": [
    +        {
    +            "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-east-1:1853XXXX5115:loadbalancer/net/k8s-default-frontend-ae3743b818/3ad6d16fb75ff688",
    +            <...>
    +            "SecurityGroups": [
    +                "sg-0406XXXX645c",
    +                "sg-0873XXXX2bef"
    +            ],
    +            "IpAddressType": "ipv4"
    +        }
    +    ]
    +}
    +
    +

    If you don't see the security groups, verify:

    +
      +
    • The Load Balancer Controller is properly installed.
    • +
    • The controller has proper IAM permissions to modify load balancers. Look at the logs of the controller pods for IAM errors.
    • +
    +

    7. Clean up (Optional)

    +

    Removing the annotations from Service/Ingress resources will revert to the default frontend ecurity groups.

    +

    Load balancers may be costly. Delete Ingress and Service resources to deprovision the load balancers. If the load balancers are deleted from the console, they may be recreated by the controller.

    + + + + + + + + + +
    +
    +
    + +
    + + + + +
    +
    +
    +
    + + + + + + + + + + + + + \ No newline at end of file diff --git a/v2.6/guide/use_cases/nlb_tls_termination/index.html b/v2.6/guide/use_cases/nlb_tls_termination/index.html index 52dea5fac..a54326be3 100644 --- a/v2.6/guide/use_cases/nlb_tls_termination/index.html +++ b/v2.6/guide/use_cases/nlb_tls_termination/index.html @@ -903,6 +903,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + diff --git a/v2.6/guide/use_cases/self_managed_lb/index.html b/v2.6/guide/use_cases/self_managed_lb/index.html index d851f088a..8b6f0b182 100644 --- a/v2.6/guide/use_cases/self_managed_lb/index.html +++ b/v2.6/guide/use_cases/self_managed_lb/index.html @@ -883,6 +883,18 @@ + + + + +
  • + + Frontend Security Groups + +
  • + + + @@ -1171,13 +1183,13 @@

    Verify