

Kubectl scale -replicas=0 deployment/my-super-app Then you can either just delete the deployment and apply it again or just delete the pod so it will create a new one for you or you can scale the deployment to 0 and then back up to 1, or your desired amount of replicas.
Reset docker and kubernetes environment code#
When you make a code change and are ready to test out the changes in the container, you can just rebuild the image using the Docker build with no cache option.

The important thing here is that you set the imagePullPolicy: Never This assumes that the image is available locally and will make no attempt to pull the image from a remote location. deployment-my-super-app.yamlĮxample deployment.yaml file: apiVersion: apps/v1 Now you can deploy the image to your local Minikube environment. ĭocker tag my-super-app:latest my-super-app:1.0.0 #!/usr/bin/env bashĭocker build -no-cache -t my-super-app. Now all you need to do is build your image and tag it to be available when deploying to your Minikube Kubernetes instance. Now all your Docker commands will be executed in the Minikube VM. To switch your Docker context to using Minikube you run the following command from your terminal: #!/usr/bin/env bash You can find out more information about installing and starting Minikube here. Luckily there is an easy way to switch context between your Minikube and local environments. Minikube has no way to access your local Docker environment or repository. So all you really need to do is build your docker images locally and tag them inside of the Minikube VM.
Reset docker and kubernetes environment software#
But what happens when you are busy developing your software locally and need quicker iterations and not have to push the image changes to a public repository so that it can be pulled from that public repository just to start up your container on a Kubernetes pod running locally.īecause Minikube runs in a VM on your machine, it has Docker and a local repository installed.

These images can be pulled from public repositories. These containers are started by running Docker images. With Kubernetes you run Docker containers within your pods. It runs as a single-node Kubernetes cluster on your machine so you can use it to run your software which will use the same/or similar configuration to run in production. Minikube is a tool that helps you run Kubernetes locally. Developers are flocking to the platform and taking advantage of the increase in the speed of their development deployments. The popularity of Kubernetes as a container orchestration service has been growing at an amazing rate.
