Back Home

MiniKube

Start/stop/status

minikube start
minikube stop 
minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100

To get the ip the minikube is running on

minikube ip
192.168.99.100

Minikube context : The context is what determines which cluster kubectl is interacting with. You can see all your available contexts in the ~/.kube/config file.

kubectl config use-context minikube

Verify that kubectl is configured to communicate with your cluster:

kubectl cluster-info

Open the Kubernetes dashboard in a browser:

minikube dashboard

that will open your browser to something like ..http://192.168.99.100:30000/#!/overview?namespace=default

Deploy an image to Kube use the run command

kubectl run salesforce --image=wtr-ecomm-etl-salesforce/wtr-etl-salesforce:latest  --port=8080

To update a run we can set a new instance:

kubectl set image deployment/hello-node hello-node=hello-node:v2

Kubectrl Pull Problem

with docker images being listed in docker images minikube failed to run saying unable to pull the docker image

It turns out that minikube has it's own registry and cannot see the local docker regsistry

Hack #1

The command:

minikube docker-env

lists the minikube env variables and in local environment it can be sourced with

eval $(minikube docker-env)

the running in the console it is possible to

gradle build // after eval, will now install into minikube registry 
// now we run without going out to pull 
kubectl run salesforce --image=wtr/wtr-etl-salesforce-1.0-snapshot:1.0-snapshot --image-pull-policy=IfNotPresent

Hack 2 Run a Local Registry

Use a local registry:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

Now tag your image properly:

docker tag ubuntu localhost:5000/ubuntu

Note that localhost should be changed to dns name of the machine running registry container.

Now push your image to local registry:

docker push localhost:5000/ubuntu

You should be pull it back:

docker pull localhost:5000/ubuntu

Create a Deployment

A Kubernetes Pod is a group of one or more Containers, tied together for the purposes of administration and networking. The Pod in this tutorial has only one Container. A Kubernetes Deployment checks on the health of your Pod and restarts the Pod’s Container if it terminates. Deployments are the recommended way to manage the creation and scaling of Pods.

Use the kubectl run command to create a Deployment that manages a Pod. The Pod runs a Container based on your hello-node:v1 Docker image:

kubectl run hello-node –image=hello-node:v1 –port=8080 View the Deployment:

kubectl get deployments

 
kubernates.txt · Last modified: 2018/06/11 14:01 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd