- Kubernetes cluster running (minikube or similar)
- kubectl installed
- kustomize installed (comes with recent versions of kubectl)
# Go to k8 directory
cd k8
# Apply deployment and service
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml# Run the update script (this will create/update configmap)
./update-configmap.shThis script will:
- Copy necessary files from api_script
- Create/update the ConfigMap with latest code
- Apply changes using kustomize
# Check if pods are running
kubectl get pods -l app=repo-handler
# Check the service
kubectl get svc repo-handler-service# Get the service URL
minikube service repo-handler-service# Get the service URL
kubectl get svc repo-handler-service
# Access in browser
http://<service-url>:8000/upload# Test using curl
curl -X POST \
-F "repo_type=url" \
-F "repo_name=test" \
-F "user=test" \
-F "repo_url=https://github.com/test/test" \
http://<service-url>:8000/repository/- Make changes to files in
api_script/ - Run update script to apply changes:
cd k8 ./update-configmap.sh - Changes will be automatically deployed with a new pod
upload_api/
├── api_script/
│ ├── main.py
│ ├── facade.py
│ ├── requirements.txt
│ └── templates/
│ └── upload.html
└── k8/
├── deployment.yaml
├── service.yaml
├── kustomization.yaml
└── update-configmap.sh
# Get pod name
kubectl get pods -l app=repo-handler
# Check logs
kubectl logs <pod-name># List ConfigMaps
kubectl get configmaps
# Describe specific ConfigMap (replace hash with actual hash)
kubectl describe configmap app-code-configmap-<hash>
# Check ConfigMap content
kubectl get configmap app-code-configmap-<hash> -o yaml- If pod is not starting, check the logs
- If changes not reflecting, verify the ConfigMap was updated
- Ensure all required files are included in the ConfigMap