Kubernetes

1 min read kubernetes

Lab note What I wrote down while learning this by building with it. Short by design; the code is in pfeilbr/kubernetes-playground.

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

Install and start minikube

$ 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

Image no longer available

Keep learning

Get new guides and courses by email

An occasional email when I publish a new guide, course or post. No spam, and you can unsubscribe any time.

Sent with Buttondown. I never share your address. Prefer a feed? Use the RSS feed.