GithubHelp home page GithubHelp logo

isabella232 / pod-heartbeat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pantheon-systems/pod-heartbeat

0.0 0.0 0.0 19 KB

check pod networking and exit if we fail

License: Apache License 2.0

Shell 14.48% Go 72.59% Makefile 12.18% Dockerfile 0.75%

pod-heartbeat's Introduction

Docker Repository on Quay Coverage Status Go Report Card Unsupported

pod heartbeat

Connect to services or exit allowing a pod to restart.

This is inteded to be used as a side car container in a kube pod to short-circuit a pods existence if it can't reach some service

Usage

This command will connect to localhost on port 4000 with a 1 second timeout for the probe, it probe every 5 seconds, and will exit if the check fails 3 times

  ./pod-heartbeat --connect http://localhost:4000 --timeout 1s --interval 5s --retries 3 

using as a kube probe

The service can be invoked in 'server' mode. Where it reports 200 or 503 codes depending on health. you can couple this with kube liveness probes to restart pods.

 ./pod-heartbeat --connect http://localhost:4000 --server 

by default it will listen on *:9999 and the root handler will report status as a 200 or 503 which you can use in kube pods health check

Help

Use -h / --help to see help

 ./pod-heartbeat --help                                                                                                                                                                                                                                                                                                                           130 ↵
Sometimes you want your kube pod to die if it can't get to something.
That could be another container in your pod that has deadlocked.

This program runs connects, and  if it can't connect or times out it will exit.
When ran inside a kube pod the container exit event will cause the pod to be destroyed.

Usage:
  pod-heartbeat [flags]

Flags:
  -f, --config-file string   Config file (default is $HOME/.pod-heartbeat.yaml)
  -c, --connect string       Connection URI, valid protocols are  tcp:// and http:// for now (default "tcp://127.0.0.1:4000")
  -i, --interval string      Interval for the Heartbeat action. (default "5s")
  -p, --port int             Port to listen on for the status server. (default 9999)
  -r, --retries int          How many times to retry before reporting failure. (default 3)
  -s, --server               Run the status server instead of exiting.
  -t, --timeout string       Timeout before considering the connection failed. Valid qualifiers: ns,ms,s,m,h,d (default "1s")

pod-heartbeat's People

Contributors

spheromak avatar greg-1-anderson avatar kporras07 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.