A simple Go webserver designed to be deployed on Kubernetes.
- Go 1.21 or later
- Docker
- kubectl
- Access to a Kubernetes cluster
To run the server locally:
go run main.goThe server will start on port 8080 by default. You can access it at http://localhost:8080
You can test the server using curl:
curl http://localhost:8080- Build the Docker image:
docker build -t your-registry/cline-server:latest .- Push the Docker image to your registry:
docker push your-registry/cline-server:latestBefore deploying, update the Docker registry in the deployment file:
# Replace ${DOCKER_REGISTRY} with your actual registry
sed -i 's|${DOCKER_REGISTRY}|your-registry|g' k8s/deployment.yaml- Apply the Kubernetes manifests:
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml- Check the deployment status:
kubectl get deployments
kubectl get pods
kubectl get services
kubectl get ingressIf you're using the provided Ingress configuration, update your DNS or hosts file to point cline-server.example.com to your Kubernetes cluster's ingress controller IP.
For local testing with minikube, you can use port-forwarding:
kubectl port-forward svc/cline-server 8080:80Then access the application at http://localhost:8080
The application can be configured using environment variables:
PORT: The port the server listens on (default: 8080)
You can scale the deployment by changing the replicas value in k8s/deployment.yaml or by using the kubectl scale command:
kubectl scale deployment cline-server --replicas=3