Skip to main content

check a cluster of services

Project description

clustercheck

Check a cluster before it goes live.

Usage:

clustercheck -c my.config

Example of config:

dns_map:
    www.blah.com: kube.aws.longthing.com
    www.bar.com: 12.34.56.7

plugin:
    - lib: myplugin.py
      name: MyCheck

checks:
    - url: "wss://dev-site.example.io"
      plugin: MyCheck
    - url: "wss://prod-site.example.io"
      plugin: MyCheck
    - url: "https://prod-site.example.io"
      expect: 
        contains: some-string
      args:
        verify: False

This will run 3 checks, 2 of them will re-use the same plugin (MyCheck), and the 3rd, will just hit the url with requests() lib.

Example of plugin:

class MyCheck(clustercheck.Plugin):
    def check(self, url, args):
        return True

Args are "anything in the args yml". They are not checked, so plugins must verify these values.

Check Execution

- dns map is applied first, it monkey-patches the socket library
- dns map is not inherited by subprocesses, it is python in-process only
- each check is executed in order
- if a plugin is not specified, the url must be valid
- plugsin can be named as "module.name" or as "/path/to/file.py"

Generic checks

- urls are checked for status 200, unless expect: status: is changes.
- websockets are only checked for a ping
- args, if any, are passed to the `requests.request()` or `websocket.create_connection()` calls directly
- default "method" for requests is "GET"

Output format

- output is recorded internally as (PASS/FAIL, time, message, check_config)
- default output format is: "{ok} [{time}] {message} {config.url}"
- passing results are not output unless --verbose is set

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clustercheck-0.1.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

clustercheck-0.1.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file clustercheck-0.1.2.tar.gz.

File metadata

  • Download URL: clustercheck-0.1.2.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.6.8 Windows/10

File hashes

Hashes for clustercheck-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e796baefbfe79882a95d78da25f38c22188c51da542189c045d5b7898b4f9d99
MD5 6119814cdb2b5b85ab0d61776b84a249
BLAKE2b-256 b690bc3fd4bdd065ff458ee524383e4b8a6b7cdd17963e4795486327fd82913b

See more details on using hashes here.

File details

Details for the file clustercheck-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: clustercheck-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.6.8 Windows/10

File hashes

Hashes for clustercheck-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 672f6e0425b3fc58c4d9c9f6ac6990f92527f39cdd866ebc7cccfbccc3bdc51f
MD5 6631979ecd237ce9e05448f954603b2a
BLAKE2b-256 9c315e12e31c4bc902470a94a8407250eba1299dcac5b6b65920dfa312aaa910

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page