You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
5.0 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. # Deploying a Service Fabric cluster based on Linux nodes (No Secured)
  2. You can always deploy a SF cluster through the Azure portal, as explained in this article: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-azure-cluster
  3. However, when creating a cluster, there are quite a few configurations to take into account, like enabling the internal DNS service or Reverse Proxy service, choosing between Linux/Windows, open/publish your application ports in the load-balancer and most of all (the most complex setup) how to create a secure cluster.
  4. Because of those reasons, we have created a set of ARM templates and scripts so you can create, re-create and configure the SF clusters much faster, as explained below:
  5. Within eShopOnContainers root folder, at the folder [..\deploy\az\servicefabric\LinuxContainers](https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/az/servicefabric/LinuxContainers), you can find the ARM template `servicefabricdeploy.json` and its parameters file (`servicefabricdeploy.parameters.json`) to create a Service Fabric cluster environment for Linux Containers.
  6. ## Edit the servicefabricdeploy.parameters.json file
  7. Edit the following params in `servicefabricdeploy.parameters.json` file to set your values:
  8. - clusterName: Name of your SF cluster
  9. - clusterLocation: Datacenter location, like westus or westeurope
  10. - computeLocation: Datacenter location, like westus or westeurope
  11. - adminUserName: user-name for VMs administration
  12. - adminPassword: user-password for VMs administration
  13. - dnsName: Name assigned to your SF dns
  14. Optionally, you could modify which ports are opened in the LoadBalancer for the multiple eShopOnContainer apps and API services.
  15. By default, they are setup as:
  16. - webMvcHttpPort: 5100
  17. - webSpaHttpPort: 5104
  18. - webStatusHttpPort: 5107
  19. - IdSrvHttpRule: 5105
  20. - BasketApiHttpRule: 5103
  21. - CatalogApiHttpRule: 5101
  22. - OrderingApiHttpRule: 5102
  23. - MarketingApiHttpRule: 5110
  24. - LocationsApiHttpRule: 5109
  25. ## Deploy the Service Fabric cluster using the script and ARM templates
  26. Once parameter file is edited you can deploy it using [create-resources script](../readme.md).
  27. For example, to deploy the cluster to a new resourcegroup located in westus, go to `deploy\az` folder and type:
  28. ```
  29. create-resources.cmd servicefabric\LinuxContainers\servicefabricdeploy qa-eshop-sflinux-resgrp -c westus
  30. ```
  31. ## Deploy eShopOnServiceFabric with Visual Studio.
  32. Alternatively, instead of using ARM templates, you can deploy eShop on service fabric directly by publishing the project eShopOnServiceFabric in eShopOnContainers-ServicesAndWebApps.sln with Visual Studio publish tool.
  33. # Deploying Azure Service Fabric (Secured)
  34. The ARM template `servicefabricdeploysecured.json` and its parameter file (`servicefabricdeploysecured.parameters.json`) are used to create a service fabric cluster environment for linux containers secured with a certificate.
  35. ## Create Azure Keyvault service
  36. Go to PortalAzure and create a Keyvault service. Make sure Enable access for deployment checkboxes are selected.
  37. <img src="../../../../img/sf/create-kv.png">
  38. ## Generate a certificate in Azure Keyvault
  39. Execute the gen-keyvaultcert.ps1 script to generate and download a certificate from Keyvault.
  40. ```
  41. .\gen-keyvaultcert.ps1 -vaultName <your_keyvault_service> -certName <your_cert_name> -certPwd <your_cert_pwd> -subjectName CN=<your_sf_dns_name>.westeurope.cloudapp.azure.com -saveDir C:\Users\<user>\Downloads
  42. ```
  43. ## Install the certificate
  44. Install the certificate under 'Current User' store location and check it as exportable.
  45. <img src="../../../../img/sf/install-cert.png">
  46. ## Editing servicefabricdeploysecured.parameters.json file
  47. Edit the following params in `servicefabricdeploysecured.parameters.json` file to set your values:
  48. - clusterName: Name of your SF cluster
  49. - dnsName: Name assigned to your SF dns
  50. - adminUserName: user name for administration
  51. - adminPassword: user password for administration
  52. - sourceVaultValue: keyvault resource id (check azure keyvault properties)
  53. - certificateUrlValue: certificate url (check azure Keyvault certificate properties)
  54. - certificateThumbprint: certificate thumbprint (check azure Keyvault certificate properties)
  55. Optionally, you can modify which ports are opened in the LoadBalancer for accessing externally to the apps:
  56. - webMvcHttpPort: port externally exposed for the WebMVC app
  57. - webSpaHttpPort: port externally exposed for the WebSPA app
  58. - webStatusHttpPort: port externally exposed for the WebStatus app
  59. - IdSrvHttpRule: port externally exposed for the Identity app
  60. ## Deploy the template
  61. Once parameter file is edited you can deploy it using [create-resources script](../readme.md).
  62. ```
  63. create-resources.cmd servicefabric\LinuxContainers\servicefabricdeploysecured newResourceGroup -c westus
  64. ```
  65. ## Deploy eShopOnServiceFabric with Visual Studio.
  66. Modify the cloud.xml file of each Service Fabric application in PublishProfile directory and set your certificate settings to be able to deploy eshopOnContainers in the secured cluster:
  67. <img src="../../../../img/sf/cloud_publishProfile.png">