Skip to content

Commit

Permalink
Merge pull request #8 from genebean/prometheus
Browse files Browse the repository at this point in the history
Add statsd-exporter sidecar, drop permissions
  • Loading branch information
AjohnsonLS authored Oct 8, 2020
2 parents 7d210a5 + b6e6615 commit ce4aaae
Show file tree
Hide file tree
Showing 11 changed files with 340 additions and 198 deletions.
Binary file removed .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .github/ct.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
helm-extra-args: --timeout 600
helm-extra-args: --timeout 300s --set lightstep.satelliteKey=$CR_TOKEN,resources.requests.memory=7Gi
check-version-increment: true
debug: true
validate-maintainers: false
4 changes: 2 additions & 2 deletions .github/helm-docs.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
set -euo pipefail

HELM_DOCS_VERSION="0.11.0"
HELM_DOCS_VERSION="1.3.0"

# install helm-docs
curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
tar -xf /tmp/helm-docs.tar.gz helm-docs

# validate docs
./helm-docs
./helm-docs -l debug
git diff --exit-code
4 changes: 2 additions & 2 deletions .github/kubeval.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

CHART_DIRS="$(git diff --find-renames --name-only "$(git rev-parse --abbrev-ref HEAD)" remotes/origin/master -- charts | grep '[cC]hart.yaml' | sed -e 's#/[Cc]hart.yaml##g')"
KUBEVAL_VERSION="0.14.0"
KUBEVAL_VERSION="0.15.0"
SCHEMA_LOCATION="https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/"

# install kubeval
Expand All @@ -11,5 +11,5 @@ tar -xf /tmp/kubeval.tar.gz kubeval

# validate charts
for CHART_DIR in ${CHART_DIRS}; do
helm template "${CHART_DIR}" | ./kubeval --strict --ignore-missing-schemas --kubernetes-version "${KUBERNETES_VERSION#v}" --schema-location "${SCHEMA_LOCATION}"
helm template "${CHART_DIR}" --values "${CHART_DIR}/values.yaml" | ./kubeval --strict --ignore-missing-schemas --kubernetes-version "${KUBERNETES_VERSION#v}" --schema-location "${SCHEMA_LOCATION}"
done
64 changes: 33 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
matrix:
k8s:
- v1.12.10
- v1.13.12
- v1.13.11
- v1.14.10
- v1.15.11
- v1.16.8
- v1.15.7
- v1.16.4
- v1.17.4
steps:
- name: Checkout
Expand All @@ -45,31 +45,33 @@ jobs:
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
run: .github/kubeval.sh
install-chart:
name: install-chart
runs-on: ubuntu-latest
needs:
- lint-chart
- lint-docs
- kubeval-chart
strategy:
matrix:
k8s:
- v1.12.10
- v1.13.12
- v1.14.10
- v1.15.7
- v1.16.4
- v1.17.2
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Create kind ${{ matrix.k8s }} cluster
uses: helm/kind-action@master
with:
node_image: kindest/node:${{ matrix.k8s }}
- name: Run chart-testing (install)
uses: helm/chart-testing-action@master
with:
command: install
config: .github/ct.yaml
# install-chart:
# name: install-chart
# runs-on: ubuntu-latest
# needs:
# - lint-chart
# - lint-docs
# - kubeval-chart
# strategy:
# matrix:
# k8s:
# - v1.12.10
# - v1.13.12
# - v1.14.10
# - v1.15.12
# - v1.16.15
# - v1.17.11
# steps:
# - name: Checkout
# uses: actions/checkout@v1
# - name: Create kind ${{ matrix.k8s }} cluster
# uses: helm/kind-action@master
# with:
# node_image: kindest/node:${{ matrix.k8s }}
# - name: Run chart-testing (install)
# uses: helm/chart-testing-action@master
# env:
# CR_TOKEN: '${{ secrets.CR_TOKEN }}'
# with:
# command: install
# config: .github/ct.yaml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_STORE
charts/lightstepsatellite/README.md
4 changes: 2 additions & 2 deletions charts/lightstepsatellite/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
name: lightstep
version: 1.0.2
version: 1.1.0
appVersion: latest
description: Lightsep satellite to collect telemetry data.
home: https://lightstep.com/
icon: https://go.lightstep.com/rs/260-KGM-472/images/logo-medium-color-400x100.jpg
engine: gotpl
engine: gotpl
25 changes: 20 additions & 5 deletions charts/lightstepsatellite/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# lightstep

