rke Full

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

Full 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
./rke_linux-amd64 config
[+] Cluster Level SSH Private Key Path [~/.ssh/id_rsa]:
[+] Number of Hosts [1]: 3
[+] SSH Address of host (1) [none]: 206.189.134.90
[+] SSH Port of host (1) [22]:
[+] SSH Private Key Path of host (206.189.134.90) [none]: ~/.ssh/id_rsa
[+] SSH User of host (206.189.134.90) [ubuntu]: root
[+] Is host (206.189.134.90) a control host (y/n)? [y]: y
[+] Is host (206.189.134.90) a worker host (y/n)? [n]: y
[+] Is host (206.189.134.90) an Etcd host (y/n)? [n]: y
[+] Override Hostname of host (206.189.134.90) [none]:
[+] Internal IP of host (206.189.134.90) [none]:
[+] Docker socket path on host (206.189.134.90) [/var/run/docker.sock]:
[+] SSH Address of host (2) [none]: 206.189.134.91
[+] SSH Port of host (2) [22]:
[+] SSH Private Key Path of host (206.189.134.91) [none]: ~/.ssh/id_rsa
[+] SSH User of host (206.189.134.91) [ubuntu]: root
[+] Is host (206.189.134.91) a control host (y/n)? [y]: y
[+] Is host (206.189.134.91) a worker host (y/n)? [n]: y
[+] Is host (206.189.134.91) an Etcd host (y/n)? [n]: y
[+] Override Hostname of host (206.189.134.91) [none]:
[+] Internal IP of host (206.189.134.91) [none]:
[+] Docker socket path on host (206.189.134.91) [/var/run/docker.sock]:
[+] SSH Address of host (3) [none]: 206.189.134.92
[+] SSH Port of host (3) [22]:
[+] SSH Private Key Path of host (206.189.134.92) [none]: ~/.ssh/id_rsa
[+] SSH User of host (206.189.134.92) [ubuntu]: root
[+] Is host (206.189.134.92) a control host (y/n)? [y]: y
[+] Is host (206.189.134.92) a worker host (y/n)? [n]: y
[+] Is host (206.189.134.92) an Etcd host (y/n)? [n]: y
[+] Override Hostname of host (206.189.134.92) [none]:
[+] Internal IP of host (206.189.134.92) [none]:
[+] Docker socket path on host (206.189.134.92) [/var/run/docker.sock]:
[+] Network Plugin Type (flannel, calico, weave, canal) [canal]:
[+] Authentication Strategy [x509]:
[+] Authorization Mode (rbac, none) [rbac]:
[+] Etcd Docker Image [rancher/coreos-etcd:v3.1.12]:
[+] Kubernetes Docker image [rancher/hyperkube:v1.10.1-rancher2]:
[+] 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.1]:
[+] Add addon manifest urls or yaml files [no]:
cat cluster.yml
# If you intened to deploy Kubernetes in an air-gapped environment,
# please consult the documentation on how to configure custom RKE images.
nodes:
- address: 206.189.134.90
  port: "22"
  internal_address: ""
  role:
  - controlplane
  - worker
  - etcd
  hostname_override: ""
  user: root
  docker_socket: /var/run/docker.sock
  ssh_key: ""
  ssh_key_path: ~/.ssh/id_rsa
  labels: {}
- address: 206.189.134.91
  port: "22"
  internal_address: ""
  role:
  - controlplane
  - worker
  - etcd
  hostname_override: ""
  user: root
  docker_socket: /var/run/docker.sock
  ssh_key: ""
  ssh_key_path: ~/.ssh/id_rsa
  labels: {}
- address: 206.189.134.92
  port: "22"
  internal_address: ""
  role:
  - controlplane
  - worker
  - etcd
  hostname_override: ""
  user: root
  docker_socket: /var/run/docker.sock
  ssh_key: ""
  ssh_key_path: ~/.ssh/id_rsa
  labels: {}
services:
  etcd:
    image: rancher/coreos-etcd:v3.1.12
    extra_args: {}
    extra_binds: []
    external_urls: []
    ca_cert: ""
    cert: ""
    key: ""
    path: ""
    snapshot: false
    retention: ""
    creation: ""
  kube-api:
    image: rancher/hyperkube:v1.10.1-rancher2
    extra_args: {}
    extra_binds: []
    service_cluster_ip_range: 10.43.0.0/16
    pod_security_policy: false
  kube-controller:
    image: rancher/hyperkube:v1.10.1-rancher2
    extra_args: {}
    extra_binds: []
    cluster_cidr: 10.42.0.0/16
    service_cluster_ip_range: 10.43.0.0/16
  scheduler:
    image: rancher/hyperkube:v1.10.1-rancher2
    extra_args: {}
    extra_binds: []
  kubelet:
    image: rancher/hyperkube:v1.10.1-rancher2
    extra_args: {}
    extra_binds: []
    cluster_domain: cluster.local
    infra_container_image: rancher/pause-amd64:3.1
    cluster_dns_server: 10.43.0.10
    fail_swap_on: false
  kubeproxy:
    image: rancher/hyperkube:v1.10.1-rancher2
    extra_args: {}
    extra_binds: []
network:
  plugin: canal
  options: {}
authentication:
  strategy: x509
  options: {}
  sans: []
addons: ""
addons_include: []
system_images:
  etcd: ""
  alpine: ""
  nginx_proxy: ""
  cert_downloader: ""
  kubernetes_services_sidecar: ""
  kubedns: ""
  dnsmasq: ""
  kubedns_sidecar: ""
  kubedns_autoscaler: ""
  kubernetes: ""
  flannel: ""
  flannel_cni: ""
  calico_node: ""
  calico_cni: ""
  calico_controllers: ""
  calico_ctl: ""
  canal_node: ""
  canal_cni: ""
  canal_flannel: ""
  wave_node: ""
  weave_cni: ""
  pod_infra_container: ""
  ingress: ""
  ingress_backend: ""
ssh_key_path: ~/.ssh/id_rsa
ssh_agent_auth: false
authorization:
  mode: rbac
  options: {}
ignore_docker_version: false
kubernetes_version: ""
private_registries: []
ingress:
  provider: ""
  options: {}
  node_selector: {}
  extra_args: {}
cluster_name: ""
cloud_provider:
  name: ""
  cloud_config: {}
prefix_path: ""
addon_job_timeout: 0
bastion_host:
  address: ""
  port: ""
  user: ""
  ssh_key: ""
  ssh_key_path: ""
./rke_linux-amd64 up

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
206.189.134.90   Ready     controlplane,etcd,worker   4m        v1.10.1
206.189.134.91   Ready     controlplane,etcd,worker   4m        v1.10.1
206.189.134.92   Ready     controlplane,etcd,worker   4m        v1.10.1

results matching ""

    No results matching ""