All Projects → tobilg → marathon-slack

tobilg / marathon-slack

Licence: MIT license
Integration for Marathon's Event Bus with Slack

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to marathon-slack

Linkerdcosdockerfile
Linker Dcos DockerFile&DockerCompose yml file
Stars: ✭ 8 (-80.95%)
Mutual labels:  marathon, mesos, dcos
dcos-autoscaler
Autoscaler for DC/OS hosted in a cloud provider
Stars: ✭ 12 (-71.43%)
Mutual labels:  marathon, mesos, dcos
Marathon Lb
Marathon-lb is a service discovery & load balancing tool for DC/OS
Stars: ✭ 449 (+969.05%)
Mutual labels:  marathon, mesos, dcos
dcos-deploy
Deploy, manage and orchestrate services and apps on DC/OS
Stars: ✭ 21 (-50%)
Mutual labels:  marathon, mesos, dcos
Dcos
DC/OS - The Datacenter Operating System
Stars: ✭ 2,316 (+5414.29%)
Mutual labels:  marathon, mesos, dcos
sbt-marathon
An sbt plugin for launching application containers on the Mesosphere Marathon platform.
Stars: ✭ 23 (-45.24%)
Mutual labels:  marathon, mesos
Nixy
nixy - nginx auto configuration and service discovery for Mesos/Marathon
Stars: ✭ 259 (+516.67%)
Mutual labels:  marathon, mesos
Swan
A Distributed, Highly Available Mesos Scheduler, Inspired by the design of Google Borg
Stars: ✭ 411 (+878.57%)
Mutual labels:  marathon, mesos
Traefik
The Cloud Native Application Proxy
Stars: ✭ 36,089 (+85826.19%)
Mutual labels:  marathon, mesos
marathon-appcop
Marathon applications law enforcement
Stars: ✭ 18 (-57.14%)
Mutual labels:  marathon, mesos
Waiter
Runs, manages, and autoscales web services on Mesos and Kubernetes
Stars: ✭ 65 (+54.76%)
Mutual labels:  marathon, mesos
Marathon Consul
Integrates Marathon apps with Consul service discovery.
Stars: ✭ 174 (+314.29%)
Mutual labels:  marathon, mesos
Paasta
An open, distributed platform as a service
Stars: ✭ 1,569 (+3635.71%)
Mutual labels:  marathon, mesos
Panteras
PanteraS - PaaS - Platform as a Service in a box
Stars: ✭ 189 (+350%)
Mutual labels:  marathon, mesos
letsencrypt-dcos
Let's Encrypt DC/OS!
Stars: ✭ 39 (-7.14%)
Mutual labels:  marathon, dcos
consul-registration-hook
Hook that can be used for synchronous registration and deregistration in Consul discovery service on Kubernetes or Mesos cluster with Allegro executor
Stars: ✭ 17 (-59.52%)
Mutual labels:  marathon, mesos
spring-cloud-marathon
Spring Cloud integration with Mesos and Marathon
Stars: ✭ 29 (-30.95%)
Mutual labels:  marathon, mesos
resty-marathon-lb
基于 OpenResty 的 Marathon 服务发现 & 路由
Stars: ✭ 13 (-69.05%)
Mutual labels:  marathon, mesos
My Cheat Sheets
A place to keep all my cheat sheets for the complete development of ASIC/FPGA hardware or a software app/service.
Stars: ✭ 94 (+123.81%)
Mutual labels:  marathon, mesos
xxcloud
xxcloud,旨在整合数据中心异构虚拟化资源为统一的资源池,并在资源池上为用户提供各类IAAS、PAAS服务。
Stars: ✭ 64 (+52.38%)
Mutual labels:  marathon, mesos

marathon-slack

NSP Status Build Status

Listen to Marathon's Event Bus and send selected event types to a Slack WebHook!

Preparations

The only preparation that needs to be performed is to add a new WebHook for your Slack team. You can do this by adding an Incoming Webhook via the Add configuration button on the Slack configuration page.

In the next step after clicking the button, you'll have to select the Slack channel to which you want to post the Marathon Event Bus messaged to. Either choose an existing one, or create a new channel like #marathon.

After you did that, you'll be guided to an overview page for your new Slack Webhook. Please copy the Webhook URL, because you'll need it in the next step. If you want, you can go back to the Incoming Webhooks overview page and select the newly created Webhook again. Then, scroll down to the Integration settings and customize the name and the icon for this integration if you want. To add a name and icon is not mandatory to be able to use marathon-slack.

Usage

You can configure marathon-slack via environment variables.

