-
Notifications
You must be signed in to change notification settings - Fork 29
TCP Support (Preview)
Tomer Rosenthal edited this page Nov 16, 2022
·
1 revision
- TCP Ingress communication:
- "transport" should be "tcp" for tcp apps.
- "external" designates whether the tcp endpoint of the app is reachable outside the environment or only internally in the environment.
- "targetPort" is the port the TCP application is listening on
- "exposedPort" optional port (defaults to the same value as targetPort). Must be unique per environment if the app is external: true. Doesn't have to be unique if the app is internal only.
- Scale out configuration: Applications can scale based on the active number of TCP connections. However, during a scale-down operation, it's not guaranteed that active connections will remain undisrupted. If the app is scaled out to 10 instance but should be running at 2, 8 instances will be asked to shutdown, and the clients connected to those instances will have to reconnect.
- Traffic splitting with TCP. If you have multiple revisions (rev1, rev2) you can split tcp traffic between them.
Redis support with TCP
{
"id": "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.App/containerapps/redis-test-app",
"name": "redis-test-app",
"type": "Microsoft.App/containerApps",
"location": "North Central US",
"properties": {
"configuration": {
"activeRevisionsMode": "single",
"ingress": {
"fqdn": "<env name>.azurecontainerapps.io",
"external": true,
"targetPort": 6379,
"exposedPort": 20305,
"transport": "tcp"
}
},
"template": {
"containers": [
{
"image": "docker.io/redis:7.0",
"name": "redis",
"resources": {
"cpu": 0.25,
"memory": "0.5Gi"
}
}
],
"scale": {
"minReplicas": 0,
"maxReplicas": 10,
"rules": [
{
"name": "my-tcp-scale-rule",
"tcp": {
"metadata": {
"concurrentConnections": "10"
}
}
}
]
}
}
}
}
#You should be able to connect to the app from anywhere using:
$ redis-cli -h <env name>.azurecontainerapps.io -p 20305
#You can also access the app from inside the environment using
$ redis-cli -h redis-test-app -p 20305
Traffic splits between revisions
{
"id": "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.App/containerapps/redis-test-app",
"name": "redis-test-app",
"type": "Microsoft.App/containerApps",
"location": "North Central US",
"properties": {
"configuration": {
"activeRevisionsMode": "single",
"ingress": {
"fqdn": "<env name>.azurecontainerapps.io",
"external": false,
"targetPort": 6379,
"exposedPort": 6379,
"transport": "tcp",
"traffic": [
{
"revisionName": "redis-test-app--rev1",
"weight": 80
},
{
"revisionName": "redis-test-app--rev2",
"weight": 20
}
]
}
},
"template": {
"containers": [
{
"image": "docker.io/redis:7.0",
"name": "redis",
"resources": {
"cpu": 0.25,
"memory": "0.5Gi"
}
}
],
"scale": {
"minReplicas": 0,
"maxReplicas": 10
}
}
}
}
Limitation Must use a custom VNET/Bring your own VNET
Out of scope items:
- UDP Support. #129
- Exposing more than 1 port in an app. #201