This repository demonstrates how to create a simple Go web server, containerize it using Docker, and deploy it in Kubernetes locally using Minikube. It includes the following files:
main.go
: Contains the Go code for the web server.Dockerfile
: Specifies the Docker image for the web server.deployment.yaml
: Defines the Kubernetes deployment.go.mod
: Lists project dependencies.
Before getting started, ensure you have the following tools installed:
- Docker: https://www.docker.com/products/docker-desktop/
- Minikube: https://minikube.sigs.k8s.io/docs/start/
- Go: https://go.dev/doc/install
- kubectl: https://kubernetes.io/docs/tasks/tools/#kubectl
- Clone this repository.
- Build the Docker image:
docker build -t plutopilot-webserver .
- Start Minikube:
minikube start
- Deploy the application:
kubectl apply -f deployment.yaml
- Access the web server using port forwarding:
kubectl port-forward deployments/plutopilot-deployment 8080:8080
- Open a web browser and go to http://localhost:8080 to see the "Welcome" message.
For more details and commands, please refer to the repository files and comments.