After installing the RKE client on my ubuntu host machine and docker on my ubuntu kvm nodes running with virtmanager, I was able to bring up a k8's cluster in minutes.
See: https://github.com/rancher/rke/wiki/Quick-Start-Guide
RKE walks you though the creation of the cluster configuration and then it's a single command to deploy the cluster.
The trace is below - truly impressive. I have experimented with many tools to deploy k8's and this is, by far, the easiest. Kudos to the guys at Rancher.
ubuntu@openstack:~/Downloads$ ./rke_linux-amd64 config
[+] Cluster Level SSH Private Key Path [~/.ssh/id_rsa]:
[+] Number of Hosts [1]: 3
[+] SSH Address of host (1) [none]: 192.168.1.160
[+] SSH Port of host (1) [22]:
[+] SSH Private Key Path of host (192.168.1.160) [none]:
[-] You have entered empty SSH key path, trying fetch from SSH key parameter
[+] SSH Private Key of host (192.168.1.160) [none]:
[-] You have entered empty SSH key, defaulting to cluster level SSH key: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.160) [ubuntu]:
[+] Is host (192.168.1.160) a control host (y/n)? [y]: y
[+] Is host (192.168.1.160) a worker host (y/n)? [n]: n
[+] Is host (192.168.1.160) an Etcd host (y/n)? [n]: y
[+] Override Hostname of host (192.168.1.160) [none]: kubernetes1
[+] Internal IP of host (192.168.1.160) [none]:
[+] Docker socket path on host (192.168.1.160) [/var/run/docker.sock]:
[+] SSH Address of host (2) [none]: 192.168.1.161
[+] SSH Port of host (2) [22]:
[+] SSH Private Key Path of host (192.168.1.161) [none]:
[-] You have entered empty SSH key path, trying fetch from SSH key parameter
[+] SSH Private Key of host (192.168.1.161) [none]:
[-] You have entered empty SSH key, defaulting to cluster level SSH key: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.161) [ubuntu]:
[+] Is host (192.168.1.161) a control host (y/n)? [y]: n
[+] Is host (192.168.1.161) a worker host (y/n)? [n]: y
[+] Is host (192.168.1.161) an Etcd host (y/n)? [n]: n
[+] Override Hostname of host (192.168.1.161) [none]: kubernetes2
[+] Internal IP of host (192.168.1.161) [none]:
[+] Docker socket path on host (192.168.1.161) [/var/run/docker.sock]:
[+] SSH Address of host (3) [none]: 192.168.1.162
[+] SSH Port of host (3) [22]:
[+] SSH Private Key Path of host (192.168.1.162) [none]:
[-] You have entered empty SSH key path, trying fetch from SSH key parameter
[+] SSH Private Key of host (192.168.1.162) [none]:
[-] You have entered empty SSH key, defaulting to cluster level SSH key: ~/.ssh/id_rsa
[+] SSH User of host (192.168.1.162) [ubuntu]:
[+] Is host (192.168.1.162) a control host (y/n)? [y]: n
[+] Is host (192.168.1.162) a worker host (y/n)? [n]: y
[+] Is host (192.168.1.162) an Etcd host (y/n)? [n]: n
[+] Override Hostname of host (192.168.1.162) [none]: kubernetes3
[+] Internal IP of host (192.168.1.162) [none]:
[+] Docker socket path on host (192.168.1.162) [/var/run/docker.sock]:
[+] Network Plugin Type (flannel, calico, weave, canal) [flannel]:
[+] Authentication Strategy [x509]:
[+] Authorization Mode (rbac, none) [rbac]:
[+] Etcd Docker Image [rancher/coreos-etcd:v3.0.17]:
[+] Kubernetes Docker image [rancher/k8s:v1.8.10-rancher1-1]:
[+] Cluster domain [cluster.local]:
[+] Service Cluster IP Range [10.43.0.0/16]:
[+] Enable PodSecurityPolicy [n]:
[+] Cluster Network CIDR [10.42.0.0/16]:
[+] Cluster DNS Service IP [10.43.0.10]:
[+] Infra Container image [rancher/pause-amd64:3.0]:
ubuntu@openstack:~/Downloads$ ./rke_linux-amd64 up
INFO[0000] Building Kubernetes cluster
INFO[0000] [dialer] Setup tunnel for host [192.168.1.162]
INFO[0000] [dialer] Setup tunnel for host [192.168.1.160]
INFO[0000] [dialer] Setup tunnel for host [192.168.1.161]
INFO[0000] [network] Deploying port listener containers
INFO[0001] [network] Successfully started [rke-etcd-port-listener] container on host [192.168.1.160]
INFO[0001] [network] Successfully started [rke-cp-port-listener] container on host [192.168.1.160]
INFO[0002] [network] Successfully started [rke-worker-port-listener] container on host [192.168.1.162]
INFO[0002] [network] Successfully started [rke-worker-port-listener] container on host [192.168.1.161]
INFO[0002] [network] Port listener containers deployed successfully
INFO[0002] [network] Running control plane -> etcd port checks
INFO[0002] [network] Successfully started [rke-port-checker] container on host [192.168.1.160]
INFO[0002] [network] Running control plane -> worker port checks
INFO[0003] [network] Successfully started [rke-port-checker] container on host [192.168.1.160]
INFO[0003] [network] Running workers -> control plane port checks
INFO[0003] [network] Successfully started [rke-port-checker] container on host [192.168.1.161]
INFO[0003] [network] Successfully started [rke-port-checker] container on host [192.168.1.162]
INFO[0003] [network] Checking KubeAPI port Control Plane hosts
INFO[0003] [network] Removing port listener containers
INFO[0004] [remove/rke-etcd-port-listener] Successfully removed container on host [192.168.1.160]
INFO[0004] [remove/rke-cp-port-listener] Successfully removed container on host [192.168.1.160]
INFO[0004] [remove/rke-worker-port-listener] Successfully removed container on host [192.168.1.162]
INFO[0004] [remove/rke-worker-port-listener] Successfully removed container on host [192.168.1.161]
INFO[0004] [network] Port listener containers removed successfully
INFO[0004] [certificates] Attempting to recover certificates from backup on host [192.168.1.160]
INFO[0004] [certificates] No Certificate backup found on host [192.168.1.160]
INFO[0004] [certificates] Generating CA kubernetes certificates
INFO[0005] [certificates] Generating Kubernetes API server certificates
INFO[0005] [certificates] Generating Kube Controller certificates
INFO[0005] [certificates] Generating Kube Scheduler certificates
INFO[0005] [certificates] Generating Kube Proxy certificates
INFO[0005] [certificates] Generating Node certificate
INFO[0005] [certificates] Generating admin certificates and kubeconfig
INFO[0006] [certificates] Generating etcd-192.168.1.160 certificate and key
INFO[0006] [certificates] Temporarily saving certs to control host [192.168.1.160]
INFO[0011] [certificates] Saved certs to control host [192.168.1.160]
INFO[0011] [reconcile] Reconciling cluster state
INFO[0011] [reconcile] This is newly generated cluster
INFO[0011] [certificates] Deploying kubernetes certificates to Cluster nodes
INFO[0017] Successfully Deployed local admin kubeconfig at [./kube_config_cluster.yml]
INFO[0017] [certificates] Successfully deployed kubernetes certificates to Cluster nodes
INFO[0017] Pre-pulling kubernetes images
INFO[0017] Kubernetes images pulled successfully
INFO[0017] [etcd] Building up etcd plane..
INFO[0017] [etcd] Successfully started [etcd] container on host [192.168.1.160]
INFO[0017] [etcd] Successfully started [rke-log-linker] container on host [192.168.1.160]
INFO[0017] [remove/rke-log-linker] Successfully removed container on host [192.168.1.160]
INFO[0017] [etcd] Successfully started etcd plane..
INFO[0017] [controlplane] Building up Controller Plane..
INFO[0018] [controlplane] Successfully started [kube-apiserver] container on host [192.168.1.160]
INFO[0018] [healthcheck] Start Healthcheck on service [kube-apiserver] on host [192.168.1.160]
INFO[0023] [healthcheck] service [kube-apiserver] on host [192.168.1.160] is healthy
INFO[0024] [controlplane] Successfully started [rke-log-linker] container on host [192.168.1.160]
INFO[0024] [remove/rke-log-linker] Successfully removed container on host [192.168.1.160]
INFO[0024] [controlplane] Successfully started [kube-controller-manager] container on host [192.168.1.160]
INFO[0024] [healthcheck] Start Healthcheck on service [kube-controller-manager] on host [192.168.1.160]
INFO[0030] [healthcheck] service [kube-controller-manager] on host [192.168.1.160] is healthy
INFO[0030] [controlplane] Successfully started [rke-log-linker] container on host [192.168.1.160]
INFO[0030] [remove/rke-log-linker] Successfully removed container on host [192.168.1.160]
INFO[0031] [controlplane] Successfully started [kube-scheduler] container on host [192.168.1.160]
INFO[0031] [healthcheck] Start Healthcheck on service [kube-scheduler] on host [192.168.1.160]
INFO[0036] [healthcheck] service [kube-scheduler] on host [192.168.1.160] is healthy
INFO[0036] [controlplane] Successfully started [rke-log-linker] container on host [192.168.1.160]
INFO[0037] [remove/rke-log-linker] Successfully removed container on host [192.168.1.160]
INFO[0037] [controlplane] Successfully started Controller Plane..
INFO[0037] [authz] Creating rke-job-deployer ServiceAccount
INFO[0037] [authz] rke-job-deployer ServiceAccount created successfully
INFO[0037] [authz] Creating system:node ClusterRoleBinding
INFO[0037] [authz] system:node ClusterRoleBinding created successfully
INFO[0037] [certificates] Save kubernetes certificates as secrets
INFO[0037] [certificates] Successfully saved certificates as kubernetes secret [k8s-certs]
INFO[0037] [state] Saving cluster state to Kubernetes
INFO[0037] [state] Successfully Saved cluster state to Kubernetes ConfigMap: cluster-state
INFO[0037] [worker] Building up Worker Plane..
INFO[0037] [worker] Pulling image [rancher/rke-nginx-proxy:v0.1.1] on host [192.168.1.161]
INFO[0037] [worker] Pulling image [rancher/rke-nginx-proxy:v0.1.1] on host [192.168.1.162]
INFO[0037] [sidekick] Sidekick container already created on host [192.168.1.160]
INFO[0037] [worker] Successfully started [kubelet] container on host [192.168.1.160]
INFO[0037] [healthcheck] Start Healthcheck on service [kubelet] on host [192.168.1.160]
INFO[0042] [healthcheck] service [kubelet] on host [192.168.1.160] is healthy
INFO[0043] [worker] Successfully started [rke-log-linker] container on host [192.168.1.160]
INFO[0043] [remove/rke-log-linker] Successfully removed container on host [192.168.1.160]
INFO[0043] [worker] Successfully started [kube-proxy] container on host [192.168.1.160]
INFO[0043] [healthcheck] Start Healthcheck on service [kube-proxy] on host [192.168.1.160]
INFO[0049] [healthcheck] service [kube-proxy] on host [192.168.1.160] is healthy
INFO[0049] [worker] Successfully started [rke-log-linker] container on host [192.168.1.160]
INFO[0049] [remove/rke-log-linker] Successfully removed container on host [192.168.1.160]
INFO[0085] [worker] Successfully pulled image [rancher/rke-nginx-proxy:v0.1.1] on host [192.168.1.161]
INFO[0085] [worker] Successfully pulled image [rancher/rke-nginx-proxy:v0.1.1] on host [192.168.1.162]
INFO[0086] [worker] Successfully started [nginx-proxy] container on host [192.168.1.162]
INFO[0086] [worker] Successfully started [nginx-proxy] container on host [192.168.1.161]
INFO[0086] [worker] Successfully started [rke-log-linker] container on host [192.168.1.162]
INFO[0086] [worker] Successfully started [rke-log-linker] container on host [192.168.1.161]
INFO[0086] [remove/rke-log-linker] Successfully removed container on host [192.168.1.162]
INFO[0086] [remove/rke-log-linker] Successfully removed container on host [192.168.1.161]
INFO[0087] [worker] Successfully started [kubelet] container on host [192.168.1.162]
INFO[0087] [healthcheck] Start Healthcheck on service [kubelet] on host [192.168.1.162]
INFO[0087] [worker] Successfully started [kubelet] container on host [192.168.1.161]
INFO[0087] [healthcheck] Start Healthcheck on service [kubelet] on host [192.168.1.161]
INFO[0092] [healthcheck] service [kubelet] on host [192.168.1.162] is healthy
INFO[0092] [healthcheck] service [kubelet] on host [192.168.1.161] is healthy
INFO[0093] [worker] Successfully started [rke-log-linker] container on host [192.168.1.162]
INFO[0093] [worker] Successfully started [rke-log-linker] container on host [192.168.1.161]
INFO[0093] [remove/rke-log-linker] Successfully removed container on host [192.168.1.161]
INFO[0093] [remove/rke-log-linker] Successfully removed container on host [192.168.1.162]
INFO[0093] [worker] Successfully started [kube-proxy] container on host [192.168.1.162]
INFO[0093] [healthcheck] Start Healthcheck on service [kube-proxy] on host [192.168.1.162]
INFO[0093] [worker] Successfully started [kube-proxy] container on host [192.168.1.161]
INFO[0093] [healthcheck] Start Healthcheck on service [kube-proxy] on host [192.168.1.161]
INFO[0099] [healthcheck] service [kube-proxy] on host [192.168.1.162] is healthy
INFO[0099] [healthcheck] service [kube-proxy] on host [192.168.1.161] is healthy
INFO[0099] [worker] Successfully started [rke-log-linker] container on host [192.168.1.162]
INFO[0099] [worker] Successfully started [rke-log-linker] container on host [192.168.1.161]
INFO[0099] [remove/rke-log-linker] Successfully removed container on host [192.168.1.161]
INFO[0099] [remove/rke-log-linker] Successfully removed container on host [192.168.1.162]
INFO[0099] [worker] Successfully started Worker Plane..
INFO[0099] [sync] Syncing nodes Labels and Taints
INFO[0110] [sync] Successfully synced nodes Labels and Taints
INFO[0110] [network] Setting up network plugin: flannel
INFO[0110] [addons] Saving addon ConfigMap to Kubernetes
INFO[0110] [addons] Successfully Saved addon to Kubernetes ConfigMap: rke-network-plugin
INFO[0110] [addons] Executing deploy job..
INFO[0115] [addons] Setting up KubeDNS
INFO[0115] [addons] Saving addon ConfigMap to Kubernetes
INFO[0115] [addons] Successfully Saved addon to Kubernetes ConfigMap: rke-kubedns-addon
INFO[0115] [addons] Executing deploy job..
INFO[0120] [addons] KubeDNS deployed successfully..
INFO[0120] [ingress] Setting up nginx ingress controller
INFO[0120] [addons] Saving addon ConfigMap to Kubernetes
INFO[0120] [addons] Successfully Saved addon to Kubernetes ConfigMap: rke-ingress-controller
INFO[0120] [addons] Executing deploy job..
INFO[0135] [ingress] ingress controller nginx is successfully deployed
INFO[0135] [addons] Setting up user addons
INFO[0135] [addons] no user addons defined
INFO[0135] Finished building Kubernetes cluster successfully
ubuntu@openstack:~/Downloads$ ./kubectl --kubeconfig kube_config_cluster.yml get nodes
NAME STATUS ROLES AGE VERSION
kubernetes1 Ready controlplane,etcd 2m v1.8.10-rancher1
kubernetes2 Ready worker 1m v1.8.10-rancher1
kubernetes3 Ready worker 1m v1.8.10-rancher1
ubuntu@openstack:~/Downloads$
No comments:
Post a Comment