Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: switch from promtail to vector #724

Merged
merged 31 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
492dcc4
wip: add vector
mjnagel Sep 3, 2024
c46ea60
Merge branch 'main' into vector-add
mjnagel Sep 3, 2024
9f0ac4a
chore: vector config with labelling >> loki
mjnagel Sep 4, 2024
64014c1
chore: docs and netpols
mjnagel Sep 4, 2024
376b108
chore: use pod name if available
mjnagel Sep 4, 2024
3bb15ea
chore: netpols
mjnagel Sep 4, 2024
25bac8d
Merge branch 'main' into vector-add
mjnagel Sep 4, 2024
1ff13e5
fix: yaml lint
mjnagel Sep 4, 2024
abb01b7
chore: simpler [ci skip]
mjnagel Sep 4, 2024
f5c5bec
chore: add wip IB image [ci skip]
mjnagel Sep 5, 2024
eb91b39
chore: revert age filter [ci skip]
mjnagel Sep 5, 2024
81bc864
cleanup [ci skip]
mjnagel Sep 5, 2024
2e6a796
docs: update to vector capabilities [ci skip]
mjnagel Sep 5, 2024
5c691df
Merge branch 'main' into vector-add
mjnagel Sep 9, 2024
3f01146
chore: oscal update
mjnagel Sep 9, 2024
07dcbd4
Merge branch 'main' into vector-add
mjnagel Sep 9, 2024
dc06f7e
chore: update latest vector, merge main
mjnagel Sep 11, 2024
42c8e3b
chore: helm chart update [skip ci]
mjnagel Sep 11, 2024
7020145
chore: updates
mjnagel Sep 16, 2024
a86f4dd
chore: docs + labels for collector
mjnagel Sep 16, 2024
d5fbad3
Merge branch 'main' into vector-add
mjnagel Sep 16, 2024
970d358
Merge branch 'main' into vector-add
mjnagel Sep 17, 2024
01c1500
fix: labelling, docs, grafana telemetry, pepr action
mjnagel Sep 17, 2024
4581de3
Merge branch 'main' into vector-add
mjnagel Sep 17, 2024
df6378c
chore: rebase, resolve conflict
mjnagel Sep 20, 2024
9851933
Merge branch 'main' into vector-add
mjnagel Sep 23, 2024
c3801a1
chore: pr feedback
mjnagel Sep 23, 2024
5f0fe9a
Merge branch 'main' into vector-add
mjnagel Sep 23, 2024
00fbb07
Merge branch 'main' into vector-add
mjnagel Sep 24, 2024
f68aa95
Merge branch 'main' into vector-add
mjnagel Sep 25, 2024
68d6d88
Merge branch 'main' into vector-add
mjnagel Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ prometheus-stack:
- "!**/*.gif"
- "!**/*.svg"

promtail:
- "src/promtail/**"
vector:
- "src/vector/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
Expand Down
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.16.0/uds.schema.json": [
"uds-bundle.yaml"
],

// renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
"https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.16.0/tasks.schema.json": [
"tasks.yaml",
Expand All @@ -37,7 +36,6 @@
"MITM",
"neuvector",
"opensource",
"promtail",
"Quarkus",
"Quickstart",
"seccomp",
Expand All @@ -47,7 +45,7 @@
"cSpell.enabled": true,
"[typescript]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
"source.organizeImports": "always"
}
},
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -972,5 +972,5 @@ PRE RELEASE
- CONTRIBUTING.md
- DEVELOPMENT_MAINTENANCE.md
- LICENSE
- READEME.md
- README.md
- zarf.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ UDS Core establishes a secure baseline for cloud-native systems and ships with c
- [Neuvector](https://open-docs.neuvector.com/) - Container Security
- [Pepr](https://pepr.dev) - UDS policy engine & operator
- [Prometheus Stack](https://github.com/prometheus-operator/kube-prometheus) - Monitoring
- [Promtail](https://grafana.com/docs/loki/latest/send-data/promtail/) - Log Aggregation
- [Vector](https://vector.dev/) - Log Aggregation
- [Velero](https://velero.io/) - Backup & Restore
- [UDS Runtime](https://github.com/defenseunicorns/uds-runtime) - Frontend Views & Insights

Expand Down
2 changes: 1 addition & 1 deletion compliance/oscal-component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ component-definition:
- href: 'file://./../src/loki/oscal-component.yaml'
- href: 'file://./../src/neuvector/oscal-component.yaml'
- href: 'file://./../src/prometheus-stack/oscal-component.yaml'
- href: 'file://./../src/promtail/oscal-component.yaml'
- href: 'file://./../src/vector/oscal-component.yaml'
- href: 'file://./../src/velero/oscal-component.yaml'

capabilities:
Expand Down
2 changes: 1 addition & 1 deletion docs/application-baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For optimal deployment and operational efficiency, it is important to deliver a
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Service Mesh** | **[Istio](https://istio.io/):** A powerful service mesh that provides traffic management, load balancing, security, and observability features. |
| **Monitoring** | **[Metrics Server](https://kubernetes-sigs.github.io/metrics-server/):** Provides container resource utilization metrics API for Kubernetes clusters. Metrics server is an optional (non-default) component since most Kubernetes distros provide it by default.<br><br>**[Prometheus](https://prometheus.io/):** Scrapes Metrics Server API and application metrics and stores the data in a time-series database for insights into application health and performance.<br><br> **[Grafana](https://grafana.com/grafana/):** Provides visualization and alerting capabilities based on Prometheus's time-series database of metrics. |
| **Logging** | **[Promtail](https://grafana.com/docs/loki/latest/send-data/promtail/):** A companion agent that efficiently gathers and sends container logs to Loki, simplifying log monitoring, troubleshooting, and compliance auditing, enhancing the overall observability of the mission environment.<br><br> **[Loki](https://grafana.com/docs/loki/latest/):** A log aggregation system that allows users to store, search, and analyze logs across their applications. |
| **Logging** | **[Vector](https://vector.dev/):** A companion agent that efficiently gathers and sends container logs to Loki and other storage locations (S3, SIEM tools, etc), simplifying log monitoring, troubleshooting, and compliance auditing, enhancing the overall observability of the mission environment.<br><br> **[Loki](https://grafana.com/docs/loki/latest/):** A log aggregation system that allows users to store, search, and analyze logs across their applications. |
| **Security and Compliance** | **[NeuVector](https://open-docs.neuvector.com/):** Offers container-native security, protecting applications against threats and vulnerabilities.<br><br> **[Pepr](https://pepr.dev/):** UDS policy engine and operator for enhanced security and compliance.|
| **Identity and Access Management** | **[Keycloak](https://www.keycloak.org/):** A robust open-source Identity and Access Management solution, providing centralized authentication, authorization, and user management for enhanced security and control over access to mission-critical resources.|
| **Backup and Restore** | **[Velero](https://velero.io/):** Provides backup and restore capabilities for Kubernetes clusters, ensuring data protection and disaster recovery.|
Expand Down
14 changes: 12 additions & 2 deletions docs/configuration/resource-configuration-and-ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,19 @@ To scale Grafana for high availability, its database must be externalized (see [

## Logging

### Promtail
### Vector

By default Promtail runs as a daemonset, automatically scaling across all nodes to ensure logs are captured from each host. Typically Promtail does not need any other modifications, but you can customize its resource configuration by overriding the `resources` helm value (using the component and chart name of `promtail`).
By default Vector runs as a daemonset, automatically scaling across all nodes to ensure logs are captured from each host. Typically Vector does not need any other modifications, but you can customize its resource configuration by overriding the `resources` helm value (using the component and chart name of `vector`). Vector recommends the below resourcing when running in production:

```yaml
resources:
requests:
memory: "64Mi"
cpu: "500m"
limits:
memory: "1024Mi"
cpu: "6000m"
```

### Loki

Expand Down
6 changes: 3 additions & 3 deletions packages/standard/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ components:
import:
path: ../../src/prometheus-stack

# Promtail
- name: promtail
# Vector
- name: vector
required: true
import:
path: ../../src/promtail
path: ../../src/vector

# Grafana
- name: grafana
Expand Down
6 changes: 3 additions & 3 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"commitMessageTopic": "istio"
},
{
"matchFileNames": ["src/promtail/**"],
"groupName": "promtail",
"commitMessageTopic": "promtail"
"matchFileNames": ["src/vector/**"],
"groupName": "vector",
"commitMessageTopic": "vector"
},
{
"matchFileNames": ["src/velero/**"],
Expand Down
3 changes: 3 additions & 0 deletions src/grafana/values/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ grafana.ini:
reporting_enabled: false
check_for_updates: false
check_for_plugin_updates: false
feedback_links_enabled: false
plugins:
public_key_retrieval_disabled: true
auth:
# Disable the login form to force users to use SSO
disable_login_form: true
Expand Down
2 changes: 1 addition & 1 deletion src/istio/oscal-component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ component-definition:
# Expected values
expected_istiod_port := 15012
expected_istiod_protocol := "TCP"
required_namespaces := {"authservice", "grafana", "keycloak", "loki", "metrics-server", "monitoring", "neuvector", "promtail", "velero"}
required_namespaces := {"authservice", "grafana", "keycloak", "loki", "metrics-server", "monitoring", "neuvector", "vector", "velero"}

# Validate NetworkPolicy for Istiod in required namespaces
validate {
Expand Down
6 changes: 3 additions & 3 deletions src/loki/chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ spec:
- direction: Ingress
selector:
app.kubernetes.io/name: loki
remoteNamespace: promtail
remoteNamespace: vector
remoteSelector:
app.kubernetes.io/name: promtail
app.kubernetes.io/name: vector
ports:
- 8080
description: "Promtail Log Storage"
description: "Vector Log Storage"

# Egress for S3 connections
- direction: Egress
Expand Down
38 changes: 19 additions & 19 deletions src/pepr/operator/controllers/exemptions/exemptions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const prometheusMatcher = {
name: "^neuvector-prometheus-exporter-pod.*",
kind: MatcherKind.Pod,
};
const promtailMatcher = { namespace: "promtail", name: "^promtail-.*", kind: MatcherKind.Pod };
const vectorMatcher = { namespace: "vector", name: "^vector-.*", kind: MatcherKind.Pod };
const exemption1UID = "exemption-1-uid";
const exemption2UID = "exemption-2-uid";
const storedEnforcerMatcher = { ...enforcerMatcher, owner: exemption1UID };
const storedControllerMatcher = { ...controllerMatcher, owner: exemption1UID };
const storedPrometheusMatcher = { ...prometheusMatcher, owner: exemption1UID };
const storedPromtailMatcher = { ...promtailMatcher, owner: exemption2UID };
const storedVectorMatcher = { ...vectorMatcher, owner: exemption2UID };
const neuvectorMockExemption = {
metadata: {
uid: exemption1UID,
Expand Down Expand Up @@ -90,7 +90,7 @@ describe("Test processExemptions() no duplicate matchers in same CR", () => {
// remove RequireNonRootUser from enforcerMatcher
// remove prometheusMatcher
// add DisallowHostNamespaces to controllerMatcher
// add promtailMatcher with RequireNonRootUser
// add vectorMatcher with RequireNonRootUser
const updatedNeuvectorExemption = {
metadata: {
uid: exemption1UID,
Expand All @@ -110,7 +110,7 @@ describe("Test processExemptions() no duplicate matchers in same CR", () => {
],
},
{
matcher: promtailMatcher,
matcher: vectorMatcher,
policies: [Policy.RequireNonRootUser],
},
],
Expand All @@ -120,7 +120,7 @@ describe("Test processExemptions() no duplicate matchers in same CR", () => {
processExemptions(neuvectorMockExemption, WatchPhase.Added);
processExemptions(updatedNeuvectorExemption, WatchPhase.Modified);
expect(ExemptionStore.getByPolicy(Policy.RequireNonRootUser)).toEqual([
{ ...storedPromtailMatcher, owner: exemption1UID },
{ ...storedVectorMatcher, owner: exemption1UID },
]);
expect(ExemptionStore.getByPolicy(Policy.DisallowPrivileged)).toEqual([
storedEnforcerMatcher,
Expand Down Expand Up @@ -360,14 +360,14 @@ describe("Test processExemptions(); phase DELETED", () => {
});

it("Does not remove exemptions set by separate CR from the one being deleted", async () => {
const promtailMockExemption = {
const vectorMockExemption = {
metadata: {
uid: exemption2UID,
},
spec: {
exemptions: [
{
matcher: promtailMatcher,
matcher: vectorMatcher,
policies: [
Policy.DisallowPrivileged,
Policy.DropAllCapabilities,
Expand All @@ -379,12 +379,12 @@ describe("Test processExemptions(); phase DELETED", () => {
} as Exemption;

processExemptions(neuvectorMockExemption, WatchPhase.Added);
processExemptions(promtailMockExemption, WatchPhase.Added);
processExemptions(vectorMockExemption, WatchPhase.Added);
processExemptions(neuvectorMockExemption, WatchPhase.Deleted);

expect(ExemptionStore.getByPolicy(Policy.DisallowPrivileged)).toEqual([storedPromtailMatcher]);
expect(ExemptionStore.getByPolicy(Policy.DropAllCapabilities)).toEqual([storedPromtailMatcher]);
expect(ExemptionStore.getByPolicy(Policy.RequireNonRootUser)).toEqual([storedPromtailMatcher]);
expect(ExemptionStore.getByPolicy(Policy.DisallowPrivileged)).toEqual([storedVectorMatcher]);
expect(ExemptionStore.getByPolicy(Policy.DropAllCapabilities)).toEqual([storedVectorMatcher]);
expect(ExemptionStore.getByPolicy(Policy.RequireNonRootUser)).toEqual([storedVectorMatcher]);
});

it("Does not delete duplicate exemptions if set by separate CRs", async () => {
Expand Down Expand Up @@ -448,43 +448,43 @@ describe("Test processExemptions(); phase DELETED", () => {
},
} as Exemption;

const promtailMockExemption = {
const vectorMockExemption = {
metadata: {
uid: exemption2UID,
},
spec: {
exemptions: [
{
matcher: promtailMatcher,
matcher: vectorMatcher,
policies: [Policy.DisallowPrivileged],
},
],
},
} as Exemption;

const promtailUpdatedMockExemption = {
const vectorUpdatedMockExemption = {
metadata: {
uid: exemption2UID,
},
spec: {
exemptions: [
{
matcher: promtailMatcher,
matcher: vectorMatcher,
policies: [Policy.DisallowPrivileged, Policy.RequireNonRootUser],
},
],
},
} as Exemption;

processExemptions(neuvectorMockExemption, WatchPhase.Added);
processExemptions(promtailMockExemption, WatchPhase.Added);
processExemptions(promtailUpdatedMockExemption, WatchPhase.Modified);
processExemptions(vectorMockExemption, WatchPhase.Added);
processExemptions(vectorUpdatedMockExemption, WatchPhase.Modified);

expect(ExemptionStore.getByPolicy(Policy.RequireNonRootUser)).toEqual([
storedEnforcerMatcher,
storedPromtailMatcher,
storedVectorMatcher,
]);
expect(ExemptionStore.getByPolicy(Policy.DropAllCapabilities)).toEqual([storedEnforcerMatcher]);
expect(ExemptionStore.getByPolicy(Policy.DisallowPrivileged)).toEqual([storedPromtailMatcher]);
expect(ExemptionStore.getByPolicy(Policy.DisallowPrivileged)).toEqual([storedVectorMatcher]);
});
});
2 changes: 1 addition & 1 deletion src/pepr/policies/exemptions/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("test registering exemptions", () => {
const req = {
Raw: {
metadata: {
name: "promtail",
name: "vector",
namespace: "monitoring",
},
},
Expand Down
45 changes: 17 additions & 28 deletions src/pepr/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,20 @@ components:
actions:
onDeploy:
before:
- cmd: ./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-api-token meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-module meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-tls meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate serviceaccount -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate clusterrolebinding pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate clusterrole pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate role -n pepr-system pepr-uds-core-store meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate rolebinding -n pepr-system pepr-uds-core-store meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate service -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate service -n pepr-system pepr-uds-core-watcher meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate deployment -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate deployment -n pepr-system pepr-uds-core-watcher meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate mutatingwebhookconfiguration -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
mute: true
- cmd: ./zarf tools kubectl annotate validatingwebhookconfiguration -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
mute: true
- mute: true
description: "Update helm ownership for Pepr resources if necessary during the upgrade"
cmd: |
./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-api-token meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-module meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate secret -n pepr-system pepr-uds-core-tls meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate serviceaccount -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate clusterrolebinding pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate clusterrole pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate role -n pepr-system pepr-uds-core-store meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate rolebinding -n pepr-system pepr-uds-core-store meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate service -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate service -n pepr-system pepr-uds-core-watcher meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate deployment -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate deployment -n pepr-system pepr-uds-core-watcher meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate mutatingwebhookconfiguration -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
./zarf tools kubectl annotate validatingwebhookconfiguration -n pepr-system pepr-uds-core meta.helm.sh/release-name=module --overwrite || true
1 change: 0 additions & 1 deletion src/promtail/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions src/promtail/chart/templates/service.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions src/promtail/chart/templates/uds-exemption.yaml

This file was deleted.

Loading
Loading