Giter Club home page Giter Club logo

docker-engage's Introduction

Engage - Beast Mode Debugging!

Engage is meant as a custom lightweight container image meant for providing a go-to debugging/troubleshooting environment in multiple scenarios. View the Dockerfile to see everything installed (i.e. dig, curl, telnet, psql, nmap, and more!).

Run Locally:

docker run --name engage inanimate/engage
docker exec -it engage /bin/bash

In Kubernetes:

kubectl apply -f deploy/deployment.yaml

Other objects exist in deploy/ like ingress, pdb, and service!

Echo Server

Additionally, https://github.com/inanimate/echo-server is included which provides a simple http server that prints out basic details and other useful troubleshooting information.

Snippet of example output when you curl localhost:

Welcome to echo-server!  Here's what I know.
  > Head to /ws for interactive websocket echo!

-> My hostname is: echo-server-4282639374-6bvzg

-> My Pod Name is: echo-server-4282639374-6bvzg
-> My Pod Namespace is: playground
-> My Pod IP is: 10.2.1.30

-> Requesting IP: 10.2.2.0:40974
.......

This is immensely helpful when testing ingress flows through load balancers, verifying network policies, and other introspective details of the environment a container runs in! It also provides a Websocket connection for further testing.

HTTPSTAT (Curl on Steroids!)

Another utility, httpstat is also included (the go version: https://github.com/davecheney/httpstat) which gives you amazing http response details.

bash-4.4# httpstat google.com

Connected to 216.58.192.174:443

HTTP/2.0 301 Moved Permanently
Server: gws
Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: public, max-age=2592000
Content-Length: 220
Content-Type: text/html; charset=UTF-8
Date: Fri, 12 Feb 2021 15:59:09 GMT
Expires: Sun, 14 Mar 2021 15:59:09 GMT
Location: https://www.google.com/
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

  DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
[     18ms  |          19ms  |        103ms  |             46ms  |             0ms  ]
            |                |               |                   |                  |
   namelookup:18ms           |               |                   |                  |
                       connect:37ms          |                   |                  |
                                   pretransfer:141ms             |                  |
                                                     starttransfer:187ms            |
                                                                                total:188ms

Loop Mode

Engage can take a command you give it (i.e. via docker-compose) and run it in a while loop with interval $LOOPINTERVAL for you!

To enable set both these environment variables (LOOPINTERVAL is any accepted timeframe sleep supports),

LOOPMODE=enabled
LOOPINTERVAL=10000s

and pass your desired script or one-liner for immediate execution and recurring execution every $LOOPINTERVAL

An example command:

docker run -ti inanimate/engage 'export NICEDATE=`date +"%Y-%m-%d_%H-%M"` && echo "starting backup with date $NICEDATE"'

This is especially useful if you need to run continuous checks on a process, make simple backup patterns, or have other fun usecases!

Note, the loop will continue indefinitely as while true does. Please ensure you kill the process to stop your desired script from continually running!

Please feel free to open issues of cool features or other utilities you'd like to see. Also, feel free to use this as a base to fork from!

docker-engage's People

Contributors

devth avatar inanimate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-engage's Issues

Setup optional SSH daemon

This includes creating the tooling for:

  • creating the host keys on launch (see here for ex.)
  • setting up the .ssh directory and possibly another user
  • figure out the best options to launch with by default and allow more to be configured i.e. port, no password auth

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.