VotingApp

The VotingApp was originally created by Docker, it’s an application mainly used for demos and follows a microservices architecture.

While this application may not adhere to all architectural best practices, it serves as a great example of an application utilizing multiple languages, various databases, and is an excellent way to learn concepts related to Docker and Kubernetes.

The VotingApp consists of 7 microservices as illustrated in the following diagram:

Voting App

  • vote-ui: A Vue.js frontend that allows users to choose between Cat and Dog
  • vote: A backend API built with Python / Flask
  • redis: A database where votes are stored
  • worker: A service that retrieves votes from Redis and stores the results in a Postgres database
  • db: The Postgres database where vote results are stored
  • result: A backend that sends the scores to a user interface via websocket
  • result-ui: An Angular frontend that displays the voting results

The container images for each microservice are available in the DockerHub. The images’ tag follow a Semantic Version (vX.Y.Z).

This application can be deployed on an existing cluster as follows:

kubectl apply -f https://luc.run/vote.yaml

All the Voting App components are created in the namespace vote. Frontend components are exposed through NodePort Services on the following ports:

Component NodePort
Vote interfate 31001
Result interface 31002

Vote

Result

If an Ingress controller is running:

  • the vote interface can be accessed on vote.votingapp.com
  • the result interface can be accessed on result.votingapp.com
⚠️
Domain names need to be resolved with the Ingress Controller external IP first.
ℹ️
You can view a live version of this application at https://vote.votingapp.xyz.

Feel free to explore the application code