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

Allow specifying VPC peering connections and adding them into the route tables for the shoot nodes #363

Open
abh1kg opened this issue Jun 19, 2021 · 6 comments
Labels
area/networking Networking related kind/enhancement Enhancement, improvement, extension lifecycle/rotten Nobody worked on this for 12 months (final aging stage) platform/aws Amazon web services platform/infrastructure priority/2 Priority (lower number equals higher priority)

Comments

@abh1kg
Copy link

abh1kg commented Jun 19, 2021

How to categorize this issue?

/area networking
/kind enhancement
/priority 2
/platform aws

What would you like to be added:

When a shoot cluster is created on AWS by providing an existing VPC ID, the AWS provider creates and explicitly associates a route table for each subnet (as specified by the zone configurations) where the shoot nodes are attached. The routes for the tables include the "local" route for inter-container traffic and for public connectivity. However, if the VPC was already peered to another, it seems that the responsibility is with the user to manually add the route directed to the peering connection (i.e. the corresponding pcx-xxx) to these route tables.
It would be beneficial for end users if the shoot specification on AWS would allow VPC peering connection IDs to be specified and the provider adds routes for the peerings to the route tables for the shoot node subnets.

Why is this needed:

In the current situation, it seems like the user needs to be aware of the subnet tags and names generated by the AWS provider to be able to add the peer connection routes to the route tables. This is quite cumbersome for end users and also leaves users wondering if "messing around" with the routes would cause reconciliation issues later on. Having this feature inside the provider would help operational setup and overall end user experience.

@abh1kg abh1kg added the kind/enhancement Enhancement, improvement, extension label Jun 19, 2021
@gardener-robot gardener-robot added area/networking Networking related platform/aws Amazon web services platform/infrastructure priority/2 Priority (lower number equals higher priority) labels Jun 19, 2021
@dkistner
Copy link
Member

Hi @abh1kg,
thanks for the proposal.

I'm not an expert with vpc peering. Provider aws is using Terraform to create the basic network infrastructure for an aws shoot cluster. Could you provide an example how template would need to look like with the connection ids? https://github.com/gardener/gardener-extension-provider-aws/blob/master/pkg/controller/infrastructure/templates/main.tpl.tf

In this case provider-aws is not managing the vpc. What would happen if the peering is removed while the connection id routes are still in the route tables?

@abh1kg
Copy link
Author

abh1kg commented Jun 21, 2021

Hi @dkistner ,
I made a few changes to the template, primarily the section at: https://github.com/abh1kg/gardener-extension-provider-aws/blob/master/pkg/controller/infrastructure/templates/main.tpl.tf#L260-L275.
On second thought, I think we could support the peering connection routes to be added to the worker node route tables irrespective of whether Gardener creates the VPC or the user brings the VPC.
So, I expect an additional config section in the InfrastructureConfig resource for the AWS provider along the following lines:

apiVersion: aws.provider.extensions.gardener.cloud/v1alpha1
kind: InfrastructureConfig
enableECRAccess: true
networks:
  vpc: # specify either 'id' or 'cidr'
  # id: vpc-123456
    cidr: 10.250.0.0/16
    # optional list of peering connections (defaults to empty list if not specified)
    peering_connections:
    - name: connect_to_private_databases
      id: pcx-xxxx
      cidr_block: 10.16.0.0/16

If the peering is removed and the shoot YAML is not updated, I might be wrong but I don't think terraform would complain. On the AWS end, it would result in a black hole route, I would assume (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Route.html - search for blackhole).

@abh1kg
Copy link
Author

abh1kg commented Jul 4, 2021

@dkistner : Did you get a chance to look at this?

@dkistner
Copy link
Member

dkistner commented Jul 7, 2021

Hi @abh1kg,

unfortunately I did not find the time to look deeper into this.

On the AWS end, it would result in a black hole route...

Would this block the shoot deletion/reconciliation?

@abh1kg
Copy link
Author

abh1kg commented Jul 8, 2021

I don't think so because this would be ignored in the terraform operation. But, we would need to verify this of course. Is there a way (may even a dirty method) I could use to run the extension provider for AWS locally?

@dkistner
Copy link
Member

dkistner commented Jul 8, 2021

Yes, you just need a local k8s cluster and the crds here installed. Then you can run make start and apply your InfrastructureConfig to the local k8s cluster.

@gardener-robot gardener-robot added the lifecycle/stale Nobody worked on this for 6 months (will further age) label Jan 5, 2022
@gardener-robot gardener-robot added lifecycle/rotten Nobody worked on this for 12 months (final aging stage) and removed lifecycle/stale Nobody worked on this for 6 months (will further age) labels Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking Networking related kind/enhancement Enhancement, improvement, extension lifecycle/rotten Nobody worked on this for 12 months (final aging stage) platform/aws Amazon web services platform/infrastructure priority/2 Priority (lower number equals higher priority)
Projects
None yet
Development

No branches or pull requests

3 participants