Skip to content

Working with Frameworks

siddharthist edited this page Jul 23, 2015 · 2 revisions

Consul

Distributive was designed with Consul in mind. They work well together naturally!

Here's an example configuration file for a Distributive/Consul health check:

{
  "service": {
    "name": "Distributive",
    "check": {
      "script": "/path/to/distributive -f /path/to/checklist.json -d ''",
      "interval": "10m"
    }
  }
}

After properly configuring Consul, simply ensure that Distributive is installed (as outlined in the README) at the appropriate path and that your checklist file gets copied to your nodes.

Kubernetes

Here's an example configuration for Kubernetes, taken from their documentation and modified slightly.

apiVersion: v1
kind: Pod
metadata:
  labels:
    test: liveness
  name: liveness-exec
spec:
  containers:
  - args:
    - /bin/sh
    - -c
    - sleep 600
    # assuming this image has distributive installed
    image: your-website.com/your-image
    livenessProbe:
      exec:
        command:
        - distributive
        - -f
        - /path/to/your/checklist.json
        - -d
        - ""
        - --verbosity
        - info
      initialDelaySeconds: 15
      timeoutSeconds: 20
    name: liveness
Clone this wiki locally