Workshop: Cloud Native Development with Kubernetes
Mentor: Benny Rochwerger
Project name: Sympoll
Group name: MTAPizza
Members: Roy Toledano, Idan Shalom, Ronen Gelmanovich
Project Track: Entrepreneurial
Sympoll is an online surveying platform designed for optimal scalability using Kubernetes. It was developed to address the challenges of conducting effective surveys in environments where group conversations can disrupt the survey process.
Sympoll is targeted at a diverse audience, including community organizers, social planners, students, and corporate leaders, providing a streamlined and accessible platform for all types of survey needs.
|
-
Role:
Acts as the user interface or API gateway. It handles incoming requests from users or other systems, routes them to the appropriate web page, and communicates with the appropriate backend services to pull/push data from the database.Service Port:
8080
-
Role:
Handles external requests to expose the cluster to the outside world.Interaction:
Receives requests from the frontend service, routes them to the service requested according to the endpoint of the request. Each request should have the endpoint '/api' with the suffix of the wanted service to communicate with.Service Port:
8081
-
Role:
Handles the creation, updating, and management of polls.Interaction:
Interfaces with the poll database to store poll data and processes requests from the frontend service.Service Port:
8082DB Port:
5432:5432 (external:internal)
-
Role:
Manages user-related functionalities, such as user registration, authentication, and profile management.Interaction:
Receives requests from the frontend service and interacts with the users database to store and retrieve user data.Service Port:
8083DB Port:
5433:5432 (external:internal)
-
Role:
Manages the voting process within the application, including casting votes and tallying results.Interaction:
Interacts with the poll management service and the votes database to record and retrieve vote data.Service Port:
8084DB Port:
5434:5432 (external:internal)
-
Role:
Manages groups within the application, such as creating, updating, and deleting groups.Interaction:
Communicates with the group database to manage group-related data and receives requests routed through the frontend service.Service Port:
8085DB Port:
5435:5432 (external:internal)
-
Role:
Manages media storage within the application. Used mostly for user profile pictures and banners.Interaction:
Communicates with the media database to manage image file data and receives requests routed through the frontend service. Interacts with the user service to save the user's profile image URLs.Service Port:
8086DB Port:
5436:5432 (external:internal)
- On push to the main branch, a workflow is triggered to automate the building of the container and pushing of its image to our GitHub Packages.
- The versioning of the containers is according to the dates at which they were published to the packages.
- Any push to the main branch requires at least one member of the organization to approve.
In order for you to be able to pull the container image you must first connect your docker to your github account:
docker login -u {USERNAME} -p {TOKEN} ghcr.io
You can generate a token in Github->settings->developer settings->Personal access tokens->Tokens (classic)->Generate new token (classic).
Make sure to:
- name your token with a name indiacting its for your docker.
- Select the write:packages permission.
Once you have successfully connected your docker and github account, pull the image from Github packages.
docker pull ghcr.io/sympoll/{IMAGE_NAME}:{TAG}
After pulling the image, you can now run a container instance.
docker run -d --name {CONTAINER_NAME} -p {IMAGE_PORT}:{IMAGE_PORT} -e POSTGRES_PASSWORD={PASSWORD} {IMAGE_HASH}
For networking debugging inside the Kubernetes Cluster, you can connect to the console pod.
This pod can send requests to other pods in the cluster, use commands inside the network, etc.
- To pull and run the console pod:
kubectl run --image quay.io/brochwer/console console
- To connect to the console pod to start debugging:
kubectl exec -ti console -- /usr/bin/bash
Then to check that the DNS is configured correctly:
nslookup {domain-name}
To check logs of a pod (outside of the console pod):
kubectl logs {pod-full-name}