Here is how to install Kubernetes on the computers at 42.
If you do not have brew installed, install it with:
rm -rf $HOME/.brew && git clone --depth=1 https://github.com/Homebrew/brew $HOME/.brew && \
echo 'export PATH=$HOME/.brew/bin:$PATH' >> $HOME/.zshrc && \
source $HOME/.zshrc && \
brew update
Note: this modifies your ~/.zshrc
Minikube is what you will use to manage your cluster. It will launch a virtual machine and run a master node and a worker node.
brew install minikube
Minikube will use a lot of disk space and resources, so you won't be able
to start it in your home partition. We will make it launch in /goinfre
.
Minikube will create its virtual machine on ~/.minikube
so you just have to
create a symbolic link, so that ~/.minikube
points to /goinfre/(your-username)/.minikube
mkdir /goinfre/$USER
mkdir /goinfre/$USER/.minikube
ln -s /goinfre/$USER/.minikube ~/.minikube
There you go! You have installed minikube on your computer. You can now use
minikube start --vm-driver=virtualbox
to start your cluster!
Note: /goinfre
is not a network patition; meaning anything installed on a computer
will stay on this computer.
You should also add these lines in your ~/.zshrc
:
[ -d /goinfre/$USER ] || mkdir /goinfre/$USER
[ -d /goinfre/$USER/.minikube ] || mkdir /goinfre/$USER/.minikube
These lines will automatically create the directories needed to run minikube on any computer.
If you are currently doing ft_services
, there will be a point at which your cluster runs out of
resources because of how many services the subject wants you to run.
You can give more resources to the virtual machine when starting the cluster:
minikube start --vm-driver=virtualbox --cpus 3 --memory=3000mb