Monday, 21 August 2017

kubernete, minikube standy note:


Install the client-- kubectl on Mac:

  1. Download the latest release with the command:
    curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl
    
    To download a specific version, replace the $(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) portion of the command with the specific version.
    For example, to download version v1.7.0 on MacOS, type:
    curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/darwin/amd64/kubectl
    
  2. Make the kubectl binary executable.
    chmod +x ./kubectl
  3. Move the binary in to your PATH.
    sudo mv ./kubectl /usr/local/bin/kubectl
Install minikube on Mac:

brew cask install minikube



start minikube:

minikube start

stop:

minikube stop


start dashboard:

minikube dashboard



play with it:

$ kubectl run nginx --image=nginx --port=80
deployment "nginx" created
$ kubectl expose deployment nginx --port=80 --type=NodePort --name=nginx-http
service "nginx-http" exposed
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-2032906785-81t56 1/1 Running 0 2m
$ kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.0.0.1 <none> 443/TCP 20m
nginx-http 10.0.0.146 <none> 80/TCP 2m
$ minikube service nginx-http --url
http://192.168.64.10:30569






1 comment: