Content
OttoTrading Kubernetes Deployment Documentation
📌 Pre-requisites
- Install Kubernetes
- Install Docker Desktop
- Log in to Docker Desktop
- Log in to GitHub
- Log in to Docker Hub
- Clone the application repository
- Build and run locally to confirm the app works
1. Navigate to the kube directory
cd /c/dev/trading/localotto-trading/localotto/kube
2. Check running pods
kubectl get pods --kubeconfig ./civo-otto-kubeconfig
Example output:
NAME Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â READY Â STATUSÂ Â RESTARTS Â AGE
tomcat8-7578fd8787-mn48x         1/1   Running  2 (56d)  57d
tomcat-manager-67c64665fd-59btx     1/1   Running  0     56d
otto-deployment-6c7f6f7d87-xmb9b     1/1   Running  0     3d
3. View logs
kubectl logs -f otto-deployment-6c7f6f7d87-xmb9b --kubeconfig ./civo-otto-kubeconfig
4. Restarting the Deployment
Option 1: Rollout restart (recommended)
kubectl rollout restart deployment/otto-deployment --kubeconfig ./civo-otto-kubeconfig
Check rollout status:
kubectl rollout status deployment/otto-deployment --kubeconfig ./civo-otto-kubeconfig
Option 2: Scale down, then scale up
kubectl scale deployment/otto-deployment --replicas=0 --kubeconfig ./civo-otto-kubeconfig
kubectl scale deployment/otto-deployment --replicas=1 --kubeconfig ./civo-otto-kubeconfig
5. Build a New Docker Image
git checkout trading
cd c:/dev/trading/localotto-trading/localotto
Windows build
docker build -f Dockerfile -t shai200/otto:2025.09.12 .
Linux build
docker build -f Dockerfile-lnx -t shai200/otto:2025.09.09 .
6. Test Locally (optional)
docker run -p 8080:8080 -p 5005:5005 shai200/otto-lnx:<version>
7. Push Image to Docker Hub
docker login
docker push shai200/otto:<version>
8. Update Deployment Manifest (../kube/deployment.yaml)
…
image: shai200/otto:<version>
…
9. Deploy to Kubernetes
cd <AppRoot>/kube
kubectl apply -f deployment.yaml --kubeconfig ./civo-otto-kubeconfig
kubectl get pods --selector=app=otto --kubeconfig ./civo-otto-kubeconfig