The project will run some bash script under the VirtualMachines. These scripts line ending need to be in LF. Git for windows set core.autocrlf true by default at the installation time. When you clone this project repository, this parameter (set to true) ask git to change all line ending to CRLF. This behavior need to be changed before cloning the repository (or after for each files by hand). We recommand to turn this to off by running git config --global core.autocrlf false and git config --global core.eol lf before cloning. Then, after cloning, do not forget to turn the behavior back if you want to run other windows projects: git config --global core.autocrlf true and git config --global core.eol crlf.
Deploy Kubernetes
Current Vagrantfile will bootstrap one VM with everything needed to become a Kubernetes master and, by default, a couple VMs with everything needed to become Kubernetes worker nodes.
You can change the number of worker nodes and/or the Kubernetes version by setting environment variables NODES and KUBERNETES_VERSION, respectively. You can find more details below.
vagrant up
Linux or MacOS host
Kubernetes cluster is ready. Use kubectl to manage it.
Windows host
On Windows systems, kubectl is installed on the master node, in the /opt/bin directory. To manage your Kubernetes cluster, ssh into the master node and run kubectl from there.
vagrant ssh master
kubectl cluster-info
Clean-up
vagrant destroy
If you've set NODES or any other variable when deploying, please make sure you set it in vagrant destroy call above, like:
NODES=3 vagrant destroy -f
Notes about hypervisors
Virtualbox
VirtualBox is the default hypervisor, and you'll probably need to disable its DHCP server
If you are using Parallels Desktop, you need to install vagrant-parallels provider
vagrant plugin install vagrant-parallels
Then just add --provider parallels to the vagrant up invocations above.
VMware
If you are using one of the VMware hypervisors you must buy the matching provider and, depending on your case, just add either --provider vmware_fusion or --provider vmware_workstation to the vagrant up invocations above.
Private Docker Repositories
If you want to use Docker private repositories look for DOCKERCFG bellow.
Customization
Environment variables
Most aspects of your cluster setup can be customized with environment variables. Right now the available ones are:
HTTP_PROXY sets http proxy address.
Defaults to $HTTP_PROXY of host machine if it exists.
You need customing this proxy setting on VMs when you have to face gfw with tools like shadowsocks, privoxy on host machine, because Vagrantfile uses proxy setting on host machine default,this setting might be not right to VMs, it would lead to internet disconnection of VMs. If you have the problem, you can refer to https://www.linuxbabe.com/virtualbox/how-to-access-host-services-from-a-virtualbox-guest-os for customing this setting.
HTTPS_PROXY
like HTTP_PROXY
NO_PROXY
like HTTP_PROXY
NODES sets the number of nodes (workers).
Defaults to 2.
CHANNEL sets the default CoreOS channel to be used in the VMs.
Defaults to alpha.
While by convenience, we allow an user to optionally consume CoreOS' beta or stable channels please do note that as both Kubernetes and CoreOS are quickly evolving platforms we only expect our setup to behave reliably on top of CoreOS' alpha channel.
So, before submitting a bug, either in this project, or in (Kubernetes or CoreOS) make sure it (also) happens in the (default) alpha channel
请发表评论