Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Add an option to pass list of ignored ports in egress traffic #58

Merged
merged 2 commits into from
Jun 1, 2019

Conversation

midN
Copy link
Contributor

@midN midN commented May 31, 2019

Issue #, if available:
aws/aws-app-mesh-roadmap#62
By default all egress traffic is going to flow through Envoy/AppMesh.
We don't want database traffic to be flowing through it.
Workaround currently is to not use app-mesh-inject and manually add sidecar pod and init pod.

Description of changes:
Implement appmesh.k8s.aws/egressIgnoredPorts annotation to have an option of providing list of ports to be ignored in egress traffic flow.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@midN
Copy link
Contributor Author

midN commented May 31, 2019

@stefanprodan @jqmichael not sure who to notify 🤷‍♂

if v, ok := pod.ObjectMeta.Annotations[egressIgnoredPortsAnnotation]; ok {
egressIgnoredPorts = v
} else {
egressIgnoredPorts = "22"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don’t think port 22 should be excluded by default. The egress ignored ports env var should be set only if the annotation exists.

Copy link
Contributor Author

@midN midN Jun 1, 2019

Choose a reason for hiding this comment

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

That's what the mesh does by default - https://docs.aws.amazon.com/app-mesh/latest/userguide/mesh-getting-started-ec2.html

I'm just following entrypoint script aws uses - # Comma separated list of ports for which egress traffic will be ignored, we always refuse to route SSH traffic. if [ -z "$APPMESH_EGRESS_IGNORED_PORTS" ]; then APPMESH_EGRESS_IGNORED_PORTS="22" else APPMESH_EGRESS_IGNORED_PORTS="$APPMESH_EGRESS_IGNORED_PORTS,22" fi


PS! I also think the default value could be still kept to show visibility of available ENV variables, for example it took me quite some time to find how to make App Mesh ignore some outgoing ports such as SQL/REDIS ones.

Copy link
Contributor

@jqmichael jqmichael left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@jqmichael jqmichael merged commit 3afa067 into amazon-archives:master Jun 1, 2019
@midN midN deleted the egress-ignored-ports branch June 2, 2019 01:06
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