tye/samples/voting
William Godbe 98f8d342ff
Replace 'master' with 'main' in various files (#974)
2021-03-11 13:57:55 -08:00
..
.vscode Add voting sample (#201) 2020-03-25 15:44:53 -07:00
results Implement library support for service discovery (#299) 2020-04-07 15:28:39 -07:00
vote Updated Voting sample deployment steps (#755) 2020-11-23 09:54:44 -08:00
worker Updated Voting sample deployment steps (#755) 2020-11-23 09:54:44 -08:00
.editorconfig Add voting sample (#201) 2020-03-25 15:44:53 -07:00
README.md Replace 'master' with 'main' in various files (#974) 2021-03-11 13:57:55 -08:00
VotingSample.sln Add voting sample (#201) 2020-03-25 15:44:53 -07:00
tye.yaml Updated Voting sample deployment steps (#755) 2020-11-23 09:54:44 -08:00

README.md

VotingSample

Voting sample app inspired by https://github.com/dockersamples/example-voting-app with a few different implementation choices.

For running

The project should be immediately runnable by calling tye run from the directory.

For deployment

A few things need to be configured before deploying to Kubernetes.

  • Create an Azure container registry using the Azure portal or you can use your public docker hub account

  • You can use managed service instances for both redis and postgres datastore. For e.g :

    • redis : Azure Cache for Redis
    • postgres: Azure Database for PostgreSQL

    Or you can use the following steps to deploy the respective datastores in the Kubernetes cluster itself.

  • Redis can be deployed using the below command :

    kubectl apply -f https://raw.githubusercontent.com/dotnet/tye/main/docs/tutorials/hello-tye/redis.yaml
    
  • Postgresql can be installed by the following command :

    kubectl apply -f https://raw.githubusercontent.com/dotnet/tye/main/docs/tutorials/hello-tye/postgres.yaml
    
  • Once the deployment is done, you need to keep a note of the below connection strings :

    • redis:6379
    • Server=postgres;Port=5432;User Id=postgres;Password=pass@word1;

    ! NOTE: You can modify the password in postgres yaml.

  • After that, run tye deploy --interactive to do the deployment.

  • Fill in the value of container registry and connection strings for both redis and postgres when it's prompted.

  • Once the deployment is complete you should be able to find the public IP address of the deployed application by using :

    kubectl get all -n ingress-nginx
    

    nginx ingress example

    Look for the service/ingress-nginx-controller with a type of LoadBalancer. The EXTERNAL-IP is the entry point for your application. For e.g :

    • vote : http://<EXTERNAL-IP>/vote
    • result: http://<EXTERNAL-IP>/results

    ! NOTE: Ingress controller may take a while to update the listed public IP address.