Skip to content

Commit 0cac7f1

Browse files
adityathebemoshloop
authored andcommitted
chore: move MatchPattern to common types & add examples for
annotations
1 parent fbf2bd7 commit 0cac7f1

File tree

3 files changed

+67
-18
lines changed

3 files changed

+67
-18
lines changed

common/src/components/Fields.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import clsx from 'clsx'
77

88
const schemes = {
99
"EnvVar": "[EnvVar](/reference/env-var)",
10+
"MatchPattern": "[MatchPattern](/reference/types#match-pattern)",
1011
"[]EnvVar": "[[]EnvVar](/reference/env-var)",
1112
"CEL": "[CEL](/reference/scripting/cel)",
1213
"Javascript": "[Javascript](/reference/scripting/javascript)",

mission-control/docs/config-db/scrapers/kubernetes.md

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,59 @@ There are 3 different ways to specify which value to use when finding related co
117117

118118
Kubernetes resources can be annotated with some special annotations that can direct the scraper to certain behaviors.
119119

120-
| Annotation | Description |
121-
| ------------------------------------------------------------- | -------------------------------------------------------------------------- |
122-
| `config-db.flanksource.com/tags: "key1:val1,key2:val2"` | Attach custom tags to the object. A config can have as many as `5` tags, so keep the custom tags limited. |
123-
| `config-db.flanksource.com/ignore: true` | Exclude the object from being scraped along with all of its changes. |
124-
| `config-db.flanksource.com/ignore-changes: <pattern>` | Exclude changes by type for the given object that matches the pattern. |
125-
| `config-db.flanksource.com/ignore-change-severity: <pattern>` | Exclude changes by severity for the given object that matches the pattern. |
126-
127-
### Pattern matching
128-
129-
Pattern matching suports the following operations
120+
<Fields
121+
rows={[
122+
{
123+
field: 'config-db.flanksource.com/tags',
124+
description: 'Attach custom tags to the object. A config can have as many as `5` tags, so keep the custom tags limited.',
125+
scheme: '`key1:val1,key2:val2`'
126+
},
127+
{
128+
field: 'config-db.flanksource.com/ignore',
129+
description: 'Exclude the object from being scraped along with all of its changes.',
130+
scheme: 'bool'
131+
},
132+
{
133+
field: 'config-db.flanksource.com/ignore-changes',
134+
description: 'Exclude changes by type for the given object that matches the pattern.',
135+
scheme: 'MatchPattern'
136+
},
137+
{
138+
field: 'config-db.flanksource.com/ignore-change-severity',
139+
description: 'Exclude changes by severity for the given object that matches the pattern.',
140+
scheme: 'MatchPattern'
141+
}
142+
]}
143+
/>
144+
145+
### Examples
146+
147+
#### Exclude verbose changes from argo application
148+
149+
```yaml title="argo-application.yaml"
150+
apiVersion: argoproj.io/v1alpha1
151+
kind: Application
152+
metadata:
153+
name: sock-shop
154+
namespace: argo
155+
annotations:
156+
config-db.flanksource.com/ignore-changes: ReconciliationSucceeded
157+
config-db.flanksource.com/ignore-change-severity: low
158+
spec:
159+
...
160+
```
130161

131-
- Use `*` to exclude all.
132-
- Prefix matching. Example: `Added*,Deleted*`
133-
- Suffix matching. Example: `*Terminated`
134-
- Negation will match everything but the pattern: Example: `!PodCrashLooping`
162+
#### Excluding a particular secret from being scraped
163+
164+
```yaml title="secret.yaml"
165+
apiVersion: v1
166+
kind: Secret
167+
metadata:
168+
annotations:
169+
config-db.flanksource.com/ignore: true
170+
name: slack
171+
namespace: default
172+
type: Opaque
173+
data:
174+
token: ...
175+
```

mission-control/docs/reference/types.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ hide_title: true
33
title: Common Types
44
sidebar_position: 2
55
---
6+
67
## Agent
78

89
An agent can be specified using:
910

1011
- `local` - The primary mission control instance
1112
- `uuid` of an agent
1213
- `name` of and agent
13-
- `all` match all/any agents
14+
- `all` match all/any agents
1415

1516
## Cron
1617

@@ -35,8 +36,6 @@ An agent can be specified using:
3536
| `@daily` (or `@midnight`) | Run once a day at midnight | `0 0 * * *` |
3637
| `@hourly` | Run once an hour at the beginning of the hour | `0 * * * *` |
3738

38-
39-
4039
## Duration
4140

4241
Valid time units are "s", "m", "h", "d", "w", "y". Eg:
@@ -52,7 +51,6 @@ Valid time units are "s", "m", "h", "d", "w", "y". Eg:
5251

5352
Sizes are string with a unit suffix e.g. `100` / `100b`, `10mb`, Valid size units are `kb`, `mb`, `gb`, `tb`
5453

55-
5654
## Icon
5755

5856
One of the icons in the [flanksource-icons](https://github.com/flanksource/flanksource-icons/tree/main/svg) project
@@ -63,3 +61,12 @@ e.g.
6361
- `Kubernetes::Pod`
6462
- `argo`
6563
- `aws-ebs-volume`
64+
65+
## Match Pattern
66+
67+
Pattern matching suports the following operations
68+
69+
- Use `*` to exclude all.
70+
- Prefix matching. Example: `Added*,Deleted*`
71+
- Suffix matching. Example: `*Terminated`
72+
- Negation will match everything but the pattern: Example: `!PodCrashLooping`

0 commit comments

Comments
 (0)