Install the following:
Ensure you have an account in Docker Hub, and login/enter creds.
docker login
Navigate to the API solution and run:
docker build -t leeeennyy/k8s-lightning-talk-demo:v1 -f k8s-lightning-talk-demo\Dockerfile .
docker push leeeennyy/k8s-lightning-talk-demo:v1
You'll need to replace leeeennyy
with the name of your docker registry if you want to make your own. You can create an account at https://hub.docker.com/.
To deploy locally, ensure that minikube is started and that kubectl is connected to it.
minikube start
kubectl config use-context minikube
Navigate to the top level of this repo
kubectl apply -f service.yaml
kubectl apply -f deployment.yaml
Check resources are up
kubectl get po
kubectl get deployment
kubectl get svc
Once resources are up, we can connect to our API. The command below will open up a tab in your browser, and we can navigate to <url>/weatherforecast
. We should see our API.
minikube service k8s-lightning-talk-demo-svc
kubectl scale deployment k8s-lightning-talk-demo --replicas=5
kubectl logs po <podname>
kubectl delete -f service.yaml
kubectl delete -f deployment.yaml
minikube stop