- Install kubectl
- Install minikube
minikube start
minikube addons enable ingress
andminikube addons enable metrics-server
- Restart minikube after enabling ingress addon.
- Copy .env.k8s.example as .env.k8s and fill in the secrets
kubectl apply -f k8s/namespace.yaml
kubectl config set-context --current --namespace=codecapable
- To push the secrets to the cluster, do
kubectl create secret generic cc-secrets --from-env-file=k8s/.env.k8s
. kubectl create secret generic jwt-public --from-literal=JWT_PUBLIC_KEY="keyhere"
(make sure to place key inside quotes)kubectl create secret generic jwt-private --from-literal=JWT_PRIVATE_KEY="keyhere"
(make sure to place key inside quotes)- In a terminal in the root of the project, do
kubectl apply -f k8s/
Make sure Minikube is running in Docker and not Hyper-V or anything else
minikube start
minikube tunnel
in a new terminal- Go to 127.0.0.1 and wait ~30 seconds (before that axios requests from the frontend to the ingress will fail with 502)
To configure kubectl to use the codecapable namespace, use kubectl config set-context --current --namespace=codecapable
. This has to be done every time minikube is started.
kubectl get service
to show you the running services- In a new terminal
minikube service service-name
will expose an IP so you can access the service
kubectl rollout restart -n codecapable deployment problem-ms-deployment
kubectl rollout restart -n codecapable deployment user-ms-deployment
kubectl rollout restart -n codecapable deployment runner-ms-deployment