You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.4 KiB

  1. Vagrant Install
  2. =================
  3. Assuming you have Vagrant (2.0+) installed with virtualbox (it may work
  4. with vmware, but is untested) you should be able to launch a 3 node
  5. Kubernetes cluster by simply running `$ vagrant up`.<br />
  6. This will spin up 3 VMs and install kubernetes on them. Once they are
  7. completed you can connect to any of them by running <br />
  8. `$ vagrant ssh k8s-0[1..3]`.
  9. ```
  10. $ vagrant up
  11. Bringing machine 'k8s-01' up with 'virtualbox' provider...
  12. Bringing machine 'k8s-02' up with 'virtualbox' provider...
  13. Bringing machine 'k8s-03' up with 'virtualbox' provider...
  14. ==> k8s-01: Box 'bento/ubuntu-14.04' could not be found. Attempting to find and install...
  15. ...
  16. ...
  17. k8s-03: Running ansible-playbook...
  18. PLAY [k8s-cluster] *************************************************************
  19. TASK [setup] *******************************************************************
  20. ok: [k8s-03]
  21. ok: [k8s-01]
  22. ok: [k8s-02]
  23. ...
  24. ...
  25. PLAY RECAP *********************************************************************
  26. k8s-01 : ok=157 changed=66 unreachable=0 failed=0
  27. k8s-02 : ok=137 changed=59 unreachable=0 failed=0
  28. k8s-03 : ok=86 changed=51 unreachable=0 failed=0
  29. $ vagrant ssh k8s-01
  30. vagrant@k8s-01:~$ kubectl get nodes
  31. NAME STATUS AGE
  32. k8s-01 Ready 45s
  33. k8s-02 Ready 45s
  34. k8s-03 Ready 45s
  35. ```
  36. Customize Vagrant
  37. =================
  38. You can override the default settings in the `Vagrantfile` either by directly modifying the `Vagrantfile`
  39. or through an override file.
  40. In the same directory as the `Vagrantfile`, create a folder called `vagrant` and create `config.rb` file in it.
  41. You're able to override the variables defined in `Vagrantfile` by providing the value in the `vagrant/config.rb` file,
  42. e.g.:
  43. echo '$forwarded_ports = {8001 => 8001}' >> vagrant/config.rb
  44. and after `vagrant up` or `vagrant reload`, your host will have port forwarding setup with the guest on port 8001.
  45. Use alternative OS for Vagrant
  46. ==============================
  47. By default, Vagrant uses Ubuntu 16.04 box to provision a local cluster. You may use an alternative supported
  48. operating system for your local cluster.
  49. Customize `$os` variable in `Vagrantfile` or as override, e.g.,:
  50. echo '$os = "coreos-stable"' >> vagrant/config.rb
  51. The supported operating systems for vagrant are defined in the `SUPPORTED_OS` constant in the `Vagrantfile`.