![Version: 1.0](https://img.shields.io/badge/Version-1.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

Lightsep satellite to collect telemetry data.

Expand Down Expand Up @@ -42,13 +42,17 @@ Lightsep satellite to collect telemetry data.
| lightstep.tls_cert_prefix | string | `nil` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations."prometheus.io/scrape" | string | `"true"` | |
| podSecurityContext | object | `{}` | |
| replicaCount | int | `1` | |
| resources.limits.cpu | int | `2` | |
| resources.limits.memory | string | `"16Gi"` | |
| resources.requests.cpu | int | `2` | |
| resources.requests.memory | string | `"16Gi"` | |
| securityContext | object | `{}` | |
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
| securityContext.readOnlyRootFilesystem | bool | `true` | |
| securityContext.runAsNonRoot | bool | `false` | |
| service.annotations | object | `{}` | |
| service.grpcinsecure | int | `8184` | |
| service.httpPort | int | `8181` | |
| service.type | string | `"ClusterIP"` | |
Expand All @@ -58,10 +62,21 @@ Lightsep satellite to collect telemetry data.
| statsd.client_prefix | string | `"client_via_canary"` | |
| statsd.dogStatsD | bool | `false` | |
| statsd.dogStatsDTags | string | `"pool:us-west-1,canary:true"` | |
| statsd.enabled | bool | `true` | |
| statsd.enabled | bool | `false` | |
| statsd.export_statsd | bool | `true` | |
| statsd.host | string | `"127.0.0.1"` | |
| statsd.port | int | `8125` | |
| statsd.host | string | `"statsd-exporter"` | |
| statsd.image.pullPolicy | string | `"IfNotPresent"` | |
| statsd.image.repository | string | `"prom/statsd-exporter"` | |
| statsd.image.tag | string | `"v0.17.0"` | |
| statsd.port | int | `9125` | |
| statsd.prefix | string | `"lightstep.prod.us-west-1"` | |
| statsd.resources | object | `{}` | |
| statsd.satellite_prefix | string | `"satellite-canary"` | |
| statsd.securityContext.capabilities.drop[0] | string | `"ALL"` | |
| statsd.securityContext.readOnlyRootFilesystem | bool | `true` | |
| statsd.securityContext.runAsNonRoot | bool | `true` | |
| statsd.securityContext.runAsUser | int | `1000` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.3.0](https://github.com/norwoodj/helm-docs/releases/v1.3.0)
53 changes: 53 additions & 0 deletions charts/lightstepsatellite/templates/configmap-statsd-mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: statsd-mapping
labels:
{{- include "lightstep.labels" . | nindent 4 }}
data:
config: |
mappings:
- match: "{{ .Values.statsd.prefix }}.{{ .Values.statsd.client_prefix }}.spans.dropped.*"
name: "lightstep_client_spans"
match_metric_type: counter
labels:
prefix: "{{ .Values.statsd.prefix }}"
client_prefix: "{{ .Values.statsd.client_prefix }}"
lightstep_project: "$1"
action: "dropped"
- match: "{{ .Values.statsd.prefix }}.{{ .Values.statsd.satellite_prefix }}.access_tokens.invalid.*"
name: "lightstep_access_token_invalid"
match_metric_type: counter
labels:
prefix: "{{ .Values.statsd.prefix }}"
satellite_prefix: "{{ .Values.statsd.satellite_prefix }}"
lightstep_project: "$1"
- match: "{{ .Values.statsd.prefix }}.{{ .Values.statsd.satellite_prefix }}.bytes.received.*"
name: "lightstep_bytes_received"
match_metric_type: counter
labels:
prefix: "{{ .Values.statsd.prefix }}"
satellite_prefix: "{{ .Values.statsd.satellite_prefix }}"
protocol: "$1"
- match: "{{ .Values.statsd.prefix }}.{{ .Values.statsd.satellite_prefix }}.spans.*.*"
name: "lightstep_spans"
match_metric_type: counter
labels:
prefix: "{{ .Values.statsd.prefix }}"
satellite_prefix: "{{ .Values.statsd.satellite_prefix }}"
action: "$1"
lightstep_project: "$2"
- match: "{{ .Values.statsd.prefix }}.{{ .Values.statsd.satellite_prefix }}.index.queue.length.*"
name: "lightstep_index_queue_${3}"
match_metric_type: gauge
labels:
prefix: "{{ .Values.statsd.prefix }}"
satellite_prefix: "{{ .Values.statsd.satellite_prefix }}"
lightstep_project: "$1"
- match: "{{ .Values.statsd.prefix }}.{{ .Values.statsd.satellite_prefix }}.current.recall.seconds.*"
name: "lightstep_current_recall_seconds"
match_metric_type: gauge
labels:
prefix: "{{ .Values.statsd.prefix }}"
satellite_prefix: "{{ .Values.statsd.satellite_prefix }}"
lightstep_project: "$1"
Loading

0 comments on commit ce4aaae

Please sign in to comment.