Как запустить кластер Kubernetes на Debian
apt-get update apt-get upgrade
Зависимости
apt-get install gcc golang-go curl git
Ставим ETCD
curl -L https://github.com/coreos/etcd/releases/download/v2.0.3/etcd-v2.0.3-linux-amd64.tar.gz -o etcd-v2.0.3-linux-amd64.tar.gz
tar xzvf etcd-v2.0.3-linux-amd64.tar.gz
cd etcd-v2.0.3-linux-amd64
Проверяем работу – ?
./etcd
стопаем на ctrl+c и копируем в /ust/bin/etcd
cp etcd /usr/bin/etcd
Теперь вытягиваем сам Kubernates
git clone https://github.com/GoogleCloudPlatform/kubernetes.git cd kubernetes make release
Скачается docker image – 450 мегов
... +++ Integration test cleanup complete +++ Integration test cleanup complete +++ Running build command.... +++ Output directory is local. No need to copy results out. +++ Building tarball: client darwin-386 +++ Building tarball: client darwin-amd64 +++ Building tarball: client linux-386 +++ Building tarball: client linux-amd64 +++ Building tarball: client linux-arm +++ Building tarball: client windows-amd64 +++ Building tarball: server linux-amd64 +++ Building tarball: salt +++ Building tarball: test +++ Building tarball: full
Следующим шагом – стартуем класте
hack/local-up-cluster.sh
Увидим вывод в терминале:
+++ Building go targets for linux/amd64: cmd/kube-proxy cmd/kube-apiserver cmd/kube-controller-manager cmd/kubelet plugin/cmd/kube-scheduler cmd/kubectl cmd/kubernetes cmd/e2e cmd/integration cmd/gendocs +++ Placing binaries Starting etcd etcd -data-dir /tmp/test-etcd.FoRYZH --bind-addr 127.0.0.1:4001 >/dev/null 2>/dev/null Waiting for etcd to come up. +++ etcd: {"action":"set","node":{"key":"/_test","value":"","modifiedIndex":3,"createdIndex":3}} Waiting for apiserver to come up +++ apiserver: { "kind": "PodList", "creationTimestamp": null, "selfLink": "/api/v1beta1/pods", "resourceVersion": 8, "apiVersion": "v1beta1", "items": [] } Local Kubernetes cluster is running. Press Ctrl-C to shut it down. Logs: /tmp/kube-apiserver.log /tmp/kube-controller-manager.log /tmp/kubelet.log /tmp/kube-proxy.log /tmp/kube-scheduler.log To start using your cluster, open up another terminal/tab and run: cluster/kubectl.sh config set-cluster local --server=https://127.0.0.1:8080 --insecure-skip-tls-verify=true --global cluster/kubectl.sh config set-context local --cluster=local --global cluster/kubectl.sh config use-context local cluster/kubectl.sh
Теперь вы можете использовать скрипты из директории cluster для управления нодами
У меня получилось – https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/guestbook