Mesos Framework to run Kubernetes (K3S)
To open an issue, please use this place: https://github.com/m3scluster/m3s/issues
- Apache Mesos min 1.6.0
- Mesos with SSL and Authentication is optional
- Persistent Storage to keep K3S data (not object storage)
- Redis DB
The following environment parameters are only a example. All parameters and the default values are documented in
the init.go
file (real documentation will be coming later). These example assume, that we run mesos-mini.
Run a redis server:
docker run --rm --name redis -d -p 6379:6379 redis
M3s needs some parameters to connect to Mesos. The following serve only as an example.
export MESOS_SSL=false
export DOCKER_CNI=mini
export LOGLEVEL=DEBUG
export AUTH_USERNAME=user
export AUTH_PASSWORD=password
export VOLUME_K3S_SERVER=local_k3sserver
export K3S_TOKEN=df54383b5659b9280aa1e73e60ef78fc
export DOMAIN=.mini
export BOOTSTRAP_URL=https://raw.githubusercontent.com/AVENTER-UG/mesos-m3s/master/bootstrap/bootstrap.sh
export K3S_AGENT_LABELS=[{"key":"traefik.enable","value":"true"},{"key":"traefik.http.routers.m3s.entrypoints","value":"web"},{"key":"traefik.http.routers.m3s.service","value":"m3s-http"},{"key":"traefik.http.routers.m3s.rule","value":"HostRegexp(`example.com`, `{subdomain:[a-z]+}.example.com`)"}]
The variable K3S_AGENT_LABELS gives the possibility to create labels for Traefik or other load balancers connected to mesos. In the example given here are labels for our Traefik Provider.
Before we launch M3s, we create in Docker in dedicated network.
docker network create --subnet 10.40.0.0/24 mini
Now M3s can be started:
./mesos-m3s
In real mesos environments, we have to set at least the following environment variables:
export MESOS_MASTER="leader.mesos:5050"
export MESOS_USERNAME=""
export MESOS_PASSWORD=""
Also the following could be usefull.
export REDIS_SERVER="127.0.0.1:6379"
export REDIS_PASSWORD=""
export REDIS_DB="1"
export MESOS_CNI="weave"
kubectl -n kubernetes-dashboard describe secret admin-user-token | grep '^token'
kubectl proxy
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services
kubectl port-forward $(kubectl get pods --selector "app.kubernetes.io/name=traefik" --output=name -n kube-system) -n kube-system 9000:9000