This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional gateway samples
- Loading branch information
Showing
5 changed files
with
855 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
{ | ||
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]", | ||
"metadata": { | ||
"description": "Location of the resources (e.g. westus, eastus, westeurope)." | ||
} | ||
}, | ||
"stateFolderName": { | ||
"type": "string", | ||
"defaultValue": "CounterService", | ||
"metadata": { | ||
"description": "Folder in which to store the state. Provide a empty value to create a unique folder for each container to store the state. A non-empty value will retain the state across deployments, however if more than one applications are using the same folder, the counter may update more frequently." | ||
} | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"apiVersion": "2018-09-01-preview", | ||
"name": "meshNetworkLinux", | ||
"type": "Microsoft.ServiceFabricMesh/networks", | ||
"location": "[parameters('location')]", | ||
"dependsOn": [], | ||
"properties": { | ||
"kind": "Local", | ||
"description": "Service Fabric Mesh Network.", | ||
"networkAddressPrefix": "10.0.0.0/24" | ||
} | ||
}, | ||
{ | ||
"apiVersion": "2018-09-01-preview", | ||
"name": "ingressGatewayLinux", | ||
"type": "Microsoft.ServiceFabricMesh/gateways", | ||
"location": "[parameters('location')]", | ||
"tags": {}, | ||
"dependsOn": [ | ||
"Microsoft.ServiceFabricMesh/networks/meshNetworkLinux" | ||
], | ||
"properties": { | ||
"description": "Service Fabric Mesh Gateway for Linux mesh samples.", | ||
"sourceNetwork": { | ||
"name": "Open" | ||
}, | ||
"destinationNetwork": { | ||
"name": "[resourceId('Microsoft.ServiceFabricMesh/networks', 'meshNetworkLinux')]" | ||
}, | ||
"http": [ | ||
{ | ||
"name": "web", | ||
"port": 80, | ||
"hosts": [ | ||
{ | ||
"name": "*", | ||
"routes": [ | ||
{ | ||
"name": "helloRoute", | ||
"match": { | ||
"path": { | ||
"value": "/", | ||
"rewrite": "/", | ||
"type": "Prefix" | ||
}, | ||
"headers": [ | ||
{ | ||
"name": "serviceNameHeader", | ||
"value": "helloWorld", | ||
"type": "Exact" | ||
} | ||
] | ||
}, | ||
"destination": { | ||
"applicationName": "meshAppLinux", | ||
"serviceName": "helloWorldService", | ||
"endpointName": "helloWorldListener" | ||
} | ||
}, | ||
{ | ||
"name": "counterRoute", | ||
"match": { | ||
"path": { | ||
"value": "/", | ||
"rewrite": "/", | ||
"type": "Prefix" | ||
}, | ||
"headers": [ | ||
{ | ||
"name": "serviceNameHeader", | ||
"value": "counter", | ||
"type": "Exact" | ||
} | ||
] | ||
}, | ||
"destination": { | ||
"applicationName": "meshAppLinux", | ||
"serviceName": "counterService", | ||
"endpointName": "counterServiceListener" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"apiVersion": "2018-09-01-preview", | ||
"name": "meshAppLinux", | ||
"type": "Microsoft.ServiceFabricMesh/applications", | ||
"location": "[parameters('location')]", | ||
"dependsOn": [ | ||
"Microsoft.ServiceFabricMesh/networks/meshNetworkLinux" | ||
], | ||
"properties": { | ||
"description": "Service Fabric Mesh sample Application.", | ||
"services": [ | ||
{ | ||
"type": "Microsoft.ServiceFabricMesh/services", | ||
"name": "helloWorldService", | ||
"properties": { | ||
"description": "Service Fabric Mesh Hello World Service.", | ||
"osType": "linux", | ||
"codePackages": [ | ||
{ | ||
"name": "helloWorldCode", | ||
"image": "seabreeze/azure-mesh-helloworld:1.1-alpine", | ||
"endpoints": [ | ||
{ | ||
"name": "helloWorldListener", | ||
"port": "80" | ||
} | ||
], | ||
"resources": { | ||
"requests": { | ||
"cpu": "1", | ||
"memoryInGB": "1" | ||
} | ||
} | ||
} | ||
], | ||
"replicaCount": "1", | ||
"networkRefs": [ | ||
{ | ||
"name": "[resourceId('Microsoft.ServiceFabricMesh/networks', 'meshNetworkLinux')]", | ||
"endpointRefs": [ | ||
{ | ||
"name": "helloWorldListener" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "counterService", | ||
"properties": { | ||
"description": "A web service that serves the counter value stored in the Azure Files volume.", | ||
"osType": "linux", | ||
"codePackages": [ | ||
{ | ||
"name": "counterService", | ||
"image": "seabreeze/azure-mesh-counter:0.1-alpine", | ||
"endpoints": [ | ||
{ | ||
"name": "counterServiceListener", | ||
"port": 80 | ||
} | ||
], | ||
"environmentVariables": [ | ||
{ | ||
"name": "STATE_FOLDER_NAME", | ||
"value": "[parameters('stateFolderName')]" | ||
} | ||
], | ||
"resources": { | ||
"requests": { | ||
"cpu": 0.5, | ||
"memoryInGB": 0.5 | ||
} | ||
} | ||
} | ||
], | ||
"replicaCount": 1, | ||
"networkRefs": [ | ||
{ | ||
"name": "[resourceId('Microsoft.ServiceFabricMesh/networks', 'meshNetworkLinux')]", | ||
"endpointRefs": [ | ||
{ | ||
"name": "counterServiceListener" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"outputs": { | ||
"publicIPAddress": { | ||
"value": "[reference('ingressGatewayLinux').ipAddress]", | ||
"type": "string" | ||
} | ||
} | ||
} |
Oops, something went wrong.