kubernetes / kubernetes/kops

Shared AWS VPC when account has multiple Egress Only Internet Gateways fails

Open
#18,088 5 comments 1 reaction 0 assignees View on GitHub
kind/bug lifecycle/rotten
Dominant language
Go
Stars
16.7k
Forks
4.7k
Avg merge
17h 21m
Merged PRs (30d)
68

Description

/kind bug

**1. What `kops` version are you running? The command `kops version`, will display
this information.**

```
Client version: 1.34.1 (git-v1.34.1)
```

**2. What Kubernetes version are you running? `kubectl version` will print the
version if a cluster is running or provide the Kubernetes version specified as
a `kops` flag.**

```
N/A
```

**3. What cloud provider are you using?**

**AWS**

**4. What commands did you run? What is the simplest way to reproduce this issue?**

N/A

**5. What happened after the commands executed?**

KOPS complained that multiple Egress Only Internet Gateways matched tags. The AWS account has two Egress Only Internet Gateways but one of these is for a completely separate VPC.

**6. What did you expect to happen?**

KOPS to pick the Egress Only Internet Gateway for the VPC ID that is specified in my KOPS manifest.

**7. Please provide your cluster manifest. Execute
`kops get --name my.example.com -o yaml` to display your cluster manifest.
You may want to remove your cluster name and other sensitive information.**

```yaml
N/A
```

**8. Please run the commands with most verbose logging by adding the `-v 10` flag.
Paste the logs into this report, or in a gist and provide the gist link here.**

N/A

**9. Anything else do we need to know?**

See file: https://github.com/kubernetes/kops/blob/master/upup/pkg/fi/cloudup/awstasks/egressonlyinternetgateway.go

Function: `Find`

Expression:

```
request.Filters = []ec2types.Filter{awsup.NewEC2Filter("attachment.vpc-id", *e.VPC.ID)}
````

This is not a valid filter for Egress Only Internet Gateway, thus, doesn't do anything.

See: https://docs.aws.amazon.com/cli/v1/reference/ec2/describe-egress-only-internet-gateways.html

Section: `--filters`

Contributor guide

Open the contributing guide

Research direction

Start with the Find function in upup/pkg/fi/cloudup/awstasks/egressonlyinternetgateway.go and verify the supported filters in the linked AWS describe-egress-only-internet-gateways documentation. Done means kOps selects the gateway attached to the VPC ID from the manifest without matching gateways belonging to other VPCs.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.