Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
gateway samples (#69)
Browse files Browse the repository at this point in the history
Additional gateway samples
  • Loading branch information
kavyako authored and sridmad committed Dec 17, 2018
1 parent 6e8b578 commit 2dfd1ea
Show file tree
Hide file tree
Showing 5 changed files with 855 additions and 0 deletions.
209 changes: 209 additions & 0 deletions templates/ingress/meshingress.headers.linux.json
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"
}
}
}
Loading

0 comments on commit 2dfd1ea

Please sign in to comment.