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

add support for ECS Service Connect #727

Closed
slootmaekersdirk opened this issue Dec 11, 2023 · 15 comments
Closed

add support for ECS Service Connect #727

slootmaekersdirk opened this issue Dec 11, 2023 · 15 comments
Assignees
Labels
ecs AWS ECS and services enhancement New feature or request network

Comments

@slootmaekersdirk
Copy link

Is your feature request related to a problem? Please describe.
At the moment inter service communication is based on DNS lookup which is not ideal

Describe the solution you'd like
Amazon ECS Service Connect allows to communicate between ECS services in an easy way, not using DNS lookup

Additional context
What we need to add is

  1. when creating the cluster, specify the --service-connect-defaults parameter
  2. while creating the service add the following properties:
  • "namespace"
  • "services":
    [
    {
    "portName": "test-port",
    "clientAliases": [
    {
    "port": 80,
    "dnsName": "test"
    }
    ]
    }
    ]
    -> now we can access this service from another service through http://test:80
@slootmaekersdirk slootmaekersdirk added the enhancement New feature or request label Dec 11, 2023
@JohnPreston JohnPreston added ecs AWS ECS and services network labels Dec 11, 2023
@JohnPreston
Copy link
Member

Hello :)
Thanks for opening this FR. In the meantime I'd recommend to make sure to use x-cloudmap to create DNS entries etc. for your services.
ECS Connect is an "easy build" for what you'd get with Cloud Map and AppMesh iirc
Will look into it.

@slootmaekersdirk
Copy link
Author

Hello John,

did you find time for this FR? We're about to deply our solution, and this part is still a manual configuration job, after the deploy.

thx
Dirk

@JohnPreston
Copy link
Member

Hello
I did, given that cloudmap etc. is already in compose-x it shouldn't be too much work to implement, I will need to test it out etc. though.
That's probably something that will come under the x-network settings to logically map services.

@slootmaekersdirk
Copy link
Author

Hello John,

is this FR already in the 0.25 rc?

and , if so, how can I use it?

thx
Dirk

@JohnPreston
Copy link
Member

JohnPreston commented Mar 5, 2024

Hi @slootmaekersdirk
That is not in the 0.25, that will be a 1.x thing
The Connect Config is actually quite involved, although I already have all the components in place to make the integration easy, I need to play with finding a good UX for users to configure it.

If you have any suggestion of what you feel the format should look like please do tell.

Otherwise, I might simply allow to define the entire property CFN style in x-ecs_connect or x-network.ecs_connect, but that means more work for the user.

PS: You can already achieve the http://test by using x-cloudmap today without any of the connect faff, ** if ** you set the VPC search domain to include the cloudmap domain.

@JohnPreston
Copy link
Member

Hello John,

is this FR already in the 0.25 rc?

and , if so, how can I use it?

thx Dirk

What are the properties that you today configure via the UI or in some other way? What does the connect config look like when you do ecs describe-services ?

@slootmaekersdirk
Copy link
Author

slootmaekersdirk commented Mar 5, 2024 via email

@JohnPreston
Copy link
Member

JohnPreston commented Mar 5, 2024

I am adding the necessary to make it work in the 1.0 branch as this requires things that weren't originally in the docker compose specification but now are
EDIT: Likely to be an early access feature in 1.0

@slootmaekersdirk
Copy link
Author

Hello John,

please keep me up te date, when it is available for testing

thx
Dirk

@JohnPreston
Copy link
Member

JohnPreston commented Mar 13, 2024

Planned for 1.1.0 :)

PS: Next week I am at a summit, but should be done and delivered by end of March :)
EDIT: insert T&C that say I have no legal obligations to, limited to availability :D

@JohnPreston
Copy link
Member

JohnPreston commented Mar 24, 2024

@slootmaekersdirk
I have it done in a new feature branch, however, want to check with you that I am doing the right thing.
I have the service connect configured, it created an entry in cloudmap but not DNS, API calls only, which is odd.
Then the other thing is, I don't see how you declare that service A wants to connect to service B 🤔
I am missing something?

See #745

@slootmaekersdirk
Copy link
Author

Hello John,
 
The whole idea of the connect service is not to go via a DNS, but acting as a side car for each service, so a direct communication between services is possible.
 
To allow 2 side communication you should (when creating the service):
 
"serviceConnectConfiguration": {
        "enabled": true,
        "namespace": "svc-namespace",
        "services": [
            {
                "portName": "testtask",
                "clientAliases": [
                    {
                        "port": 80
                    }
                ],
            }
        ],
        "logConfiguration": {
            "logDriver": "awslogs",
            "options": {
                "awslogs-group": "/ecs/service-connect-proxy",
                "awslogs-region": "region",
                "awslogs-stream-prefix": "service-connect-proxy"
            }
        }
    },
 
Here we create a namespace called svc-namespace I can access this taks via http://testtask:80
all services in the same namespace can communicate with eachother
Dirk

@JohnPreston
Copy link
Member

Hey @slootmaekersdirk
This is now implemented in #745 - if you would please test for me.
I tested with the YELB demo app that has been re-used in multiple places to demo connect, and I could get the UI online, vote, and get the stats going up/down
Let me know how you get on.

@JohnPreston
Copy link
Member

Implemented in #745

@JohnPreston
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecs AWS ECS and services enhancement New feature or request network
Projects
None yet
Development

No branches or pull requests

2 participants