fcgomes92 / kub-noob

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kub-noob

Steps

Start the kub local service

minikube start

Start the dashboard to make it easier to check some stuff

minikube dashboard

If you want to use local images on minikube, check the Docker Images Section

Create deployment

Create a deployment using the Deploy file

kubectl apply -f ./deploy.yml

Accessing the exposed service

Start the service on minikube. This will expose the nodePort to be accessed on your minikube id.

minikube service [<Your deployment name defined under: metadata.name>](./deploy.yml)

The command above will open the URL in your default browser, but you can also get the URL using the following command:

minikube ip # get your minikube's ip

Now get the port defined on the service (nodePort) and access: <minikube ip>:<nodePort>

This step is important locally because, as the kubernetes wiki says:

On cloud providers that support load balancers, an external IP address would be provisioned to access the Service. On Minikube, the LoadBalancer type makes the Service accessible through the minikube service command.


You can also tunnel your connection

minikube tunnel

Then you can get your external ip and access directly the target port defined in the deplyment file: <external_ip>:<targetPort>

Docker

To use local images in minikube use:

$(minikube docker-env)

Maybe you will have to point the DOCKER_CERT_PATH to the right location

export DOCKER_CERT_PATH=~/.minikube/certs

Now you can build your local images

docker-compose build

# or

docker build -t kub-noob .

Now your image is built inside minikube

To revert to your local docker use:

$(minikube docker-env -u)

About


Languages

Language:TypeScript 72.7%Language:Dockerfile 27.3%