utilizing minikube for debugging
minikube start
- from the same terminal window you ran minikube start run
eval $(minikube docker-env)
- again, from the same terminal window, run your docker build command
- update your deployment spec’s [1] pod to point to the local docker image, whatever you tagged it as.
- update your deployment spec’s imagePullPolicy to be Never (
imagePullPolicy: Never
) - kubectl create -f deployment_spec.yaml
- wait for the pods to get created (should not take long)
- expose a loadbalancing service via
kubectl expose deployment mydeployment --type="LoadBalancer"
- see [2]
- Generally, cloud providers will then provide an ip address for access to the service. However since this is minikube there isn’t anyone assinging IP’s to anything. Minikube allows you to simulate this by running
minikube service <load balancer from step 9>
and it will attempt to open a web page to your service. - These go to 11.
[1] get your deployment spec from remote see here
[2]
kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
mydeployment LoadBalancer 10.0.0.40 <pending> 5000:32711/TCP 5s
kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 13m