Skip to content

Commit

Permalink
fix: tmconfig properly handled in chart
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Bressi <[email protected]>
  • Loading branch information
puffitos committed Jan 4, 2024
1 parent 0ab8b7d commit 9e77e3c
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 65 deletions.
97 changes: 51 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@

- [About this component](#about-this-component)
- [Installation](#installation)
- [Binary](#binary)
- [Container Image](#container-image)
- [Helm](#helm)
- [Binary](#binary)
- [Container Image](#container-image)
- [Helm](#helm)
- [Usage](#usage)
- [Image](#image)
- [Image](#image)
- [Configuration](#configuration)
- [Startup](#startup)
- [Loader](#loader)
- [Runtime](#runtime)
- [Target Manager](#target-manager)
- [Check: Health](#check-health)
- [Health Metrics](#health-metrics)
- [Check: Latency](#check-latency)
- [Latency Metrics](#latency-metrics)
- [Startup](#startup)
- [Loader](#loader)
- [Runtime](#runtime)
- [Target Manager](#target-manager)
- [Check: Health](#check-health)
- [Health Metrics](#health-metrics)
- [Check: Latency](#check-latency)
- [Latency Metrics](#latency-metrics)
- [API](#api)
- [Metrics](#metrics)
- [Code of Conduct](#code-of-conduct)
Expand Down Expand Up @@ -108,7 +108,8 @@ Additionally check out the sparrow [configuration](#configuration) variants.
## Usage
Use `sparrow run` to execute the instance using the binary. A `sparrowName` (a valid DNS name) is required to be passed, else
Use `sparrow run` to execute the instance using the binary. A `sparrowName` (a valid DNS name) is required to be passed,
else
the sparrow will not start:

```sh
Expand Down Expand Up @@ -160,9 +161,12 @@ Available loader:

### Runtime

In addition to the technical startup configuration, the `sparrow` checks' configuration can be dynamically loaded from an HTTP endpoint during runtime. The `loader` is capable of dynamically loading and configuring checks. You can enable, disable, and configure checks as needed.
In addition to the technical startup configuration, the `sparrow` checks' configuration can be dynamically loaded from
an HTTP endpoint during runtime. The `loader` is capable of dynamically loading and configuring checks. You can enable,
disable, and configure checks as needed.

For detailed information on available loader configuration options, please refer to [this documentation](docs/sparrow_run.md).
For detailed information on available loader configuration options, please refer
to [this documentation](docs/sparrow_run.md).

Example format of a runtime configuration:

Expand All @@ -176,13 +180,14 @@ checks:

### Target Manager

The `sparrow` is able to manage the targets for the checks and register the `sparrow` as target on a (remote) backend.
This is done via a `TargetManager` interface, which can be configured on startup. The available configuration options
are listed below and can be set in a startup YAML configuration file (per default `tmconfig.yaml` in the current
directory).
The `sparrow` is also able to manage the targets for the checks and register the `sparrow`'s healthcheck endpoint as
target
on a (remote) backend. This is done via a `TargetManager` interface, which may be configured on startup. The available
configuration options
are listed below:

| Type | Description | Default |
| ------------------------------------ | ------------------------------------------------------------------------------------ | -------------------- |
|--------------------------------------|--------------------------------------------------------------------------------------|----------------------|
| `targetManager.checkInterval` | The interval in seconds to check for new targets. | `300s` |
| `targetManager.unhealthyThreshold` | The threshold in seconds to mark a target as unhealthy and remove it from the state. | `600s` |
| `targetManager.registrationInterval` | The interval in seconds to register the current sparrow at the targets backend. | `300s` |
Expand Down Expand Up @@ -228,28 +233,28 @@ checks:
#### Health Metrics

- `sparrow_health_up`
- Type: Gauge
- Description: Health of targets
- Labelled with `target`
- Type: Gauge
- Description: Health of targets
- Labelled with `target`

### Check: Latency

Available configuration options:

- `checks`
- `latency`
- `enabled` (boolean): Currently not used.
- `interval` (integer): Interval in seconds to perform the latency check.
- `timeout` (integer): Timeout in seconds for the latency check.
- `retry`
- `count` (integer): Number of retries for the latency check.
- `delay` (integer): Delay in seconds between retries for the latency check.
- `targets` (list of strings): List of targets to send latency probe. Needs to be a valid url. Can be
another `sparrow` instance. Use latency endpoint, e.g. `https://sparrow-dns.telekom.de/checks/latency`. The
remote `sparrow` instance needs the `latencyEndpoint` enabled.
- `latencyEndpoint` (boolean): Needs to be activated when the `sparrow` should expose its own latency endpoint.
Mandatory if another `sparrow` instance wants to perform a latency check.
Example configuration:
- `latency`
- `enabled` (boolean): Currently not used.
- `interval` (integer): Interval in seconds to perform the latency check.
- `timeout` (integer): Timeout in seconds for the latency check.
- `retry`
- `count` (integer): Number of retries for the latency check.
- `delay` (integer): Delay in seconds between retries for the latency check.
- `targets` (list of strings): List of targets to send latency probe. Needs to be a valid url. Can be
another `sparrow` instance. Use latency endpoint, e.g. `https://sparrow-dns.telekom.de/checks/latency`. The
remote `sparrow` instance needs the `latencyEndpoint` enabled.
- `latencyEndpoint` (boolean): Needs to be activated when the `sparrow` should expose its own latency endpoint.
Mandatory if another `sparrow` instance wants to perform a latency check.
Example configuration:

```yaml
checks:
Expand All @@ -268,19 +273,19 @@ checks:
#### Latency Metrics

- `sparrow_latency_duration_seconds`
- Type: Gauge
- Description: Latency with status information of targets
- Labelled with `target` and `status`
- Type: Gauge
- Description: Latency with status information of targets
- Labelled with `target` and `status`

- `sparrow_latency_count`
- Type: Counter
- Description: Count of latency checks done
- Labelled with `target`
- Type: Counter
- Description: Count of latency checks done
- Labelled with `target`

- `sparrow_latency_duration`
- Type: Histogram
- Description: Latency of targets in seconds
- Labelled with `target`
- Type: Histogram
- Description: Latency of targets in seconds
- Labelled with `target`

## API

Expand Down Expand Up @@ -312,7 +317,7 @@ The application itself and all end-user facing content will be made available in
The following channels are available for discussions, feedback, and support requests:

| Type | Channel |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Issues** | <a href="/../../issues/new/choose" title="General Discussion"><img src="https://img.shields.io/github/issues/caas-team/sparrow?style=flat-square"></a> |

## How to Contribute
Expand Down
4 changes: 3 additions & 1 deletion chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ A Helm chart to install Sparrow
| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| startupConfig | object | `{}` | startup configuration of the Sparrow see: https://github.com/caas-team/sparrow/blob/main/docs/sparrow_run.md |
| targetManagerConfig | object | `{}` | target manager configuration of the Sparrow (part of the startup) |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0)
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)
15 changes: 8 additions & 7 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
{{- if or .Values.extraArgs .Values.startupConfig}}
{{- if or .Values.extraArgs .Values.startupConfig .Values.targetManagerConfig}}
- args:
{{- end }}
{{- if .Values.startupConfig}}
- --config
- /startupconfig/.sparrow.yaml
- --tmconfig
- /startupconfig/tmconfig.yaml
- --config
- /startupconfig/.sparrow.yaml
{{- else if .Values.targetManagerConfig}}
- --tmconfig
- /startupconfig/tmconfig.yaml
{{- else if .Values.extraArgs }}
{{- range $key, $value := .Values.extraArgs }}
- --{{ $key }}
- {{ $value }}
- --{{ $key }}
- {{ $value }}
{{- end }}
{{- end }}
{{- if .Values.env }}
Expand Down
13 changes: 2 additions & 11 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extraArgs:

# -- startup configuration of the Sparrow
# see: https://github.com/caas-team/sparrow/blob/main/docs/sparrow_run.md
# startupConfig:
startupConfig: {}
# apiAddress:
# loaderFilePath: /runconfig/checks.yaml
# loaderHttpRetryCount:
Expand All @@ -113,18 +113,9 @@ extraArgs:
# loaderType: http | file
# sparrowName: the-sparrow.com

# -- target manager configuration of the Sparrow (part of the startup)
# targetManagerConfig:
# checkInterval: 300s
# unhealthyThreshold: 600s
# registrationInterval: 300s
# gitlab:
# token: ""
# baseUrl: https://gitlab.com
# projectId: ""

# -- target manager configuration of the Sparrow (part of the startup)
# targetManagerConfig:
targetManagerConfig: {}
# checkInterval: 300s
# unhealthyThreshold: 600s
# registrationInterval: 300s
Expand Down

0 comments on commit 9e77e3c

Please sign in to comment.