This project demonstrates a complete end-to-end workflow for deploying a simple Go HTTP server with modern infrastructure practices.
- A Go HTTP server that responds with
Hello, World!at/ - A Dockerfile for server containerization
- A GitHub CI workflow for building and pushing the server changes to Docker Hub
- Kubernetes manifests for deployment, service, and ingress
- Terraform infrastructure replicating the Kubernetes resources plus some additional enhancements
- Deployment is designed for a Minikube cluster for local development
A few things need to be installed first. Feel free to follow the official websites.
- Clone the repository
git clone https://github.com/your-username/origoss-task.git
cd origoss-task- Start Minikube
minikube start- Enable Ingress Addon
This setup uses Ingress. Enable Minikbe's ingress addon:
minikube addons enable ingress- Add local domain to host list
Aquire Minikube IP and add to /etc/hosts
echo "$(minikube ip) origoss-task.local" | sudo tee -a /etc/hostsThere are a two ways to use the Minikube cluster. There are kubernetes manifest YAML files and also a terraform infrastructure.
- Apply the manifests
cd kubernetes
kubectl apply -f deployment.yaml -f service.yaml -f ingress.yaml- Access the server
curl origoss-task.local- Initialize Terraform
cd minikube-infra
terraform init- Apply the infrastructure
terraform apply- Access the server
curl origoss-task.localTo use CI capabilities for custom development, follow these steps:
Follow the official Forking - GitHub documentation
- Change the image reference to a custom one
- Generate Docker Hub Personal Access Token (
Settings>Personal access tokens>Generate new token) - Set The PAT for GitHub as
DOCKER_HUB_TOKEN(Settings>Secrets and variables>Actions>New Repository Secret)
- Change the image reference in deployment.yaml
- Create a
terraform.tfvarsfile with the updated image reference or change the default image value invariables.tf
- Navigate to
Actions - Find and choose the action from left side menu
- Find the
This workflow has a workflow_dispatch event trigger.field and chooseRun workflow - Continue with the usage steps
- Feel free to change local domain from
origoss-task.localto any custom one - Feel free to change replica count according to custom needs
- This approach aims to satisfy the main requirements: simplicity and efficiency. If more complexity is acceptable, a few improvements could be added:
- AWS EKS cluster usage (possibly with additional features)
- additional Go endpoints for Kubernetes probes if needed
- Terraform state management backend
- server and server image versioning
- etc.