• Stars
    star
    2,489
  • Rank 18,459 (Top 0.4 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Debugging tool for Kubernetes which tests and displays connectivity between nodes in the cluster.

Goldpinger

Publish

Goldpinger makes calls between its instances to monitor your networking. It runs as a DaemonSet on Kubernetes and produces Prometheus metrics that can be scraped, visualised and alerted on.

Oh, and it gives you the graph below for your cluster. Check out the video explainer.

🎉 1M+ pulls from docker hub!

On the menu

Rationale

We built Goldpinger to troubleshoot, visualise and alert on our networking layer while adopting Kubernetes at Bloomberg. It has since become the go-to tool to see connectivity and slowness issues.

It's small (~16MB), simple and you'll wonder why you hadn't had it before.

If you'd like to know more, you can watch our presentation at Kubecon 2018 Seattle.

Quick start

Getting from sources:

go get github.com/bloomberg/goldpinger/cmd/goldpinger
goldpinger --help

Getting from docker hub:

# get from docker hub
docker pull bloomberg/goldpinger:v3.0.0

Building

The repo comes with two ways of building a docker image: compiling locally, and compiling using a multi-stage Dockerfile image. ⚠️ Depending on your docker setup, you might need to prepend the commands below with sudo.

Compiling using a multi-stage Dockerfile

You will need docker version 17.05+ installed to support multi-stage builds.

# Build a local container without publishing
make build

# Build & push the image somewhere
namespace="docker.io/myhandle/" make build-release

This was contributed via @michiel - kudos !

Compiling locally

In order to build Goldpinger, you are going to need go version 1.15+ and docker.

Building from source code consists of compiling the binary and building a Docker image:

# step 0: check out the code
git clone https://github.com/bloomberg/goldpinger.git
cd goldpinger

# step 1: compile the binary for the desired architecture
make bin/goldpinger
# at this stage you should be able to run the binary
./bin/goldpinger --help

# step 2: build the docker image containing the binary
namespace="docker.io/myhandle/" make build

# step 3: push the image somewhere
docker push $(namespace="docker.io/myhandle/" make version)

Installation

Goldpinger works by asking Kubernetes for pods with particular labels (app=goldpinger). While you can deploy Goldpinger in a variety of ways, it works very nicely as a DaemonSet out of the box.

Authentication with Kubernetes API

Goldpinger supports using a kubeconfig (specify with --kubeconfig-path) or service accounts.

Example YAML

Here's an example of what you can do (using the in-cluster authentication to Kubernetes apiserver).

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: goldpinger-serviceaccount
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: goldpinger
  namespace: default
  labels:
    app: goldpinger
spec:
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: goldpinger
  template:
    metadata:
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '8080'
      labels:
        app: goldpinger
    spec:
      serviceAccount: goldpinger-serviceaccount
      tolerations:
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
        fsGroup: 2000
      containers:
        - name: goldpinger
          env:
            - name: HOST
              value: "0.0.0.0"
            - name: PORT
              value: "8080"
            # injecting real hostname will make for easier to understand graphs/metrics
            - name: HOSTNAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            # podIP is used to select a randomized subset of nodes to ping.
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
          image: "docker.io/bloomberg/goldpinger:v3.0.0"
          imagePullPolicy: Always
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
          resources:
            limits:
              memory: 80Mi
            requests:
              cpu: 1m
              memory: 40Mi
          ports:
            - containerPort: 8080
              name: http
          readinessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 20
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 20
            periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
  name: goldpinger
  namespace: default
  labels:
    app: goldpinger
spec:
  type: NodePort
  ports:
    - port: 8080
      nodePort: 30080
      name: http
  selector:
    app: goldpinger

Note, that you will also need to add an RBAC rule to allow Goldpinger to list other pods. If you're just playing around, you can consider a view-all default rule:

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: default
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: view
subjects:
  - kind: ServiceAccount
    name: goldpinger-serviceaccount
    namespace: default

You can also see an example of using kubeconfig in the ./extras.

Using with IPv4/IPv6 dual-stack

If your cluster IPv4/IPv6 dual-stack and you want to force IPv6, you can set the IP_VERSIONS environment variable to "6" (default is "4") which will use the IPv6 address on the pod and host.

ipv6

Note on DNS

Note, that on top of resolving the other pods, all instances can also try to resolve arbitrary DNS. This allows you to test your DNS setup.

From --help:

--host-to-resolve=      A host to attempt dns resolve on (space delimited) [$HOSTS_TO_RESOLVE]

So in order to test two domains, we could add an extra env var to the example above:

            - name: HOSTS_TO_RESOLVE
              value: "www.bloomberg.com one.two.three"

and goldpinger should show something like this:

screenshot-DNS-resolution

TCP and HTTP checks to external targets

Instances can also be configured to do simple TCP or HTTP checks on external targets. This is useful for visualizing more nuanced connectivity flows.

      --tcp-targets=             A list of external targets(<host>:<port> or <ip>:<port>) to attempt a TCP check on (space delimited) [$TCP_TARGETS]
      --http-targets=            A  list of external targets(<http or https>://<url>) to attempt an HTTP{S} check on. A 200 HTTP code is considered successful. (space delimited) [$HTTP_TARGETS]
      --tcp-targets-timeout=  The timeout for a tcp check on the provided tcp-targets (default: 500) [$TCP_TARGETS_TIMEOUT]
      --dns-targets-timeout=  The timeout for a tcp check on the provided udp-targets (default: 500) [$DNS_TARGETS_TIMEOUT]
        - name: HTTP_TARGETS
          value: http://bloomberg.com
        - name: TCP_TARGETS
          value: 10.34.5.141:5000 10.34.195.193:6442

the timeouts for the TCP, DNS and HTTP checks can be configured via TCP_TARGETS_TIMEOUT, DNS_TARGETS_TIMEOUT and HTTP_TARGETS_TIMEOUT respectively.

screenshot-tcp-http-checks

Usage

UI

Once you have it running, you can hit any of the nodes (port 30080 in the example above) and see the UI.

You can click on various nodes to gray out the clutter and see more information.

API

The API exposed is via a well-defined Swagger spec.

The spec is used to generate both the server and the client of Goldpinger. If you make changes, you can re-generate them using go-swagger via make swagger

Prometheus

Once running, Goldpinger exposes Prometheus metrics at /metrics. All the metrics are prefixed with goldpinger_ for easy identification.

You can see the metrics by doing a curl http://$POD_ID:80/metrics.

These are probably the droids you are looking for:

goldpinger_peers_response_time_s_*
goldpinger_peers_response_time_s_*
goldpinger_nodes_health_total
goldpinger_stats_total
goldpinger_errors_total

Grafana

You can find an example of a Grafana dashboard that shows what's going on in your cluster in extras. This should get you started, and once you're on the roll, why not ❤️ contribute some kickass dashboards for others to use ?

Alert Manager

Once you've gotten your metrics into Prometheus, you have all you need to set useful alerts.

To get you started, here's a rule that will trigger an alert if there are any nodes reported as unhealthy by any instance of Goldpinger.

alert: goldpinger_nodes_unhealthy
expr: sum(goldpinger_nodes_health_total{status="unhealthy"})
  BY (instance, goldpinger_instance) > 0
for: 5m
annotations:
  description: |
    Goldpinger instance {{ $labels.goldpinger_instance }} has been reporting unhealthy nodes for at least 5 minutes.
  summary: Instance {{ $labels.instance }} down

Similarly, why not ❤️ contribute some amazing alerts for others to use ?

Chaos Engineering

Goldpinger also makes for a pretty good monitoring tool in when practicing Chaos Engineering. Check out PowerfulSeal, if you'd like to do some Chaos Engineering for Kubernetes.

Authors

Goldpinger was created by Mikolaj Pawlikowski and ported to Go by Chris Green.

Contributions

We ❤️ contributions.

Have you had a good experience with Goldpinger ? Why not share some love and contribute code, dashboards and alerts ?

If you're thinking of making some code changes, please be aware that most of the code is auto-generated from the Swagger spec. The spec is used to generate both the server and the client of Goldpinger. If you make changes, you can re-generate them using go-swagger via make swagger.

Before you create that PR, please make sure you read CONTRIBUTING and DCO.

License

Please read the LICENSE file here.

For each version built by travis, there is also an additional version, appended with -vendor, which contains all source code of the dependencies used in goldpinger.

More Repositories

1

memray

Memray is a memory profiler for Python
Python
13,044
star
2

blazingmq

A modern high-performance open source message queuing system
C++
2,549
star
3

bde

Basic Development Environment - a set of foundational C++ libraries used at Bloomberg.
C++
1,542
star
4

comdb2

Bloomberg's distributed RDBMS
C
1,340
star
5

pystack

🔍 🐍 Like pstack but for Python!
Python
991
star
6

xcdiff

A tool which helps you diff xcodeproj files.
Swift
916
star
7

quantum

Powerful multi-threaded coroutine dispatcher and parallel execution engine
C++
573
star
8

ipydatagrid

Fast Datagrid widget for the Jupyter Notebook and JupyterLab
TypeScript
510
star
9

ts-blank-space

A small, fast, pure JavaScript type-stripper that uses the official TypeScript parser.
TypeScript
484
star
10

foml

Foundations of Machine Learning
Handlebars
334
star
11

pytest-memray

pytest plugin for easy integration of memray memory profiler
Python
334
star
12

python-github-webhook

A framework for writing webhooks for GitHub, in Python.
Python
276
star
13

chromium.bb

Chromium source code and modifications
267
star
14

koan

A word2vec negative sampling implementation with correct CBOW update.
C++
260
star
15

blpapi-node

Bloomberg Open API module for node.js
C++
243
star
16

chef-bcpc

Bloomberg Clustered Private Cloud distribution
Python
228
star
17

phabricator-tools

Phabricator Tools
Python
221
star
18

scatteract

Project which implements extraction of data from scatter plots
Jupyter Notebook
209
star
19

stricli

Build complex CLIs with type safety and no dependencies
TypeScript
180
star
20

pasta-sourcemaps

Pretty (and) Accurate Stack Trace Analysis is an extension to the JavaScript source map format that allows for accurate function name decoding.
TypeScript
166
star
21

record-tuple-polyfill

A polyfill for the ECMAScript Record and Tuple proposal.
JavaScript
162
star
22

collectdwin

CollectdWin - a system statistics collection daemon for Windows, inspired by 'collectd'
C#
123
star
23

clangmetatool

A framework for reusing code in Clang tools
C++
119
star
24

kubernetes-cluster-cookbook

Ruby
100
star
25

quant-research

A collection of projects published by Bloomberg's Quantitative Finance Research team.
Jupyter Notebook
100
star
26

blpapi-http

HTTP wrapper for Bloomberg Open API
TypeScript
83
star
27

dataless-model-merging

Code release for Dataless Knowledge Fusion by Merging Weights of Language Models (https://openreview.net/forum?id=FCnohuR6AnM)
Python
79
star
28

amqpprox

An AMQP 0.9.1 proxy server, designed for use in front of an AMQP 0.9.1 compliant message queue broker such as RabbitMQ.
C++
74
star
29

ntf-core

Sockets, timers, resolvers, events, reactors, proactors, and thread pools for asynchronous network programming
C++
71
star
30

spire-tpm-plugin

Provides agent and server plugins for SPIRE to allow TPM 2-based node attestation.
Go
70
star
31

bde-tools

Tools for developing and building libraries modeled on BDE
Perl
67
star
32

repofactor

Tools for refactoring history of git repositories
Perl
63
star
33

chef-bach

Chef recipes for Bloomberg's deployment of Hadoop and related components
Ruby
61
star
34

rmqcpp

A batteries included C++ RabbitMQ Client Library/API.
C++
59
star
35

minilmv2.bb

Our open source implementation of MiniLMv2 (https://aclanthology.org/2021.findings-acl.188)
Python
59
star
36

wsk

A straightforward and maintainable build system from the Bloomberg Graphics team.
JavaScript
57
star
37

git-adventure-game

An adventure game to help people learn Git
Shell
54
star
38

attrs-strict

Provides runtime validation of attributes specified in Python 'attr'-based data classes.
Python
52
star
39

cnn-rnf

Convolutional Neural Networks with Recurrent Neural Filters
Python
51
star
40

corokafka

C++ Kafka coroutine library using Quantum dispatcher and wrapping CppKafka
C++
50
star
41

selekt

A Kotlin and familiar Android SQLite database library that uses encryption.
Kotlin
46
star
42

ppx_string_interpolation

PPX rewriter that enables string interpolation in OCaml
OCaml
45
star
43

bde_verify

Tool used to format, improve and verify code to BDE guidelines
C++
42
star
44

vault-auth-spire

vault-auth-spire is an authentication plugin for Hashicorp Vault which allows logging into Vault using a Spire provided SVID.
Go
41
star
45

spark-flow

Library for organizing batch processing pipelines in Apache Spark
Scala
41
star
46

startup-python-bootcamp

35
star
47

p1160

P1160 Add Test Polymorphic Memory Resource To Standard Library
C++
35
star
48

bbit-learning-labs

Learning labs curated by BBIT
JavaScript
34
star
49

chef-umami

A tool to automatically generate test code for Chef cookbooks and policies.
Ruby
33
star
50

pycsvw

A tool to read CSV files with CSVW metadata and transform them into other formats.
Python
32
star
51

bde-allocator-benchmarks

A set of benchmarking tools used to quantify the performance of BDE-style polymorphic allocators.
C++
31
star
52

blpapi-hs

Haskell interface to BLPAPI
Haskell
30
star
53

rwl-bench

A set of benchmark tools for reader/writer locks.
C++
28
star
54

entsum

Open Source / ENTSUM: A Data Set for Entity-Centric Extractive Summarization
Jupyter Notebook
28
star
55

consul-cluster-cookbook

Wrapper cookbook which installs and configures a Consul cluster.
Ruby
26
star
56

python-comdb2

Python API to Bloomberg's comdb2 database.
Python
26
star
57

kbir_keybart

Experimental code used in pre-training the KBIR and KeyBART models
Python
26
star
58

blazingmq-sdk-java

Java SDK for BlazingMQ, a modern high-performance open source message queuing system.
Java
26
star
59

presto-accumulo

Presto Accumulo Integration
Java
25
star
60

sgtb

Structured Gradient Tree Boosting
Python
25
star
61

blazingmq-sdk-python

Python SDK for BlazingMQ, a modern high-performance open source message queuing system.
Python
24
star
62

docket

Tool to make running test suites easier, using docker-compose.
Go
22
star
63

jupyterhub-kdcauthenticator

A Kerberos authenticator module for the JupyterHub platform
Python
22
star
64

tzcron

A parser of cron-style scheduling expressions.
Python
20
star
65

constant.js

Immutable/Constant Objects for JavaScript
JavaScript
20
star
66

redis-cookbook

A set of Chef recipes for installing and configuring Redis.
HTML
19
star
67

go-testgroup

Helps you organize tests in Go programs into groups.
Go
19
star
68

MixCE-acl2023

Implementation of MixCE method described in ACL 2023 paper by Zhang et al.
Python
19
star
69

userchroot

A tool to allow controlled access to 'chroot' functionality by users without root permissions
C
19
star
70

sable

Database migration tool for Marten.
C#
19
star
71

nginx-cookbook

A set of Chef recipes for installing and configuring Nginx.
Ruby
17
star
72

zookeeper-cookbook

A set of Chef recipes for installing and configuring Apache Zookeeper.
Ruby
17
star
73

mynexttalk

16
star
74

chef-bcs

Bloomberg Cloud Storage Chef application
Ruby
16
star
75

git-adventure-game-builder

A set of tools for building a Git adventure game, to help people learn Git
Shell
15
star
76

vault-cluster-cookbook

Application cookbook which installs and configures Vault with Consul as a backend.
Ruby
15
star
77

emnlp20_depsrl

Research code and scripts used in the paper Semantic Role Labeling as Syntactic Dependency Parsing.
Python
14
star
78

coffeechat

A simple web application for arranging 'chats over coffee'.
TypeScript
12
star
79

k8eraid

A relatively simple, unified method for reporting on Kubernetes resource issues.
Go
12
star
80

pytest-pystack

Pytest plugin that runs PyStack on slow or hanging tests.
Python
12
star
81

hackathon-aws-cluster

HTML
11
star
82

fast-noise-aware-topic-clustering

Research code and scripts used in the Silburt et al. (2021) EMNLP 2021 paper 'FANATIC: FAst Noise-Aware TopIc Clustering'
Python
10
star
83

emnlp21_fewrel

Code to reproduce the results of the paper 'Towards Realistic Few-Shot Relation Extraction' (EMNLP 2021)
Python
10
star
84

mastering-difficult-conversations

Plan It, Say It, Nail It: Mastering Difficult Conversations
10
star
85

wsk-notify

Simple, customizable console notifications.
JavaScript
10
star
86

jenkins-cluster-cookbook

Ruby
9
star
87

decorator-taxonomy

A taxonomy of Python decorator types.
HTML
9
star
88

tdd-labs

Problems and Solutions for Test-Driven-Development training
JavaScript
9
star
89

argument-relation-transformer-acl2022

This repository contains code for our ACL 2022 Findings paper `Efficient Argument Structure Extraction with Transfer Learning and Active Learning`. We implement an argument structure extraction method based on a pre-trained Transformer model.`
Python
9
star
90

sigir2018-kg-contextualization

8
star
91

bloomberg.github.io

Source code for the https://bloomberg.github.io site
HTML
8
star
92

locking_resource-cookbook

Chef cookbook for serializing access to resources
Ruby
7
star
93

datalake-query-ingester

Python
7
star
94

cobbler-cookbook

A Chef cookbook for installing and maintaining Cobbler
Ruby
7
star
95

p2473

Example code for WG21 paper P2473
Perl
6
star
96

collectd-cookbook

Ruby
6
star
97

Catalyst-Authentication-Credential-GSSAPI

A module that provides integration of the Catalyst web application framework with GSSAPI/SPNEGO HTTP authentication.
Perl
6
star
98

bob-bot

Java
5
star
99

.github

Organization-wide community files
5
star
100

jenkins-procguard

Perl
5
star