Kubernetes

learn kubernetes. based on tutorial at http://kubernetes.io/docs/tutorials/kubernetes-basics

Install and start minikube

$ cd ~/tmp
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.11.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

# verify install
$ minikube version

# start
$ minikube start

minikube VMs, etc. are stored in ~/.minikube

$ tree ~/.minikube

.
├── addons
├── apiserver.crt
├── apiserver.key
├── ca.crt
├── ca.key
├── ca.pem
├── cache
│   ├── iso
│   │   └── minikube-0.7.iso
│   └── localkube
├── cert.pem
├── certs
│   ├── ca-key.pem
│   ├── ca.pem
│   ├── cert.pem
│   └── key.pem
├── config
├── key.pem
└── machines
    ├── minikube
    │   ├── boot2docker.iso
    │   ├── config.json
    │   ├── disk.vmdk
    │   ├── id_rsa
    │   ├── id_rsa.pub
    │   └── minikube
    │       ├── Logs
    │       │   └── VBox.log
    │       ├── minikube.vbox
    │       └── minikube.vbox-prev
    ├── server-key.pem
    └── server.pem

REST API

start proxy to allow access

$ kubectl proxy

Access API

$ curl http://127.0.0.1:8001/api
{
  "kind": "APIVersions",
  "versions": [
    "v1"
  ],
  "serverAddressByClientCIDRs": [
    {
      "clientCIDR": "0.0.0.0/0",
      "serverAddress": "10.0.2.15:8443"
    }
  ]
}

Accessing Services

The cluster ip address as exposed to host machine can be obtained via

$ kubectl cluster-info