Repository navigation
Expand file tree
/
Copy pathpepr.ts
More file actions
57 lines (49 loc) · 2.05 KB
/
Copy pathpepr.ts
File metadata and controls
57 lines (49 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* Copyright 2024-2026 Defense Unicorns
* SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
*/
import { PeprModule } from "pepr";
import cfg from "./package.json";
import { Component, setupLogger } from "./src/pepr/logger";
import { operator } from "./src/pepr/operator";
import { loadUDSConfig, startConfigWatch } from "./src/pepr/operator/controllers/config/config";
import { setupAuthserviceSecret } from "./src/pepr/operator/controllers/keycloak/authservice/config";
import { setupKeycloakClientSecret } from "./src/pepr/operator/controllers/keycloak/config";
import { setupUptimeConfig } from "./src/pepr/operator/controllers/uptime/config";
import { initAPIServerCIDR } from "./src/pepr/operator/controllers/network/generators/kubeAPI";
import { initAllNodesTarget } from "./src/pepr/operator/controllers/network/generators/kubeNodes";
import { startPackageWatch } from "./src/pepr/operator/controllers/packages/packages";
import { patches } from "./src/pepr/patches";
import { policies, startExemptionWatch } from "./src/pepr/policies";
import { prometheus } from "./src/pepr/prometheus";
const log = setupLogger(Component.STARTUP);
(async () => {
// Load the UDS Config
await loadUDSConfig();
// KFC watch for cluster config, exemptions, and packages
await startConfigWatch();
await startExemptionWatch();
await startPackageWatch();
// Initialize API Server and Nodes IPs in-memory
await initAPIServerCIDR();
await initAllNodesTarget();
// Setup Authservice and Keycloak Secrets used by the operator
await setupAuthserviceSecret();
await setupKeycloakClientSecret();
// Setup the Monitoring Namespace and Blackbox Config Secret if it doesn't exist
await setupUptimeConfig();
// Start the PeprModule
new PeprModule(cfg, [
// UDS Core Operator
operator,
// UDS Core Policies
policies,
// Prometheus monitoring stack
prometheus,
// Patches for specific components
patches,
]);
})().catch(err => {
log.error(err, "Critical error during startup. Exiting...");
process.exit(1);
});