Environment variables

  • MARATHON_HOST: The Marathon Host (hostname or ip address) where Marathon lives. Default is master.mesos, so if you don't use Mesos DNS you'll have to specify this. If you want to use basic auth with Marathon, use user:[email protected] as value.
  • MARATHON_PORT: The port under which Marathon is running. Default is 8080.
  • MARATHON_PROTOCOL: The protocol to access the Marathon API with. Can be either http or https. Default is http.
  • SLACK_WEBHOOK_URL: The Slack Webhook URL (mandatory).
  • SLACK_CHANNEL: The name of the Slack channel to send the messages to (must contain #). Default is #marathon.
  • SLACK_BOT_NAME: The name of the Slack bot to send the messages from. Default is Marathon Event Bot.
  • EVENT_TYPES: The comma-separated list of event types you want to have sent to Slack. By default, all the below events are activated.
  • TASK_STATUSES: The comma-separated list of Mesos TaskStatuses that you want to have sent to Slack. By default, the below statuses are activated if the environment variable PUBLISH_TASK_STATUS_UPDATES is set to true.
  • PUBLISH_TASK_STATUS_UPDATES: Can be set to true if the TaskStatus update message should be published. Default is false.
  • PORT: The port number on which the API should listen on. Normally, this will be automatically provided by Marathon. Default is 3000.
  • APP_ID_REGEXES: A string regular expression to filter events by their Marathon App Id. For example to send a slack message for only apps with id "*-production". If you want multiple regular expressions, you can concatenate them with a comma.

Event types

Each of the following event types is pushed to Slack if not configured via the EVENT_TYPES environment variables:

  • deployment_info
  • deployment_success
  • deployment_failed
  • deployment_step_success
  • deployment_step_failure
  • group_change_success
  • group_change_failed
  • failed_health_check_event
  • health_status_changed_event
  • unhealthy_task_kill_event

If PUBLISH_TASK_STATUS_UPDATES is set to true, the status_update_event event is handled as well. Please be aware that this may cause a lot of messages to be delivered to the specified Slack channel! If activated, you can use the TASK_STATUSES environment variable to specify the list of TaskStatuses you want to publish. If not, all the task status update messages will be published:

  • TASK_STAGING
  • TASK_STARTING
  • TASK_RUNNING
  • TASK_FINISHED
  • TASK_FAILED
  • TASK_KILLING
  • TASK_KILLED
  • TASK_LOST

An individual, formatted Slack message is currently only for these event types. If another event is received, it will be displayed with a default formatting of event type and timestamp.

Please also see the Marathon Event Bus docs.

Running

Installing on DC/OS as package

Via CLI

You need to create an options.json file locally, before you can install the package. This is because you have to add your individual Slack WebHook URL to the configuration.

An example:

{
  "marathon-slack": {
    "slack_webhook_url": "https://hooks.slack.com/services/...YOUR_WEBHOOK_URL..."
  }
}

The above is the minimal configuration necessary to start the marathon-slack package. You can also customize the Slack channel (property slack_channel) or the list of event types to be published (property event_types). For the full list of configuration options, see the marathon.json.mustache file.

Once you prepared the options.json file, you can install the package with the following command:

dcos package install marathon-slack --options options.json

You should then see the service marathon-slack running on the services tab in the DC/OS UI.

Via Universe

In the DC/OS Universe tab, either search for slack, or scroll down the list of package until you find the marathon-slack package. Then, click on the Install button. Once the modal window pops up, click on Advanced Installation. You can customize the settings for the package, the only thing you have to configure is the slack_webhook_url. This has to fit to the Slack WebHook's URL you created before. Then click on Review and Install, and if everything is ok, on Install.

You should then see the service marathon-slack running on the services tab in the DC/OS UI.

Installing via Marathon

You can run this on Marathon like this:

{
  "id": "/marathon-slack",
  "cpus": 0.1,
  "mem": 128,
  "disk": 0,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "tobilg/marathon-slack:0.4.5",
      "network": "HOST",
      "privileged": false,
      "forcePullImage": true
    }
  },
  "env": {
    "SLACK_WEBHOOK_URL": "YOUR_WEBHOOK_URL"
  },
  "labels":{
    "MARATHON_SINGLE_INSTANCE_APP": "true"
  },
  "upgradeStrategy":{
    "minimumHealthCapacity": 0,
    "maximumOverCapacity": 0
  },
  "portDefinitions": [
    {
      "port": 0,
      "protocol": "tcp",
      "name": "api"
    }
  ],
  "requirePorts": false,
  "healthChecks": [
    {
      "protocol": "HTTP",
      "portIndex": 0,
      "path": "/health",
      "gracePeriodSeconds": 5,
      "intervalSeconds": 20,
      "maxConsecutiveFailures": 3
    }
  ]
}

Please replace YOUR_WEBHOOK_URL with your real Webhook URL.

It's probably useful to limit the EVENT_TYPES to not receive a huge amount of messages. For example, deployment_info,deployment_success,deployment_failed,failed_health_check_event,health_status_changed_event,unhealthy_task_kill_event should cover the most important events, without adding too much details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].