Tanker is a small project with the purpose of running in a local kubernetes cluster provided by minikube your dockerized test-applications without suffering to configuring or setting up your environment.
The idea behind it is: place your k8s *yamls into k8s-apps/${YOUR-APP}/
and be happy! :D
The following diagram makes a little more clean the interaction between internal and external clients with the application it self + k8s-cluster
Make sure that your machine follows the requisites:
- Linux Mint 18.3 - Sylvia (100% working scenario for a fresh installation)
- 4 GB or more of free RAM (it needs to handle the virtualization and k8s-apps as well)
- 2 CPUs or more
- Network connection
Ensure that you have docker
both client and version 1.13.x
or superior
To run the app, just:
./tanker
It will run a kubernetes cluster under virtualbox driver and exposes the URL to be tested locally from a demonstration Wordpress application.
The first execution can take some time due to the virtual machine creation.
You don't have to stick to the default 'wordpress' example project, to deploy your own kubernetes' applications follow these steps:
- create a dir located at
k8s-apps/
with the needed *.yamls - add your app the list of apps (
KUBE_APPS
) located atconfig/environment.sh
- run
./tanker
to create the new app
Tanker will not give to you the exposed URL because it can vary due to specific configuration for you services. To check by yourself:
minikube service ${MY_SERVICE_NAME} --url
By the default, the kubernetes dashboard will be exposed to the host as localhost:3000
to simplify the usage. To disable this option just set EXPOSE_DASHBOARD
environment variable as false at config/environment.sh
It's highly recommended that you do not use tanker in production environments. The purpose of this project is to setup a development environment the quickest way possible. After that the deployment of your POC must be done with a secure Kubernetes Cluster using one of the following tools: kops
, kubeadm
or similar
In order to run the app and follow line by line what happened, just set the environment variable DEBUG
located at config/environment.sh
as true. The next ./tanker
will output what is going on under the hood
To wipe every minikube data due any additional problems when creating/running the cluster you can:
$ minikube stop # if started
$ minikube delete
$ rm -rf ~/.minikube
Then you can ask ./tanker
to create it again
The minikube driver (for virtual machines) kvm
have multiple settings for several different distributions which could be impractical to maintain. Using the 'virtualbox' one instead can add one more level of flexibility in the future when tanker
became "runnable" to multiple Linux distributions.
You must be wondering why the project just not use kubeadm
to install a real cluster instead of a virtual one using minikube
. The kubeadm
may need some additional intrusive configurations such as kernel configurations and network changes which could break any other part of the system if used in a dev machine instead of a server. To keep it simple, the minikube
handles the situation.
The project is still under development, and it needs to handle a few things for the future:
- We are working with the possibility to run the app in a
sandbox-mode
, which is basically run it in a specific VM using Vagrant