@bluedynamics/cdk8s-monitoring 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +76 -0
- package/LICENSE +202 -0
- package/README.md +87 -0
- package/examples/synth.ts +17 -0
- package/lib/constructs/alloy.d.ts +29 -0
- package/lib/constructs/alloy.js +214 -0
- package/lib/constructs/grafana-password-secret.d.ts +57 -0
- package/lib/constructs/grafana-password-secret.js +99 -0
- package/lib/constructs/loki-s3-bucket.d.ts +24 -0
- package/lib/constructs/loki-s3-bucket.js +147 -0
- package/lib/constructs/loki-s3-credentials.d.ts +27 -0
- package/lib/constructs/loki-s3-credentials.js +71 -0
- package/lib/constructs/loki.d.ts +30 -0
- package/lib/constructs/loki.js +185 -0
- package/lib/constructs/namespace.d.ts +13 -0
- package/lib/constructs/namespace.js +34 -0
- package/lib/constructs/priority-class.d.ts +12 -0
- package/lib/constructs/priority-class.js +38 -0
- package/lib/constructs/prometheus-stack.d.ts +30 -0
- package/lib/constructs/prometheus-stack.js +477 -0
- package/lib/constructs/thanos-compactor.d.ts +35 -0
- package/lib/constructs/thanos-compactor.js +198 -0
- package/lib/constructs/thanos-query.d.ts +30 -0
- package/lib/constructs/thanos-query.js +205 -0
- package/lib/constructs/thanos-s3-bucket.d.ts +24 -0
- package/lib/constructs/thanos-s3-bucket.js +147 -0
- package/lib/constructs/thanos-s3-credentials.d.ts +27 -0
- package/lib/constructs/thanos-s3-credentials.js +93 -0
- package/lib/constructs/thanos-store.d.ts +30 -0
- package/lib/constructs/thanos-store.js +239 -0
- package/lib/default-config.d.ts +12 -0
- package/lib/default-config.js +77 -0
- package/lib/imports/external-secrets.io.d.ts +39243 -0
- package/lib/imports/external-secrets.io.js +23112 -0
- package/lib/imports/generators.external-secrets.io.d.ts +7831 -0
- package/lib/imports/generators.external-secrets.io.js +4895 -0
- package/lib/imports/k8s.d.ts +24537 -0
- package/lib/imports/k8s.js +18268 -0
- package/lib/imports/s3.aws.upbound.io.d.ts +2882 -0
- package/lib/imports/s3.aws.upbound.io.js +1828 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.js +38 -0
- package/lib/monitoring-chart.d.ts +39 -0
- package/lib/monitoring-chart.js +127 -0
- package/lib/types.d.ts +142 -0
- package/lib/types.js +3 -0
- package/package.json +117 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Claude Code Project Guide
|
|
2
|
+
|
|
3
|
+
Context and guidelines for Claude Code when working on **@bluedynamics/cdk8s-monitoring**.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
A generic, application-agnostic cdk8s construct library for a Kubernetes monitoring stack (Prometheus, Thanos, Loki, Grafana, Alloy) with Thanos long-term storage on S3. It is consumed by per-cluster integration charts (e.g. kup6s `dp-infra/monitoring`, helix `helix-infra-charts/monitoring`), which provide cluster-specific config and attach their own app dashboards and alert rules.
|
|
8
|
+
|
|
9
|
+
TypeScript only — no JSII, no Python binding.
|
|
10
|
+
|
|
11
|
+
## Build System
|
|
12
|
+
|
|
13
|
+
This project uses **projen**. Do not edit generated files directly (`package.json`, `tsconfig.json`, `.eslintrc.json`, GitHub workflows, etc.).
|
|
14
|
+
|
|
15
|
+
1. Edit `.projenrc.ts` for project configuration changes.
|
|
16
|
+
2. Run `npx projen` to regenerate files.
|
|
17
|
+
3. Make code changes in `src/`.
|
|
18
|
+
4. Run `npx projen test`; update Jest snapshots with `npx projen test -- -u` if needed.
|
|
19
|
+
|
|
20
|
+
### Common commands
|
|
21
|
+
|
|
22
|
+
```shell
|
|
23
|
+
npx projen # regenerate project files after editing .projenrc.ts
|
|
24
|
+
npx projen build # compile + test + lint + package
|
|
25
|
+
npx projen test # run tests
|
|
26
|
+
npx projen eslint # lint (uses the projen eslint compat task, not bare eslint)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Note: bare `eslint` fails (eslint v9 flat-config vs. projen's `.eslintrc.json`); always lint via `npx projen eslint`.
|
|
30
|
+
|
|
31
|
+
## Project Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
src/
|
|
35
|
+
index.ts # public exports
|
|
36
|
+
monitoring-chart.ts # orchestrator (sync-waves); app-agnostic
|
|
37
|
+
types.ts # config interfaces + DeepPartial + MonitoringConfigInput
|
|
38
|
+
default-config.ts # DEFAULT_CONFIG + mergeConfig (deep-merge)
|
|
39
|
+
constructs/ # the 12 generic stack constructs
|
|
40
|
+
imports/ # generated cdk8s imports (k8s, ESO, S3); excluded from lint
|
|
41
|
+
test/ # Jest tests, one per construct + orchestrator + default-config
|
|
42
|
+
examples/synth.ts # minimal synthesizable integration
|
|
43
|
+
documentation/ # Sphinx/MyST docs (Diataxis, plone-doc-style)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Design Rules
|
|
47
|
+
|
|
48
|
+
- **App-agnostic**: never add cluster- or application-specific resources (dashboards, alert rules, domains) to this library. Integration charts attach those beside `MonitoringChart`.
|
|
49
|
+
- **Defaults in the package, overrides in the chart**: universal values live in `DEFAULT_CONFIG`; cluster-specific values are required input. `mergeConfig` deep-merges.
|
|
50
|
+
- **Generated `imports/` are not hand-edited** and are excluded from lint/style.
|
|
51
|
+
|
|
52
|
+
## Git Workflow
|
|
53
|
+
|
|
54
|
+
Never merge directly to `main`. Use feature branches and pull requests:
|
|
55
|
+
|
|
56
|
+
```shell
|
|
57
|
+
git checkout -b feat/description # or fix/, docs/, chore/, refactor/, test/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
Sphinx with the Diataxis framework, authored in plone-doc-style (American English, one sentence per line, sentence-case headings, dash filenames, sparse admonitions).
|
|
63
|
+
|
|
64
|
+
```shell
|
|
65
|
+
cd documentation
|
|
66
|
+
make docs # build HTML (must be warning-free)
|
|
67
|
+
make docs-live # live-reload server
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Publishing
|
|
71
|
+
|
|
72
|
+
Releases go to npm as `@bluedynamics/cdk8s-monitoring` via the projen release flow. Do not hand-publish unless explicitly asked.
|
|
73
|
+
|
|
74
|
+
## Maintainer
|
|
75
|
+
|
|
76
|
+
Jens W. Klein (jk@kleinundpartner.at), Blue Dynamics Alliance.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# @bluedynamics/cdk8s-monitoring
|
|
2
|
+
|
|
3
|
+
A generic [cdk8s](https://cdk8s.io/) construct library for a complete Kubernetes monitoring stack: Prometheus, Thanos, Loki, Grafana, and Alloy, with Thanos long-term storage on S3-compatible object storage.
|
|
4
|
+
|
|
5
|
+
The library is **application-agnostic**. It synthesizes the stack itself; your own dashboards and alert rules live in your integration chart and attach beside the stack (the Grafana sidecar discovers `ConfigMap`s labeled `grafana_dashboard: "1"`).
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Prometheus + Alertmanager + Grafana via the kube-prometheus-stack Helm chart.
|
|
10
|
+
- Thanos Query, Store, and Compactor for long-term metrics with downsampling.
|
|
11
|
+
- Loki + Alloy for log aggregation and collection.
|
|
12
|
+
- S3 buckets and credentials wired through Crossplane and External Secrets Operator.
|
|
13
|
+
- ArgoCD sync-wave ordering baked in.
|
|
14
|
+
- Sensible production defaults you override only where needed (deep-merge).
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```shell
|
|
19
|
+
npm install @bluedynamics/cdk8s-monitoring
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Peer dependencies: `cdk8s`, `cdk8s-plus-33`, `constructs`.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
Provide your cluster-specific values and let `mergeConfig` fill in the defaults:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { App } from 'cdk8s';
|
|
30
|
+
import { MonitoringChart, mergeConfig } from '@bluedynamics/cdk8s-monitoring';
|
|
31
|
+
|
|
32
|
+
const app = new App();
|
|
33
|
+
|
|
34
|
+
const config = mergeConfig({
|
|
35
|
+
namespace: 'monitoring',
|
|
36
|
+
domains: { grafana: 'grafana.example.com' },
|
|
37
|
+
s3: {
|
|
38
|
+
endpoint: 'https://s3.example.com',
|
|
39
|
+
endpointNoProtocol: 's3.example.com',
|
|
40
|
+
region: 'eu',
|
|
41
|
+
buckets: { thanos: 'metrics-thanos', loki: 'logs-loki' },
|
|
42
|
+
},
|
|
43
|
+
smtp: { host: 'mail.example.com', port: 587, from: 'monitoring@example.com', requireTls: true },
|
|
44
|
+
// Override any default, e.g. storage: { prometheus: '30Gi' }
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
new MonitoringChart(app, 'monitoring', config);
|
|
48
|
+
app.synth();
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Required vs. defaulted configuration
|
|
52
|
+
|
|
53
|
+
- **Required (`RequiredClusterConfig`)**: `namespace`, `domains`, `s3`, `smtp`. No universal default exists, so you must provide them.
|
|
54
|
+
- **Defaulted (`DefaultableConfig`)**: `versions`, `retention`, `storage`, `replicas`, `resources`. Shipped in `DEFAULT_CONFIG`; override any subset via `mergeConfig` (deep-merged).
|
|
55
|
+
|
|
56
|
+
### Adding application dashboards and alerts
|
|
57
|
+
|
|
58
|
+
The library does not ship app-specific dashboards. Attach your own construct beside the chart:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const chart = new MonitoringChart(app, 'monitoring', config);
|
|
62
|
+
new MyAppDashboardConstruct(chart, 'my-app-dashboard', { namespace: config.namespace });
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
A dashboard construct is a `ConfigMap` (use the re-exported `KubeConfigMap`) labeled `grafana_dashboard: "1"` so the Grafana sidecar discovers it. Alert rules are plain `PrometheusRule` resources you manage in your integration repo.
|
|
66
|
+
|
|
67
|
+
## Prerequisites
|
|
68
|
+
|
|
69
|
+
The stack expects these to exist in the cluster:
|
|
70
|
+
|
|
71
|
+
- External Secrets Operator (for S3 credentials and the Grafana admin secret).
|
|
72
|
+
- Crossplane with an S3 provider config (for bucket provisioning).
|
|
73
|
+
- The prometheus-operator CRDs, applied server-side (they are not Helm-managed).
|
|
74
|
+
|
|
75
|
+
## Development
|
|
76
|
+
|
|
77
|
+
This project is managed with [projen](https://projen.io/). Do not edit generated files directly.
|
|
78
|
+
|
|
79
|
+
```shell
|
|
80
|
+
npx projen # regenerate project files after editing .projenrc.ts
|
|
81
|
+
npx projen build # compile + test + lint + package
|
|
82
|
+
npx projen test # run tests
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
Apache-2.0
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { App } from 'cdk8s';
|
|
2
|
+
import { MonitoringChart, mergeConfig } from '../src';
|
|
3
|
+
|
|
4
|
+
const app = new App();
|
|
5
|
+
const config = mergeConfig({
|
|
6
|
+
namespace: 'monitoring',
|
|
7
|
+
domains: { grafana: 'grafana.example.com' },
|
|
8
|
+
s3: {
|
|
9
|
+
endpoint: 'https://s3.example.com',
|
|
10
|
+
endpointNoProtocol: 's3.example.com',
|
|
11
|
+
region: 'eu',
|
|
12
|
+
buckets: { thanos: 'example-thanos', loki: 'example-loki' },
|
|
13
|
+
},
|
|
14
|
+
smtp: { host: 'mail.example.com', port: 587, from: 'monitoring@example.com', requireTls: true },
|
|
15
|
+
});
|
|
16
|
+
new MonitoringChart(app, 'monitoring', config);
|
|
17
|
+
app.synth();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Construct } from 'constructs';
|
|
2
|
+
import { MonitoringConfig } from '../types';
|
|
3
|
+
export interface AlloyProps {
|
|
4
|
+
namespace: string;
|
|
5
|
+
config: MonitoringConfig;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Creates Alloy (Grafana Agent) HelmChart for log collection.
|
|
9
|
+
*
|
|
10
|
+
* This construct deploys Alloy as a DaemonSet that:
|
|
11
|
+
* - Runs on every node in the cluster
|
|
12
|
+
* - Collects logs from all pods via Kubernetes API
|
|
13
|
+
* - Parses JSON structured logs
|
|
14
|
+
* - Extracts structured metadata (trace_id, request_id, etc.)
|
|
15
|
+
* - Tags logs with cluster=kup6s label
|
|
16
|
+
* - Forwards logs to Loki gateway
|
|
17
|
+
*
|
|
18
|
+
* Prerequisites:
|
|
19
|
+
* - Namespace exists
|
|
20
|
+
* - PriorityClass 'high-priority' exists
|
|
21
|
+
* - Loki gateway service exists
|
|
22
|
+
* - RBAC permissions for pod log access
|
|
23
|
+
*
|
|
24
|
+
* Sync Wave: 3 (log collection - after Loki is ready)
|
|
25
|
+
*/
|
|
26
|
+
export declare class AlloyConstruct extends Construct {
|
|
27
|
+
constructor(scope: Construct, id: string, props: AlloyProps);
|
|
28
|
+
private generateHelmValues;
|
|
29
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlloyConstruct = void 0;
|
|
4
|
+
const cdk8s_1 = require("cdk8s");
|
|
5
|
+
const constructs_1 = require("constructs");
|
|
6
|
+
/**
|
|
7
|
+
* Creates Alloy (Grafana Agent) HelmChart for log collection.
|
|
8
|
+
*
|
|
9
|
+
* This construct deploys Alloy as a DaemonSet that:
|
|
10
|
+
* - Runs on every node in the cluster
|
|
11
|
+
* - Collects logs from all pods via Kubernetes API
|
|
12
|
+
* - Parses JSON structured logs
|
|
13
|
+
* - Extracts structured metadata (trace_id, request_id, etc.)
|
|
14
|
+
* - Tags logs with cluster=kup6s label
|
|
15
|
+
* - Forwards logs to Loki gateway
|
|
16
|
+
*
|
|
17
|
+
* Prerequisites:
|
|
18
|
+
* - Namespace exists
|
|
19
|
+
* - PriorityClass 'high-priority' exists
|
|
20
|
+
* - Loki gateway service exists
|
|
21
|
+
* - RBAC permissions for pod log access
|
|
22
|
+
*
|
|
23
|
+
* Sync Wave: 3 (log collection - after Loki is ready)
|
|
24
|
+
*/
|
|
25
|
+
class AlloyConstruct extends constructs_1.Construct {
|
|
26
|
+
constructor(scope, id, props) {
|
|
27
|
+
super(scope, id);
|
|
28
|
+
const { namespace, config } = props;
|
|
29
|
+
// Generate Helm values YAML with embedded Alloy configuration
|
|
30
|
+
const helmValues = this.generateHelmValues(config);
|
|
31
|
+
// Create HelmChart resource (K3S Helm controller)
|
|
32
|
+
// Wave 3: Log Collection - after Loki is ready
|
|
33
|
+
new cdk8s_1.ApiObject(this, 'alloy', {
|
|
34
|
+
apiVersion: 'helm.cattle.io/v1',
|
|
35
|
+
kind: 'HelmChart',
|
|
36
|
+
metadata: {
|
|
37
|
+
name: 'alloy',
|
|
38
|
+
namespace: namespace,
|
|
39
|
+
labels: {
|
|
40
|
+
'app.kubernetes.io/name': 'alloy',
|
|
41
|
+
'app.kubernetes.io/component': 'log-collector',
|
|
42
|
+
'app.kubernetes.io/managed-by': 'cdk8s',
|
|
43
|
+
'app.kubernetes.io/part-of': 'monitoring',
|
|
44
|
+
},
|
|
45
|
+
annotations: {
|
|
46
|
+
'argocd.argoproj.io/sync-wave': '3',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
spec: {
|
|
50
|
+
repo: 'https://grafana.github.io/helm-charts',
|
|
51
|
+
chart: 'alloy',
|
|
52
|
+
version: config.versions.alloy === 'latest' ? undefined : config.versions.alloy,
|
|
53
|
+
targetNamespace: namespace,
|
|
54
|
+
valuesContent: helmValues,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
generateHelmValues(config) {
|
|
59
|
+
// Alloy configuration is written in Alloy's HCL-like syntax
|
|
60
|
+
// This is embedded in the Helm values as a multi-line string
|
|
61
|
+
return `controller:
|
|
62
|
+
type: daemonset
|
|
63
|
+
|
|
64
|
+
alloy:
|
|
65
|
+
configMap:
|
|
66
|
+
create: true
|
|
67
|
+
content: |-
|
|
68
|
+
logging {
|
|
69
|
+
level = "info"
|
|
70
|
+
format = "logfmt"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
discovery.kubernetes "pods" {
|
|
74
|
+
role = "pod"
|
|
75
|
+
selectors {
|
|
76
|
+
role = "pod"
|
|
77
|
+
field = "spec.nodeName=" + sys.env("HOSTNAME")
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// __meta_kubernetes_* labels live on discovery targets only —
|
|
82
|
+
// loki.source.kubernetes does not propagate them to log streams.
|
|
83
|
+
// Relabel here so namespace/pod/container/etc become real labels.
|
|
84
|
+
discovery.relabel "pod_logs" {
|
|
85
|
+
targets = discovery.kubernetes.pods.targets
|
|
86
|
+
|
|
87
|
+
// Skip terminally Failed pods and Unknown-state pods.
|
|
88
|
+
// Old crashed pods otherwise pin loki.source.kubernetes in a
|
|
89
|
+
// retry loop, blocking it from tailing the running replica.
|
|
90
|
+
// CrashLoopBackOff pods stay phase=Running — we keep tailing those.
|
|
91
|
+
rule {
|
|
92
|
+
source_labels = ["__meta_kubernetes_pod_phase"]
|
|
93
|
+
regex = "Failed|Unknown"
|
|
94
|
+
action = "drop"
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
rule {
|
|
98
|
+
source_labels = ["__meta_kubernetes_namespace"]
|
|
99
|
+
target_label = "namespace"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
rule {
|
|
103
|
+
source_labels = ["__meta_kubernetes_pod_name"]
|
|
104
|
+
target_label = "pod"
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
rule {
|
|
108
|
+
source_labels = ["__meta_kubernetes_pod_container_name"]
|
|
109
|
+
target_label = "container"
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
rule {
|
|
113
|
+
source_labels = ["__meta_kubernetes_pod_label_app"]
|
|
114
|
+
target_label = "app"
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
rule {
|
|
118
|
+
source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_component"]
|
|
119
|
+
target_label = "component"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
loki.source.kubernetes "pods" {
|
|
124
|
+
targets = discovery.relabel.pod_logs.output
|
|
125
|
+
forward_to = [loki.process.logs.receiver]
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
loki.process "logs" {
|
|
129
|
+
forward_to = [loki.write.default.receiver]
|
|
130
|
+
|
|
131
|
+
stage.json {
|
|
132
|
+
expressions = {
|
|
133
|
+
timestamp = "timestamp",
|
|
134
|
+
level = "level",
|
|
135
|
+
event = "event",
|
|
136
|
+
component = "component",
|
|
137
|
+
connector_id = "connector_id",
|
|
138
|
+
user_id = "user_id",
|
|
139
|
+
request_id = "request_id",
|
|
140
|
+
trace_id = "trace_id",
|
|
141
|
+
kafka = "kafka",
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
stage.labels {
|
|
146
|
+
values = {
|
|
147
|
+
level = "level",
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
stage.structured_metadata {
|
|
152
|
+
values = {
|
|
153
|
+
connector_id = "connector_id",
|
|
154
|
+
user_id = "user_id",
|
|
155
|
+
request_id = "request_id",
|
|
156
|
+
trace_id = "trace_id",
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
stage.timestamp {
|
|
161
|
+
source = "timestamp"
|
|
162
|
+
format = "RFC3339"
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
stage.output {
|
|
166
|
+
source = "event"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
loki.write "default" {
|
|
171
|
+
endpoint {
|
|
172
|
+
url = "http://loki-gateway.${config.namespace}.svc.cluster.local/loki/api/v1/push"
|
|
173
|
+
}
|
|
174
|
+
external_labels = {
|
|
175
|
+
cluster = "kup6s",
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
extraEnv:
|
|
180
|
+
- name: HOSTNAME
|
|
181
|
+
valueFrom:
|
|
182
|
+
fieldRef:
|
|
183
|
+
fieldPath: spec.nodeName
|
|
184
|
+
|
|
185
|
+
resources:
|
|
186
|
+
limits:
|
|
187
|
+
cpu: ${config.resources.alloy.limits.cpu}
|
|
188
|
+
memory: ${config.resources.alloy.limits.memory}
|
|
189
|
+
requests:
|
|
190
|
+
cpu: ${config.resources.alloy.requests.cpu}
|
|
191
|
+
memory: ${config.resources.alloy.requests.memory}
|
|
192
|
+
|
|
193
|
+
# Config-reloader sidecar resources (added 2025-11-18)
|
|
194
|
+
configReloader:
|
|
195
|
+
resources:
|
|
196
|
+
limits:
|
|
197
|
+
cpu: ${config.resources.configReloader.limits.cpu}
|
|
198
|
+
memory: ${config.resources.configReloader.limits.memory}
|
|
199
|
+
requests:
|
|
200
|
+
cpu: ${config.resources.configReloader.requests.cpu}
|
|
201
|
+
memory: ${config.resources.configReloader.requests.memory}
|
|
202
|
+
|
|
203
|
+
rbac:
|
|
204
|
+
create: true
|
|
205
|
+
|
|
206
|
+
serviceAccount:
|
|
207
|
+
create: true
|
|
208
|
+
|
|
209
|
+
priorityClassName: high-priority
|
|
210
|
+
`;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.AlloyConstruct = AlloyConstruct;
|
|
214
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxsb3kuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc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ldGVzX3BvZF9sYWJlbF9hcHBfa3ViZXJuZXRlc19pb19jb21wb25lbnRcIl1cbiAgICAgICAgICB0YXJnZXRfbGFiZWwgID0gXCJjb21wb25lbnRcIlxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGxva2kuc291cmNlLmt1YmVybmV0ZXMgXCJwb2RzXCIge1xuICAgICAgICB0YXJnZXRzICAgID0gZGlzY292ZXJ5LnJlbGFiZWwucG9kX2xvZ3Mub3V0cHV0XG4gICAgICAgIGZvcndhcmRfdG8gPSBbbG9raS5wcm9jZXNzLmxvZ3MucmVjZWl2ZXJdXG4gICAgICB9XG5cbiAgICAgIGxva2kucHJvY2VzcyBcImxvZ3NcIiB7XG4gICAgICAgIGZvcndhcmRfdG8gPSBbbG9raS53cml0ZS5kZWZhdWx0LnJlY2VpdmVyXVxuXG4gICAgICAgIHN0YWdlLmpzb24ge1xuICAgICAgICAgIGV4cHJlc3Npb25zID0ge1xuICAgICAgICAgICAgdGltZXN0YW1wICAgID0gXCJ0aW1lc3RhbXBcIixcbiAgICAgICAgICAgIGxldmVsICAgICAgICA9IFwibGV2ZWxcIixcbiAgICAgICAgICAgIGV2ZW50ICAgICAgICA9IFwiZXZlbnRcIixcbiAgICAgICAgICAgIGNvbXBvbmVudCAgICA9IFwiY29tcG9uZW50XCIsXG4gICAgICAgICAgICBjb25uZWN0b3JfaWQgPSBcImNvbm5lY3Rvcl9pZFwiLFxuICAgICAgICAgICAgdXNlcl9pZCAgICAgID0gXCJ1c2VyX2lkXCIsXG4gICAgICAgICAgICByZXF1ZXN0X2lkICAgPSBcInJlcXVlc3RfaWRcIixcbiAgICAgICAgICAgIHRyYWNlX2lkICAgICA9IFwidHJhY2VfaWRcIixcbiAgICAgICAgICAgIGthZmthICAgICAgICA9IFwia2Fma2FcIixcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBzdGFnZS5sYWJlbHMge1xuICAgICAgICAgIHZhbHVlcyA9IHtcbiAgICAgICAgICAgIGxldmVsID0gXCJsZXZlbFwiLFxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHN0YWdlLnN0cnVjdHVyZWRfbWV0YWRhdGEge1xuICAgICAgICAgIHZhbHVlcyA9IHtcbiAgICAgICAgICAgIGNvbm5lY3Rvcl9pZCA9IFwiY29ubmVjdG9yX2lkXCIsXG4gICAgICAgICAgICB1c2VyX2lkICAgICAgPSBcInVzZXJfaWRcIixcbiAgICAgICAgICAgIHJlcXVlc3RfaWQgICA9IFwicmVxdWVzdF9pZFwiLFxuICAgICAgICAgICAgdHJhY2VfaWQgICAgID0gXCJ0cmFjZV9pZFwiLFxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHN0YWdlLnRpbWVzdGFtcCB7XG4gICAgICAgICAgc291cmNlID0gXCJ0aW1lc3RhbXBcIlxuICAgICAgICAgIGZvcm1hdCA9IFwiUkZDMzMzOVwiXG4gICAgICAgIH1cblxuICAgICAgICBzdGFnZS5vdXRwdXQge1xuICAgICAgICAgIHNvdXJjZSA9IFwiZXZlbnRcIlxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGxva2kud3JpdGUgXCJkZWZhdWx0XCIge1xuICAgICAgICBlbmRwb2ludCB7XG4gICAgICAgICAgdXJsID0gXCJodHRwOi8vbG9raS1nYXRld2F5LiR7Y29uZmlnLm5hbWVzcGFjZX0uc3ZjLmNsdXN0ZXIubG9jYWwvbG9raS9hcGkvdjEvcHVzaFwiXG4gICAgICAgIH1cbiAgICAgICAgZXh0ZXJuYWxfbGFiZWxzID0ge1xuICAgICAgICAgIGNsdXN0ZXIgPSBcImt1cDZzXCIsXG4gICAgICAgIH1cbiAgICAgIH1cblxuICBleHRyYUVudjpcbiAgICAtIG5hbWU6IEhPU1ROQU1FXG4gICAgICB2YWx1ZUZyb206XG4gICAgICAgIGZpZWxkUmVmOlxuICAgICAgICAgIGZpZWxkUGF0aDogc3BlYy5ub2RlTmFtZVxuXG5yZXNvdX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