rke Minimal
Rancher Kubernetes Engine, an extremely simple, lightning fast Kubernetes installer that works everywhere.
Installation
Install docker on all nodes using Ansible
sudo apt-get update
sudo apt-get install software-properties-common -y
sudo apt-add-repository ppa:ansible/ansible -y
sudo apt-get update -y
sudo apt-get install ansible -y
cat << EOF > ~/.ansible.cfg
[defaults]
host_key_checking = False
EOF
echo '
[all:vars]
ansible_connection=ssh
ansible_port=22
ansible_ssh_user=hadoop
ansible_ssh_pass=Bigd4t4
[k8s]
206.189.134.90
206.189.134.91
206.189.134.92' | sudo tee -a /etc/ansible/hosts
ansible all -m shell -a 'sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y'
ansible all -m shell -a 'curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -'
ansible all -m shell -a 'sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"'
ansible all -m shell -a 'sudo apt-get update -y'
ansible all -m shell -a 'sudo apt-get install docker-ce=17.03.2~ce-0~ubuntu-xenial -y'
wget https://www.dropbox.com/s/foeheideuycjld2/rke_linux-amd64
chmod +x rke_linux-amd64
./rke_linux-amd64 --version
rke version v0.1.7
Minimal cluster.yml example
Copy ssh private key to Mac clipboard
pbcopy < ~/.ssh/id_rsa
Paste key to id_rsa
vim /home/hadoop/.ssh/id_rsa
...
chmod 400 /home/hadoop/.ssh/id_rsa
cat << EOF > cluster.yml
nodes:
- address: 159.89.166.169
user: root
role: [controlplane,worker,etcd]
ssh_key_path: /home/hadoop/.ssh/id_rsa
- address: 159.89.169.179
user: root
role: [controlplane,worker,etcd]
ssh_key_path: /home/hadoop/.ssh/id_rsa
- address: 139.59.74.76
user: root
role: [controlplane,worker,etcd]
ssh_key_path: /home/hadoop/.ssh/id_rsa
EOF
Create cluster
./rke_linux-amd64 up --config cluster.yml
INFO[0000] Building Kubernetes cluster
INFO[0000] [dialer] Setup tunnel for host [159.89.166.169]
INFO[0000] [dialer] Setup tunnel for host [159.89.169.179]
INFO[0000] [dialer] Setup tunnel for host [139.59.74.76]
INFO[0000] [network] Deploying port listener containers
INFO[0000] [network] Pulling image [rancher/rke-tools:v0.1.8] on host [159.89.169.179]
INFO[0000] [network] Pulling image [rancher/rke-tools:v0.1.8] on host [159.89.166.169]
INFO[0000] [network] Pulling image [rancher/rke-tools:v0.1.8] on host [139.59.74.76]
INFO[0009] [network] Successfully pulled image [rancher/rke-tools:v0.1.8] on host [159.89.166.169]
INFO[0009] [network] Successfully started [rke-etcd-port-listener] container on host [159.89.166.169]
INFO[0009] [network] Successfully pulled image [rancher/rke-tools:v0.1.8] on host [159.89.169.179]
INFO[0010] [network] Successfully started [rke-etcd-port-listener] container on host [159.89.169.179]
INFO[0010] [network] Successfully pulled image [rancher/rke-tools:v0.1.8] on host [139.59.74.76]
INFO[0010] [network] Successfully started [rke-etcd-port-listener] container on host [139.59.74.76]
INFO[0011] [network] Successfully started [rke-cp-port-listener] container on host [159.89.169.179]
INFO[0011] [network] Successfully started [rke-cp-port-listener] container on host [159.89.166.169]
INFO[0011] [network] Successfully started [rke-cp-port-listener] container on host [139.59.74.76]
INFO[0011] [network] Successfully started [rke-worker-port-listener] container on host [159.89.166.169]
INFO[0011] [network] Successfully started [rke-worker-port-listener] container on host [159.89.169.179]
INFO[0011] [network] Successfully started [rke-worker-port-listener] container on host [139.59.74.76]
INFO[0011] [network] Port listener containers deployed successfully
INFO[0011] [network] Running etcd <-> etcd port checks
INFO[0011] [network] Successfully started [rke-port-checker] container on host [159.89.166.169]
INFO[0011] [network] Successfully started [rke-port-checker] container on host [159.89.169.179]
INFO[0011] [network] Successfully started [rke-port-checker] container on host [139.59.74.76]
INFO[0012] [network] Running control plane -> etcd port checks
INFO[0012] [network] Successfully started [rke-port-checker] container on host [159.89.169.179]
INFO[0012] [network] Successfully started [rke-port-checker] container on host [159.89.166.169]
INFO[0012] [network] Successfully started [rke-port-checker] container on host [139.59.74.76]
INFO[0012] [network] Running control plane -> worker port checks
INFO[0012] [network] Successfully started [rke-port-checker] container on host [159.89.169.179]
INFO[0012] [network] Successfully started [rke-port-checker] container on host [159.89.166.169]
INFO[0012] [network] Successfully started [rke-port-checker] container on host [139.59.74.76]
INFO[0012] [network] Running workers -> control plane port checks
INFO[0013] [network] Successfully started [rke-port-checker] container on host [159.89.169.179]
INFO[0013] [network] Successfully started [rke-port-checker] container on host [159.89.166.169]
INFO[0013] [network] Successfully started [rke-port-checker] container on host [139.59.74.76]
INFO[0013] [network] Checking KubeAPI port Control Plane hosts
INFO[0013] [network] Removing port listener containers
INFO[0013] [remove/rke-etcd-port-listener] Successfully removed container on host [159.89.166.169]
INFO[0013] [remove/rke-etcd-port-listener] Successfully removed container on host [159.89.169.179]
INFO[0013] [remove/rke-etcd-port-listener] Successfully removed container on host [139.59.74.76]
INFO[0013] [remove/rke-cp-port-listener] Successfully removed container on host [159.89.166.169]
INFO[0013] [remove/rke-cp-port-listener] Successfully removed container on host [159.89.169.179]
INFO[0013] [remove/rke-cp-port-listener] Successfully removed container on host [139.59.74.76]
INFO[0013] [remove/rke-worker-port-listener] Successfully removed container on host [159.89.166.169]
INFO[0013] [remove/rke-worker-port-listener] Successfully removed container on host [159.89.169.179]
INFO[0013] [remove/rke-worker-port-listener] Successfully removed container on host [139.59.74.76]
INFO[0013] [network] Port listener containers removed successfully
INFO[0013] [certificates] Attempting to recover certificates from backup on [etcd,controlPlane] hosts
INFO[0014] [certificates] Successfully started [cert-fetcher] container on host [159.89.166.169]
INFO[0014] [certificates] Successfully started [cert-fetcher] container on host [159.89.169.179]
INFO[0014] [certificates] Successfully started [cert-fetcher] container on host [139.59.74.76]
INFO[0014] [certificates] No Certificate backup found on [etcd,controlPlane] hosts
INFO[0014] [certificates] Generating CA kubernetes certificates
INFO[0015] [certificates] Generating Kubernetes API server certificates
INFO[0015] [certificates] Generating Kube Controller certificates
INFO[0015] [certificates] Generating Kube Scheduler certificates
INFO[0015] [certificates] Generating Kube Proxy certificates
INFO[0015] [certificates] Generating Node certificate
INFO[0016] [certificates] Generating admin certificates and kubeconfig
INFO[0016] [certificates] Generating etcd-159.89.166.169 certificate and key
INFO[0016] [certificates] Generating etcd-159.89.169.179 certificate and key
INFO[0016] [certificates] Generating etcd-139.59.74.76 certificate and key
INFO[0016] [certificates] Temporarily saving certs to [etcd,controlPlane] hosts
INFO[0022] [certificates] Saved certs to [etcd,controlPlane] hosts
INFO[0022] [reconcile] Reconciling cluster state
INFO[0022] [reconcile] This is newly generated cluster
INFO[0022] [certificates] Deploying kubernetes certificates to Cluster nodes
INFO[0027] Successfully Deployed local admin kubeconfig at [./kube_config_cluster.yml]
INFO[0027] [certificates] Successfully deployed kubernetes certificates to Cluster nodes
INFO[0027] Pre-pulling kubernetes images
INFO[0027] [pre-deploy] Pulling image [rancher/hyperkube:v1.10.1-rancher2] on host [159.89.169.179]
INFO[0027] [pre-deploy] Pulling image [rancher/hyperkube:v1.10.1-rancher2] on host [159.89.166.169]
INFO[0027] [pre-deploy] Pulling image [rancher/hyperkube:v1.10.1-rancher2] on host [139.59.74.76]
INFO[0051] [pre-deploy] Successfully pulled image [rancher/hyperkube:v1.10.1-rancher2] on host [159.89.169.179]
INFO[0054] [pre-deploy] Successfully pulled image [rancher/hyperkube:v1.10.1-rancher2] on host [159.89.166.169]
INFO[0069] [pre-deploy] Successfully pulled image [rancher/hyperkube:v1.10.1-rancher2] on host [139.59.74.76]
INFO[0069] Kubernetes images pulled successfully
INFO[0069] [etcd] Building up etcd plane..
INFO[0069] [etcd] Pulling image [rancher/coreos-etcd:v3.1.12] on host [159.89.166.169]
INFO[0078] [etcd] Successfully pulled image [rancher/coreos-etcd:v3.1.12] on host [159.89.166.169]
INFO[0078] [etcd] Successfully started [etcd] container on host [159.89.166.169]
INFO[0079] [etcd] Successfully started [rke-log-linker] container on host [159.89.166.169]
INFO[0079] [remove/rke-log-linker] Successfully removed container on host [159.89.166.169]
INFO[0079] [etcd] Pulling image [rancher/coreos-etcd:v3.1.12] on host [159.89.169.179]
INFO[0086] [etcd] Successfully pulled image [rancher/coreos-etcd:v3.1.12] on host [159.89.169.179]
INFO[0086] [etcd] Successfully started [etcd] container on host [159.89.169.179]
INFO[0086] [etcd] Successfully started [rke-log-linker] container on host [159.89.169.179]
INFO[0086] [remove/rke-log-linker] Successfully removed container on host [159.89.169.179]
INFO[0086] [etcd] Pulling image [rancher/coreos-etcd:v3.1.12] on host [139.59.74.76]
INFO[0092] [etcd] Successfully pulled image [rancher/coreos-etcd:v3.1.12] on host [139.59.74.76]
INFO[0093] [etcd] Successfully started [etcd] container on host [139.59.74.76]
INFO[0093] [etcd] Successfully started [rke-log-linker] container on host [139.59.74.76]
INFO[0093] [remove/rke-log-linker] Successfully removed container on host [139.59.74.76]
INFO[0093] [etcd] Successfully started etcd plane..
INFO[0093] [controlplane] Building up Controller Plane..
INFO[0093] [controlplane] Successfully started [kube-apiserver] container on host [159.89.169.179]
INFO[0093] [healthcheck] Start Healthcheck on service [kube-apiserver] on host [159.89.169.179]
INFO[0093] [controlplane] Successfully started [kube-apiserver] container on host [159.89.166.169]
INFO[0093] [healthcheck] Start Healthcheck on service [kube-apiserver] on host [159.89.166.169]
INFO[0094] [controlplane] Successfully started [kube-apiserver] container on host [139.59.74.76]
INFO[0094] [healthcheck] Start Healthcheck on service [kube-apiserver] on host [139.59.74.76]
INFO[0104] [healthcheck] service [kube-apiserver] on host [159.89.169.179] is healthy
INFO[0104] [healthcheck] service [kube-apiserver] on host [159.89.166.169] is healthy
INFO[0104] [controlplane] Successfully started [rke-log-linker] container on host [159.89.169.179]
INFO[0104] [controlplane] Successfully started [rke-log-linker] container on host [159.89.166.169]
INFO[0104] [remove/rke-log-linker] Successfully removed container on host [159.89.169.179]
INFO[0104] [remove/rke-log-linker] Successfully removed container on host [159.89.166.169]
INFO[0104] [controlplane] Successfully started [kube-controller-manager] container on host [159.89.169.179]
INFO[0104] [healthcheck] Start Healthcheck on service [kube-controller-manager] on host [159.89.169.179]
INFO[0104] [controlplane] Successfully started [kube-controller-manager] container on host [159.89.166.169]
INFO[0104] [healthcheck] Start Healthcheck on service [kube-controller-manager] on host [159.89.166.169]
INFO[0108] [healthcheck] service [kube-apiserver] on host [139.59.74.76] is healthy
INFO[0108] [controlplane] Successfully started [rke-log-linker] container on host [139.59.74.76]
INFO[0109] [remove/rke-log-linker] Successfully removed container on host [139.59.74.76]
INFO[0109] [controlplane] Successfully started [kube-controller-manager] container on host [139.59.74.76]
INFO[0109] [healthcheck] Start Healthcheck on service [kube-controller-manager] on host [139.59.74.76]
INFO[0109] [healthcheck] service [kube-controller-manager] on host [159.89.169.179] is healthy
INFO[0109] [healthcheck] service [kube-controller-manager] on host [159.89.166.169] is healthy
INFO[0110] [controlplane] Successfully started [rke-log-linker] container on host [159.89.169.179]
INFO[0110] [controlplane] Successfully started [rke-log-linker] container on host [159.89.166.169]
INFO[0110] [remove/rke-log-linker] Successfully removed container on host [159.89.169.179]
INFO[0110] [remove/rke-log-linker] Successfully removed container on host [159.89.166.169]
INFO[0110] [controlplane] Successfully started [kube-scheduler] container on host [159.89.169.179]
INFO[0110] [healthcheck] Start Healthcheck on service [kube-scheduler] on host [159.89.169.179]
INFO[0110] [controlplane] Successfully started [kube-scheduler] container on host [159.89.166.169]
INFO[0110] [healthcheck] Start Healthcheck on service [kube-scheduler] on host [159.89.166.169]
INFO[0114] [healthcheck] service [kube-controller-manager] on host [139.59.74.76] is healthy
INFO[0114] [controlplane] Successfully started [rke-log-linker] container on host [139.59.74.76]
INFO[0114] [remove/rke-log-linker] Successfully removed container on host [139.59.74.76]
INFO[0115] [controlplane] Successfully started [kube-scheduler] container on host [139.59.74.76]
INFO[0115] [healthcheck] Start Healthcheck on service [kube-scheduler] on host [139.59.74.76]
INFO[0115] [healthcheck] service [kube-scheduler] on host [159.89.169.179] is healthy
INFO[0115] [healthcheck] service [kube-scheduler] on host [159.89.166.169] is healthy
INFO[0115] [controlplane] Successfully started [rke-log-linker] container on host [159.89.169.179]
INFO[0115] [controlplane] Successfully started [rke-log-linker] container on host [159.89.166.169]
INFO[0115] [remove/rke-log-linker] Successfully removed container on host [159.89.169.179]
INFO[0115] [remove/rke-log-linker] Successfully removed container on host [159.89.166.169]
INFO[0120] [healthcheck] service [kube-scheduler] on host [139.59.74.76] is healthy
INFO[0120] [controlplane] Successfully started [rke-log-linker] container on host [139.59.74.76]
INFO[0120] [remove/rke-log-linker] Successfully removed container on host [139.59.74.76]
INFO[0120] [controlplane] Successfully started Controller Plane..
INFO[0120] [authz] Creating rke-job-deployer ServiceAccount
INFO[0120] [authz] rke-job-deployer ServiceAccount created successfully
INFO[0120] [authz] Creating system:node ClusterRoleBinding
INFO[0120] [authz] system:node ClusterRoleBinding created successfully
INFO[0120] [certificates] Save kubernetes certificates as secrets
INFO[0121] [certificates] Successfully saved certificates as kubernetes secret [k8s-certs]
INFO[0121] [state] Saving cluster state to Kubernetes
INFO[0121] [state] Successfully Saved cluster state to Kubernetes ConfigMap: cluster-state
INFO[0121] [worker] Building up Worker Plane..
INFO[0121] [sidekick] Sidekick container already created on host [159.89.169.179]
INFO[0121] [sidekick] Sidekick container already created on host [159.89.166.169]
INFO[0121] [sidekick] Sidekick container already created on host [139.59.74.76]
INFO[0121] [worker] Successfully started [kubelet] container on host [159.89.169.179]
INFO[0121] [healthcheck] Start Healthcheck on service [kubelet] on host [159.89.169.179]
INFO[0121] [worker] Successfully started [kubelet] container on host [159.89.166.169]
INFO[0121] [healthcheck] Start Healthcheck on service [kubelet] on host [159.89.166.169]
INFO[0121] [worker] Successfully started [kubelet] container on host [139.59.74.76]
INFO[0121] [healthcheck] Start Healthcheck on service [kubelet] on host [139.59.74.76]
INFO[0127] [healthcheck] service [kubelet] on host [159.89.166.169] is healthy
INFO[0127] [healthcheck] service [kubelet] on host [159.89.169.179] is healthy
INFO[0127] [healthcheck] service [kubelet] on host [139.59.74.76] is healthy
INFO[0127] [worker] Successfully started [rke-log-linker] container on host [159.89.169.179]
INFO[0127] [worker] Successfully started [rke-log-linker] container on host [159.89.166.169]
INFO[0127] [worker] Successfully started [rke-log-linker] container on host [139.59.74.76]
INFO[0127] [remove/rke-log-linker] Successfully removed container on host [159.89.169.179]
INFO[0127] [remove/rke-log-linker] Successfully removed container on host [159.89.166.169]
INFO[0127] [worker] Successfully started [kube-proxy] container on host [159.89.169.179]
INFO[0127] [healthcheck] Start Healthcheck on service [kube-proxy] on host [159.89.169.179]
INFO[0127] [worker] Successfully started [kube-proxy] container on host [159.89.166.169]
INFO[0127] [healthcheck] Start Healthcheck on service [kube-proxy] on host [159.89.166.169]
INFO[0127] [remove/rke-log-linker] Successfully removed container on host [139.59.74.76]
INFO[0127] [worker] Successfully started [kube-proxy] container on host [139.59.74.76]
INFO[0127] [healthcheck] Start Healthcheck on service [kube-proxy] on host [139.59.74.76]
INFO[0132] [healthcheck] service [kube-proxy] on host [159.89.169.179] is healthy
INFO[0132] [healthcheck] service [kube-proxy] on host [159.89.166.169] is healthy
INFO[0132] [healthcheck] service [kube-proxy] on host [139.59.74.76] is healthy
INFO[0132] [worker] Successfully started [rke-log-linker] container on host [159.89.169.179]
INFO[0133] [worker] Successfully started [rke-log-linker] container on host [159.89.166.169]
INFO[0133] [remove/rke-log-linker] Successfully removed container on host [159.89.169.179]
INFO[0133] [remove/rke-log-linker] Successfully removed container on host [159.89.166.169]
INFO[0133] [worker] Successfully started [rke-log-linker] container on host [139.59.74.76]
INFO[0133] [remove/rke-log-linker] Successfully removed container on host [139.59.74.76]
INFO[0133] [worker] Successfully started Worker Plane..
INFO[0133] [sync] Syncing nodes Labels and Taints
INFO[0138] [sync] Successfully synced nodes Labels and Taints
INFO[0138] [network] Setting up network plugin: canal
INFO[0138] [addons] Saving addon ConfigMap to Kubernetes
INFO[0138] [addons] Successfully Saved addon to Kubernetes ConfigMap: rke-network-plugin
INFO[0138] [addons] Executing deploy job..
INFO[0148] [addons] Setting up KubeDNS
INFO[0148] [addons] Saving addon ConfigMap to Kubernetes
INFO[0148] [addons] Successfully Saved addon to Kubernetes ConfigMap: rke-kubedns-addon
INFO[0148] [addons] Executing deploy job..
INFO[0153] [addons] KubeDNS deployed successfully..
INFO[0153] [ingress] Setting up nginx ingress controller
INFO[0153] [addons] Saving addon ConfigMap to Kubernetes
INFO[0154] [addons] Successfully Saved addon to Kubernetes ConfigMap: rke-ingress-controller
INFO[0154] [addons] Executing deploy job..
INFO[0159] [ingress] ingress controller nginx is successfully deployed
INFO[0159] [addons] Setting up user addons
INFO[0159] [addons] no user addons defined
INFO[0159] Finished building Kubernetes cluster successfully
Interacting with your cluster
sudo snap install kubectl --classic
mkdir -p ~/.kube
mv kube_config_cluster.yml ~/.kube/config
kubectl version --short
Client Version: v1.10.3
Server Version: v1.10.1
kubectl get nodes
NAME STATUS ROLES AGE VERSION
139.59.74.76 Ready controlplane,etcd,worker 8m v1.10.1
159.89.166.169 Ready controlplane,etcd,worker 8m v1.10.1
159.89.169.179 Ready controlplane,etcd,worker 8m v1.10.1