mesosphere / mesos-dns-pkg

Packaging utilities for Mesos-DNS
16 stars 10 forks source link

Able to get config keys from environment varibles #9

Open bergerx opened 9 years ago

bergerx commented 9 years ago

In my current setup I don't want mesos-dns to depend on anything other than marathon itself (including any file server outside). So I'm not able to use "uris" to pass a config.json file in my marathon config.

I created another mesos-dns docker image just to be able to give mesos-dns parameters as environment variables: https://registry.hub.docker.com/u/bergerx/mesos-dns/ I prefer not to maintain a copy of mesos-dns docker image and want to use it from upstream.

Here is my mesos-dns-marathon.json file:

{
  "cpus": 0.1,
  "mem": 102,
  "id": "mesos-dns",
  "instances": 1,
  "constraints": [["hostname", "CLUSTER", "192.168.0.23"]],
  "env": {
    "MESOS_DOCKER_ZK": "zk://192.168.0.23:2181,192.168.0.26:2181,192.168.0.27:2181/mesos",
    "MESOS_DNS_MASTERS": "192.168.0.23:5050,192.168.0.26:5050,192.168.0.27:5050",
    "MESOS_DNS_RESOLVERS": "8.8.8.8"
  },
  "container": {
    "type": "DOCKER",
    "docker": { "image": "bergerx/mesos-dns" }
  },
  "healthChecks": [{
    "protocol": "COMMAND",
    "command": { "value": "dig +short leader.mesos @$HOST | grep ." }
  }],
  "upgradeStrategy": {
    "minimumHealthCapacity": 0,
    "maximumOverCapacity": 0
  }
}
amouat commented 9 years ago

:+1: