Configuration

The following environment variables are available:

VariableDefaultDescription
FRAMEWORK_USERrootFramework user used in Apache Mesos
FRAMEWORK_NAMEm3sName of the framework in Apache Mesos but also used as Redis prefix
FRAMEWORK_ROLEm3sFramework role used in Apache Mesos
FRAMEWORK_PORT10000Port these framework is listening
FRAMEWORK_HOSTNAME${HOSTNAME}The frameworks hostname
MESOS_USERNAMEUsername to authenticate against Mesos
MESOS_PASSWORDPassword to authenticate against Mesos
MESOS_MASTER127.0.0.1:5050Adress of the Mesos Master. If you use mesos-dns, use leader.mesos
MESOS_CNIMesos CNI M3s should use
MESOS_SSLfalseEnable SSL for the communication to the Mesos Master
MESOS_PRINCIPALMesos Principal
PORTRANGE_FROM31000Set the portrange, M3s is suposed to use for the container outside of K8
PORTRANGE_TO32000
LOGLEVELinfoInformation Level (info, warn, error, debug)
DOCKER_CNIbrideIf we do not use Mesos CNI, we can also use docker network
DOCKER_SOCKThe docker sock file
DOCKER_SHM_SIZE30gbSize of dockers shared memory
DOMAIN.localThe domain of the hostnames. As example, if you use weave cni, it would be weave.local
AUTH_USERNAMEUsername to authenticate against these framework
AUTH_PASSWORDPassword to authenticate against these framework
K3S_TOKEN123456789K8 token for the bootstrap
K3S_CUSTOM_DOMAINcloud.localThe network Domain we will use for the K3s cni
K3S_SERVER_STRING/usr/local/bin/k3s server --cluster-cidr=10.2.0.0/16 --service-cidr=10.3.0.0/16 --cluster-dns=10.3.0.10 --kube-controller-manager-arg='leader-elect=false' --disable-cloud-controller --kube-scheduler-arg='leader-elect=false' --snapshotter=native --flannel-backend=vxlanThese is the string we will use to start the K3s server. M3s will add several other parameters.
K3S_SERVER_CPU0.1Resources for the K3s Server container
K3S_SERVER_MEM1200
K3S_SERVER_CONSTRAINTTell Mesos to start the K3s server on this hostname
K3S_AGENT_STRING/usr/local/bin/k3s agent --snapshotter=native --flannel-backend=vxlanThese is the string we will use to start the K3s agent. M3s will add several other parameters.
K3S_AGENT_CPU0.1Resources for the K3s Agent container
K3S_AGENT_MEM1200
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)"}]Configure custom labels for the container. In these example, we will use lables for traefik.
REDIS_PASSWORDRedis Passwort for authentication
REDIS_SERVER127.0.0.1:6379Redis Server IP and port
BOOTSTRAP_URLhttps://raw.githubusercontent.com/AVENTER-UG/mesos-m3s/master/bootstrap/bootstrap.shBootstrap Script to pre configure the server/agent container
SKIP_SSLtrueSkip SSL Verification
SSL_CRT_BASE64<cat server.crtbase64 -w 0>
SSL_KEY_BASE64=<cat server.keybase64 -w 0>SSL Key Content as base64
K3S_DS_CONSTRAINTTell Mesos to start the datastore on this hostname
K3S_AGENT_COUNT1Amount of running K3s agents
K3S_AGENT_CONSTRAINTTell Mesos to start the K3s agent on that hostname
K3S_DOCKERtrueUse docker container as K8 runtime
DS_CPUResources for the datastore container
DS_MEM
DS_DISK
DS_PORT3306Datastore Portnumber
IMAGE_K3Savhost/ubuntu-m3sUbuntu M3s Docker Image
IMAGE_ETCDbitnami/etcdDocker Image for Etcd al Datastore
IMAGE_MYSQLmariadbDocker Image for MaraiDB as Datastore
VOLUME_DRIVERlocalVolume driver docker should use to handle the volume
VOLUME_K3S_SERVER/data/k3s/server/Volume name to persist the k3s server data
VOLUME_DS/data/k3s/datastore/Volume name to persists the datastore data
HEARTBEAT_INTERVAL15sCheck the state every 'n seconds