| 479 | |
| 480 | |
| 481 | = Kubernates |
| 482 | |
| 483 | Kubernatesを動かしたメモ。ここ見た方がいいかも: https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/docker.md |
| 484 | |
| 485 | {{{ |
| 486 | K8S_VERSION=1.1.1 |
| 487 | |
| 488 | docker run \ |
| 489 | --name etcd \ |
| 490 | -v /var/etcd:/var/etcd \ |
| 491 | --net=host -d\ |
| 492 | gcr.io/google_containers/etcd:2.0.12 \ |
| 493 | /usr/local/bin/etcd \ |
| 494 | --addr=127.0.0.1:4001 \ |
| 495 | --bind-addr=0.0.0.0:4001 \ |
| 496 | --data-dir=/var/etcd/data |
| 497 | |
| 498 | docker run \ |
| 499 | --name=k8s_master \ |
| 500 | --volume=/:/rootfs:ro \ |
| 501 | --volume=/sys:/sys:ro \ |
| 502 | --volume=/dev:/dev \ |
| 503 | --volume=/var/lib/docker/:/var/lib/docker:ro \ |
| 504 | --volume=/var/lib/kubelet/:/var/lib/kubelet:rw \ |
| 505 | --volume=/var/run:/var/run:rw \ |
| 506 | --net=host \ |
| 507 | --pid=host \ |
| 508 | --privileged=true \ |
| 509 | -d \ |
| 510 | gcr.io/google_containers/hyperkube:v${K8S_VERSION} \ |
| 511 | /hyperkube \ |
| 512 | kubelet \ |
| 513 | --containerized \ |
| 514 | --hostname-override="127.0.0.1" \ |
| 515 | --address="0.0.0.0" \ |
| 516 | --api-servers=http://localhost:8080 \ |
| 517 | --config=/etc/kubernetes/manifests \ |
| 518 | --allow-privileged=true --v=10 |
| 519 | |
| 520 | docker run \ |
| 521 | --name k8s_proxy \ |
| 522 | --net=host --privileged \ |
| 523 | -d \ |
| 524 | gcr.io/google_containers/hyperkube:v${K8S_VERSION} \ |
| 525 | /hyperkube \ |
| 526 | proxy \ |
| 527 | --master=http://127.0.0.1:8080 --v=2 |
| 528 | }}} |
| 529 | |
| 530 | |
| 531 | |
| 532 | {{{ |
| 533 | # ./kubectl get nodes |
| 534 | NAME LABELS STATUS |
| 535 | 127.0.0.1 kubernetes.io/hostname=127.0.0.1 Ready |
| 536 | }}} |